| ... | @@ -731,15 +731,7 @@ pub fn resolveRelocsAlloc(self: Atom, elf_file: *Elf, code: []u8) RelocError!voi | ... | @@ -731,15 +731,7 @@ pub fn resolveRelocsAlloc(self: Atom, elf_file: *Elf, code: []u8) RelocError!voi |
| 731 | // Address of the target symbol - can be address of the symbol within an atom or address of PLT stub. | 731 | // Address of the target symbol - can be address of the symbol within an atom or address of PLT stub. |
| 732 | const S = @as(i64, @intCast(target.address(.{}, elf_file))); | 732 | const S = @as(i64, @intCast(target.address(.{}, elf_file))); |
| 733 | // Address of the global offset table. | 733 | // Address of the global offset table. |
| 734 | const GOT = blk: { | 734 | const GOT = @as(i64, @intCast(elf_file.gotAddress())); |
| 735 | const shndx = if (elf_file.got_plt_section_index) |shndx| | | |
| 736 | shndx | | |
| 737 | else if (elf_file.got_section_index) |shndx| | | |
| 738 | shndx | | |
| 739 | else | | |
| 740 | null; | | |
| 741 | break :blk if (shndx) |index| @as(i64, @intCast(elf_file.shdrs.items[index].sh_addr)) else 0; | | |
| 742 | }; | | |
| 743 | // Address of the .zig.got table entry if any. | 735 | // Address of the .zig.got table entry if any. |
| 744 | const ZIG_GOT = @as(i64, @intCast(target.zigGotAddress(elf_file))); | 736 | const ZIG_GOT = @as(i64, @intCast(target.zigGotAddress(elf_file))); |
| 745 | // Relative offset to the start of the global offset table. | 737 | // Relative offset to the start of the global offset table. |
| ... | @@ -924,15 +916,7 @@ pub fn resolveRelocsNonAlloc(self: Atom, elf_file: *Elf, code: []u8, undefs: any | ... | @@ -924,15 +916,7 @@ pub fn resolveRelocsNonAlloc(self: Atom, elf_file: *Elf, code: []u8, undefs: any |
| 924 | // Address of the target symbol - can be address of the symbol within an atom or address of PLT stub. | 916 | // Address of the target symbol - can be address of the symbol within an atom or address of PLT stub. |
| 925 | const S = @as(i64, @intCast(target.address(.{}, elf_file))); | 917 | const S = @as(i64, @intCast(target.address(.{}, elf_file))); |
| 926 | // Address of the global offset table. | 918 | // Address of the global offset table. |
| 927 | const GOT = blk: { | 919 | const GOT = @as(i64, @intCast(elf_file.gotAddress())); |
| 928 | const shndx = if (elf_file.got_plt_section_index) |shndx| | | |
| 929 | shndx | | |
| 930 | else if (elf_file.got_section_index) |shndx| | | |
| 931 | shndx | | |
| 932 | else | | |
| 933 | null; | | |
| 934 | break :blk if (shndx) |index| @as(i64, @intCast(elf_file.shdrs.items[index].sh_addr)) else 0; | | |
| 935 | }; | | |
| 936 | // Address of the dynamic thread pointer. | 920 | // Address of the dynamic thread pointer. |
| 937 | const DTP = @as(i64, @intCast(elf_file.dtpAddress())); | 921 | const DTP = @as(i64, @intCast(elf_file.dtpAddress())); |
| 938 | | 922 | |