| author | |
| committer | |
| log | d94e061ade545f3fbdd4ab1a18f860b05050ebf6 |
| tree | d4524d99ab3748c71a826b09c26276bd7f699b45 |
| parent | 9649ff37ef15aae06d4020ce3b7210fa2aaf2a25 |
| parent | 210b764c03b736a6fe025b5fac030eec0350f0df |
| signature |
ELF updates for gABI 4.36 files changed, 34 insertions(+), 20 deletions(-)
lib/std/Build/Step/CheckObject.zig+1-1| ... | ... | @@ -2226,7 +2226,7 @@ const ElfDumper = struct { |
| 2226 | 2226 | try writer.print(" {s}", .{sym_bind}); |
| 2227 | 2227 | } |
| 2228 | 2228 | |
| 2229 | const sym_vis = @as(elf.STV, @enumFromInt(@as(u2, @truncate(sym.st_other)))); | |
| 2229 | const sym_vis = @as(elf.STV, @enumFromInt(@as(u3, @truncate(sym.st_other)))); | |
| 2230 | 2230 | try writer.print(" {s}", .{@tagName(sym_vis)}); |
| 2231 | 2231 | |
| 2232 | 2232 | const sym_name = switch (sym.st_type()) { |
lib/std/elf.zig+27-13| ... | ... | @@ -1122,17 +1122,17 @@ pub const OSABI = enum(u8) { |
| 1122 | 1122 | CLOUDABI = 17, |
| 1123 | 1123 | /// Stratus Technologies OpenVOS |
| 1124 | 1124 | OPENVOS = 18, |
| 1125 | /// NVIDIA CUDA architecture | |
| 1125 | /// NVIDIA CUDA architecture (not gABI assigned) | |
| 1126 | 1126 | CUDA = 51, |
| 1127 | /// AMD HSA Runtime | |
| 1127 | /// AMD HSA Runtime (not gABI assigned) | |
| 1128 | 1128 | AMDGPU_HSA = 64, |
| 1129 | /// AMD PAL Runtime | |
| 1129 | /// AMD PAL Runtime (not gABI assigned) | |
| 1130 | 1130 | AMDGPU_PAL = 65, |
| 1131 | /// AMD Mesa3D Runtime | |
| 1131 | /// AMD Mesa3D Runtime (not gABI assigned) | |
| 1132 | 1132 | AMDGPU_MESA3D = 66, |
| 1133 | /// ARM | |
| 1133 | /// ARM (not gABI assigned) | |
| 1134 | 1134 | ARM = 97, |
| 1135 | /// Standalone (embedded) application | |
| 1135 | /// Standalone (embedded) application (not gABI assigned) | |
| 1136 | 1136 | STANDALONE = 255, |
| 1137 | 1137 | |
| 1138 | 1138 | _, |
| ... | ... | @@ -1165,11 +1165,11 @@ pub const EM = enum(u16) { |
| 1165 | 1165 | S370 = 9, |
| 1166 | 1166 | /// MIPS R3000 (and R4000) little-endian, Oct 4 1993 Draft (deprecated) |
| 1167 | 1167 | MIPS_RS3_LE = 10, |
| 1168 | /// Old version of Sparc v9, from before the ABI (deprecated) | |
| 1168 | /// Old version of Sparc v9, from before the ABI (not gABI assigned) | |
| 1169 | 1169 | OLD_SPARCV9 = 11, |
| 1170 | 1170 | /// HPPA |
| 1171 | 1171 | PARISC = 15, |
| 1172 | /// Fujitsu VPP500 (also old version of PowerPC; deprecated) | |
| 1172 | /// Fujitsu VPP500 (also old version of PowerPC, which was not gABI assigned) | |
| 1173 | 1173 | VPP500 = 17, |
| 1174 | 1174 | /// Sun's "v8plus" |
| 1175 | 1175 | SPARC32PLUS = 18, |
| ... | ... | @@ -1189,7 +1189,7 @@ pub const EM = enum(u16) { |
| 1189 | 1189 | FR20 = 37, |
| 1190 | 1190 | /// TRW RH32 |
| 1191 | 1191 | RH32 = 38, |
| 1192 | /// Motorola M*Core, aka RCE (also Fujitsu MMA) | |
| 1192 | /// Motorola M*Core, aka RCE (also old Fujitsu MMA, which was not gABI assigned) | |
| 1193 | 1193 | MCORE = 39, |
| 1194 | 1194 | /// ARM |
| 1195 | 1195 | ARM = 40, |
| ... | ... | @@ -1301,7 +1301,7 @@ pub const EM = enum(u16) { |
| 1301 | 1301 | ARC_COMPACT = 93, |
| 1302 | 1302 | /// Tensilica Xtensa Architecture |
| 1303 | 1303 | XTENSA = 94, |
| 1304 | /// Alphamosaic VideoCore processor (also old Sunplus S+core7 backend magic number) | |
| 1304 | /// Alphamosaic VideoCore processor (also old Sunplus S+core7 backend magic number, which was not gABI assigned) | |
| 1305 | 1305 | VIDEOCORE = 95, |
| 1306 | 1306 | /// Thompson Multimedia General Purpose Processor |
| 1307 | 1307 | TMM_GPP = 96, |
| ... | ... | @@ -1309,7 +1309,7 @@ pub const EM = enum(u16) { |
| 1309 | 1309 | NS32K = 97, |
| 1310 | 1310 | /// Tenor Network TPC processor |
| 1311 | 1311 | TPC = 98, |
| 1312 | /// Trebia SNP 1000 processor (also old value for picoJava; deprecated) | |
| 1312 | /// Trebia SNP 1000 processor (also old value for picoJava, which was not gABI assigned) | |
| 1313 | 1313 | SNP1K = 99, |
| 1314 | 1314 | /// STMicroelectronics ST200 microcontroller |
| 1315 | 1315 | ST200 = 100, |
| ... | ... | @@ -1341,7 +1341,7 @@ pub const EM = enum(u16) { |
| 1341 | 1341 | ALTERA_NIOS2 = 113, |
| 1342 | 1342 | /// National Semiconductor CRX |
| 1343 | 1343 | CRX = 114, |
| 1344 | /// Motorola XGATE embedded processor (also old value for National Semiconductor CompactRISC; deprecated) | |
| 1344 | /// Motorola XGATE embedded processor (also old value for National Semiconductor CompactRISC, which was not gABI assigned) | |
| 1345 | 1345 | XGATE = 115, |
| 1346 | 1346 | /// Infineon C16x/XC16x processor |
| 1347 | 1347 | C166 = 116, |
| ... | ... | @@ -1377,6 +1377,8 @@ pub const EM = enum(u16) { |
| 1377 | 1377 | TI_C2000 = 141, |
| 1378 | 1378 | /// Texas Instruments TMS320C55x DSP family |
| 1379 | 1379 | TI_C5500 = 142, |
| 1380 | /// Texas Instruments Application Specific RISC Processor, 32bit fetch | |
| 1381 | TI_ARP32 = 143, | |
| 1380 | 1382 | /// Texas Instruments Programmable Realtime Unit |
| 1381 | 1383 | TI_PRU = 144, |
| 1382 | 1384 | /// STMicroelectronics 64bit VLIW Data Signal Processor |
| ... | ... | @@ -1537,6 +1539,18 @@ pub const EM = enum(u16) { |
| 1537 | 1539 | TACHYUM = 261, |
| 1538 | 1540 | /// NXP 56800EF Digital Signal Controller (DSC) |
| 1539 | 1541 | @"56800EF" = 262, |
| 1542 | /// Solana Bytecode Format | |
| 1543 | SBF = 263, | |
| 1544 | /// AMD/Xilinx AIEngine architecture | |
| 1545 | AIENGINE = 264, | |
| 1546 | /// SiMa MLA | |
| 1547 | SIMA_MLA = 265, | |
| 1548 | /// Cambricon BANG | |
| 1549 | BANG = 266, | |
| 1550 | /// Loongson LoongGPU | |
| 1551 | LOONGGPU = 267, | |
| 1552 | /// Wuxi Institute of Advanced Technology SW64 | |
| 1553 | SW64 = 268, | |
| 1540 | 1554 | /// AVR |
| 1541 | 1555 | AVR_OLD = 0x1057, |
| 1542 | 1556 | /// MSP430 |
| ... | ... | @@ -2289,7 +2303,7 @@ pub const R_PPC64 = enum(u32) { |
| 2289 | 2303 | _, |
| 2290 | 2304 | }; |
| 2291 | 2305 | |
| 2292 | pub const STV = enum(u2) { | |
| 2306 | pub const STV = enum(u3) { | |
| 2293 | 2307 | DEFAULT = 0, |
| 2294 | 2308 | INTERNAL = 1, |
| 2295 | 2309 | HIDDEN = 2, |
src/link/Elf/Object.zig+2-2| ... | ... | @@ -634,7 +634,7 @@ pub fn claimUnresolved(self: *Object, elf_file: *Elf) void { |
| 634 | 634 | |
| 635 | 635 | const is_import = blk: { |
| 636 | 636 | if (!elf_file.isEffectivelyDynLib()) break :blk false; |
| 637 | const vis = @as(elf.STV, @enumFromInt(esym.st_other)); | |
| 637 | const vis: elf.STV = @enumFromInt(@as(u3, @truncate(esym.st_other))); | |
| 638 | 638 | if (vis == .HIDDEN) break :blk false; |
| 639 | 639 | break :blk true; |
| 640 | 640 | }; |
| ... | ... | @@ -707,7 +707,7 @@ pub fn markImportsExports(self: *Object, elf_file: *Elf) void { |
| 707 | 707 | const file = sym.file(elf_file).?; |
| 708 | 708 | // https://github.com/ziglang/zig/issues/21678 |
| 709 | 709 | if (@as(u16, @bitCast(sym.version_index)) == @as(u16, @bitCast(elf.Versym.LOCAL))) continue; |
| 710 | const vis: elf.STV = @enumFromInt(sym.elfSym(elf_file).st_other); | |
| 710 | const vis: elf.STV = @enumFromInt(@as(u3, @truncate(sym.elfSym(elf_file).st_other))); | |
| 711 | 711 | if (vis == .HIDDEN) continue; |
| 712 | 712 | if (file == .shared_object and !sym.isAbs(elf_file)) { |
| 713 | 713 | sym.flags.import = true; |
src/link/Elf/SharedObject.zig+1-1| ... | ... | @@ -357,7 +357,7 @@ pub fn markImportExports(self: *SharedObject, elf_file: *Elf) void { |
| 357 | 357 | const ref = self.resolveSymbol(@intCast(i), elf_file); |
| 358 | 358 | const ref_sym = elf_file.symbol(ref) orelse continue; |
| 359 | 359 | const ref_file = ref_sym.file(elf_file).?; |
| 360 | const vis = @as(elf.STV, @enumFromInt(ref_sym.elfSym(elf_file).st_other)); | |
| 360 | const vis: elf.STV = @enumFromInt(@as(u3, @truncate(ref_sym.elfSym(elf_file).st_other))); | |
| 361 | 361 | if (ref_file != .shared_object and vis != .HIDDEN) ref_sym.flags.@"export" = true; |
| 362 | 362 | } |
| 363 | 363 | } |
src/link/Elf/ZigObject.zig+2-2| ... | ... | @@ -617,7 +617,7 @@ pub fn claimUnresolved(self: *ZigObject, elf_file: *Elf) void { |
| 617 | 617 | |
| 618 | 618 | const is_import = blk: { |
| 619 | 619 | if (!elf_file.isEffectivelyDynLib()) break :blk false; |
| 620 | const vis = @as(elf.STV, @enumFromInt(esym.st_other)); | |
| 620 | const vis: elf.STV = @enumFromInt(@as(u3, @truncate(esym.st_other))); | |
| 621 | 621 | if (vis == .HIDDEN) break :blk false; |
| 622 | 622 | break :blk true; |
| 623 | 623 | }; |
| ... | ... | @@ -695,7 +695,7 @@ pub fn markImportsExports(self: *ZigObject, elf_file: *Elf) void { |
| 695 | 695 | const file = sym.file(elf_file).?; |
| 696 | 696 | // https://github.com/ziglang/zig/issues/21678 |
| 697 | 697 | if (@as(u16, @bitCast(sym.version_index)) == @as(u16, @bitCast(elf.Versym.LOCAL))) continue; |
| 698 | const vis: elf.STV = @enumFromInt(sym.elfSym(elf_file).st_other); | |
| 698 | const vis: elf.STV = @enumFromInt(@as(u3, @truncate(sym.elfSym(elf_file).st_other))); | |
| 699 | 699 | if (vis == .HIDDEN) continue; |
| 700 | 700 | if (file == .shared_object and !sym.isAbs(elf_file)) { |
| 701 | 701 | sym.flags.import = true; |
tools/gen_stubs.zig+1-1| ... | ... | @@ -608,7 +608,7 @@ fn parseElf(parse: Parse, comptime is_64: bool, comptime endian: builtin.Endian) |
| 608 | 608 | const name = try arena.dupe(u8, mem.sliceTo(dynstr[s(sym.st_name)..], 0)); |
| 609 | 609 | const ty = @as(u4, @truncate(sym.st_info)); |
| 610 | 610 | const binding = @as(u4, @truncate(sym.st_info >> 4)); |
| 611 | const visib = @as(elf.STV, @enumFromInt(@as(u2, @truncate(sym.st_other)))); | |
| 611 | const visib = @as(elf.STV, @enumFromInt(@as(u3, @truncate(sym.st_other)))); | |
| 612 | 612 | const size = s(sym.st_size); |
| 613 | 613 | |
| 614 | 614 | if (size == 0) { |