| ... | ... | @@ -336,7 +336,7 @@ pub fn writeRelocs(self: Atom, elf_file: *Elf, out_relocs: *std.ArrayList(elf.El |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | relocs_log.debug(" {s}: [{x} => {d}({s})] + {x}", .{ |
| 339 | | relocation.fmtRelocType(r_type, cpu_arch), |
| 339 | relocation.fmtRelocType(rel.r_type(), cpu_arch), |
| 340 | 340 | r_offset, |
| 341 | 341 | r_sym, |
| 342 | 342 | target.name(elf_file), |
| ... | ... | @@ -1028,7 +1028,7 @@ const x86_64 = struct { |
| 1028 | 1028 | const DTP = @as(i64, @intCast(elf_file.dtpAddress())); |
| 1029 | 1029 | |
| 1030 | 1030 | relocs_log.debug(" {s}: {x}: [{x} => {x}] G({x}) ZG({x}) ({s})", .{ |
| 1031 | | @tagName(r_type), |
| 1031 | relocation.fmtRelocType(rel.r_type(), .x86_64), |
| 1032 | 1032 | r_offset, |
| 1033 | 1033 | P, |
| 1034 | 1034 | S + A, |
| ... | ... | @@ -1218,8 +1218,8 @@ const x86_64 = struct { |
| 1218 | 1218 | // Address of the dynamic thread pointer. |
| 1219 | 1219 | const DTP = @as(i64, @intCast(elf_file.dtpAddress())); |
| 1220 | 1220 | |
| 1221 | | relocs_log.debug(" {s}: {x}: [{x} => {x}] ({s})", .{ |
| 1222 | | @tagName(r_type), |
| 1221 | relocs_log.debug(" {}: {x}: [{x} => {x}] ({s})", .{ |
| 1222 | relocation.fmtRelocType(rel.r_type(), .x86_64), |
| 1223 | 1223 | rel.r_offset, |
| 1224 | 1224 | P, |
| 1225 | 1225 | S + A, |
| ... | ... | @@ -1291,9 +1291,8 @@ const x86_64 = struct { |
| 1291 | 1291 | ) !void { |
| 1292 | 1292 | assert(rels.len == 2); |
| 1293 | 1293 | const writer = stream.writer(); |
| 1294 | | const rel_0: elf.R_X86_64 = @enumFromInt(rels[0].r_type()); |
| 1295 | | const rel_1: elf.R_X86_64 = @enumFromInt(rels[1].r_type()); |
| 1296 | | switch (rel_1) { |
| 1294 | const rel: elf.R_X86_64 = @enumFromInt(rels[1].r_type()); |
| 1295 | switch (rel) { |
| 1297 | 1296 | .R_X86_64_PC32, |
| 1298 | 1297 | .R_X86_64_PLT32, |
| 1299 | 1298 | => { |
| ... | ... | @@ -1308,9 +1307,9 @@ const x86_64 = struct { |
| 1308 | 1307 | |
| 1309 | 1308 | else => { |
| 1310 | 1309 | var err = try elf_file.addErrorWithNotes(1); |
| 1311 | | try err.addMsg(elf_file, "fatal linker error: rewrite {s} when followed by {s}", .{ |
| 1312 | | @tagName(rel_0), |
| 1313 | | @tagName(rel_1), |
| 1310 | try err.addMsg(elf_file, "fatal linker error: rewrite {} when followed by {}", .{ |
| 1311 | relocation.fmtRelocType(rels[0].r_type(), .x86_64), |
| 1312 | relocation.fmtRelocType(rels[1].r_type(), .x86_64), |
| 1314 | 1313 | }); |
| 1315 | 1314 | try err.addNote(elf_file, "in {}:{s} at offset 0x{x}", .{ |
| 1316 | 1315 | self.file(elf_file).?.fmtPath(), |
| ... | ... | @@ -1330,9 +1329,8 @@ const x86_64 = struct { |
| 1330 | 1329 | ) !void { |
| 1331 | 1330 | assert(rels.len == 2); |
| 1332 | 1331 | const writer = stream.writer(); |
| 1333 | | const rel_0: elf.R_X86_64 = @enumFromInt(rels[0].r_type()); |
| 1334 | | const rel_1: elf.R_X86_64 = @enumFromInt(rels[1].r_type()); |
| 1335 | | switch (rel_1) { |
| 1332 | const rel: elf.R_X86_64 = @enumFromInt(rels[1].r_type()); |
| 1333 | switch (rel) { |
| 1336 | 1334 | .R_X86_64_PC32, |
| 1337 | 1335 | .R_X86_64_PLT32, |
| 1338 | 1336 | => { |
| ... | ... | @@ -1362,9 +1360,9 @@ const x86_64 = struct { |
| 1362 | 1360 | |
| 1363 | 1361 | else => { |
| 1364 | 1362 | var err = try elf_file.addErrorWithNotes(1); |
| 1365 | | try err.addMsg(elf_file, "fatal linker error: rewrite {s} when followed by {s}", .{ |
| 1366 | | @tagName(rel_0), |
| 1367 | | @tagName(rel_1), |
| 1363 | try err.addMsg(elf_file, "fatal linker error: rewrite {} when followed by {}", .{ |
| 1364 | relocation.fmtRelocType(rels[0].r_type(), .x86_64), |
| 1365 | relocation.fmtRelocType(rels[1].r_type(), .x86_64), |
| 1368 | 1366 | }); |
| 1369 | 1367 | try err.addNote(elf_file, "in {}:{s} at offset 0x{x}", .{ |
| 1370 | 1368 | self.file(elf_file).?.fmtPath(), |
| ... | ... | @@ -1431,9 +1429,8 @@ const x86_64 = struct { |
| 1431 | 1429 | ) !void { |
| 1432 | 1430 | assert(rels.len == 2); |
| 1433 | 1431 | const writer = stream.writer(); |
| 1434 | | const rel_0: elf.R_X86_64 = @enumFromInt(rels[0].r_type()); |
| 1435 | | const rel_1: elf.R_X86_64 = @enumFromInt(rels[1].r_type()); |
| 1436 | | switch (rel_1) { |
| 1432 | const rel: elf.R_X86_64 = @enumFromInt(rels[1].r_type()); |
| 1433 | switch (rel) { |
| 1437 | 1434 | .R_X86_64_PC32, |
| 1438 | 1435 | .R_X86_64_PLT32, |
| 1439 | 1436 | .R_X86_64_GOTPCREL, |
| ... | ... | @@ -1446,14 +1443,17 @@ const x86_64 = struct { |
| 1446 | 1443 | std.mem.writeInt(i32, insts[12..][0..4], value, .little); |
| 1447 | 1444 | try stream.seekBy(-4); |
| 1448 | 1445 | try writer.writeAll(&insts); |
| 1449 | | relocs_log.debug(" relaxing {s} and {s}", .{ @tagName(rel_0), @tagName(rel_1) }); |
| 1446 | relocs_log.debug(" relaxing {} and {}", .{ |
| 1447 | relocation.fmtRelocType(rels[0].r_type(), .x86_64), |
| 1448 | relocation.fmtRelocType(rels[1].r_type(), .x86_64), |
| 1449 | }); |
| 1450 | 1450 | }, |
| 1451 | 1451 | |
| 1452 | 1452 | else => { |
| 1453 | 1453 | var err = try elf_file.addErrorWithNotes(1); |
| 1454 | | try err.addMsg(elf_file, "fatal linker error: rewrite {s} when followed by {s}", .{ |
| 1455 | | @tagName(rel_0), |
| 1456 | | @tagName(rel_1), |
| 1454 | try err.addMsg(elf_file, "fatal linker error: rewrite {} when followed by {}", .{ |
| 1455 | relocation.fmtRelocType(rels[0].r_type(), .x86_64), |
| 1456 | relocation.fmtRelocType(rels[1].r_type(), .x86_64), |
| 1457 | 1457 | }); |
| 1458 | 1458 | try err.addNote(elf_file, "in {}:{s} at offset 0x{x}", .{ |
| 1459 | 1459 | self.file(elf_file).?.fmtPath(), |