diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2024-02-13 16:42:28 +0100 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2024-02-13 20:33:01 +0100 |
| commit | e401930fa862e3b9b3eedc8eb405c501fbf3de30 (patch) | |
| tree | dad8558d3ccf98880a4c7f8f6ecb443b52a34247 /src/link/Elf/Object.zig | |
| parent | c22bb3805821d7ffe60e048f1efe362aad703668 (diff) | |
| download | zig-e401930fa862e3b9b3eedc8eb405c501fbf3de30.tar.gz zig-e401930fa862e3b9b3eedc8eb405c501fbf3de30.zip | |
elf: store relative offsets in atom and symbol
Diffstat (limited to 'src/link/Elf/Object.zig')
| -rw-r--r-- | src/link/Elf/Object.zig | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/src/link/Elf/Object.zig b/src/link/Elf/Object.zig index 882025ab8c..246fd9a155 100644 --- a/src/link/Elf/Object.zig +++ b/src/link/Elf/Object.zig @@ -718,21 +718,11 @@ pub fn addAtomsToOutputSections(self: *Object, elf_file: *Elf) !void { if (!gop.found_existing) gop.value_ptr.* = .{}; try gop.value_ptr.append(gpa, atom_index); } -} - -pub fn allocateAtoms(self: Object, elf_file: *Elf) void { - for (self.atoms.items) |atom_index| { - const atom = elf_file.atom(atom_index) orelse continue; - if (!atom.flags.alive) continue; - const shdr = elf_file.shdrs.items[atom.output_section_index]; - atom.value += shdr.sh_addr; - } for (self.locals()) |local_index| { const local = elf_file.symbol(local_index); const atom = local.atom(elf_file) orelse continue; if (!atom.flags.alive) continue; - local.value += atom.value; local.output_section_index = atom.output_section_index; } @@ -741,7 +731,6 @@ pub fn allocateAtoms(self: Object, elf_file: *Elf) void { const atom = global.atom(elf_file) orelse continue; if (!atom.flags.alive) continue; if (global.file(elf_file).?.index() != self.index) continue; - global.value += atom.value; global.output_section_index = atom.output_section_index; } } |
