| ... | ... | @@ -4269,6 +4269,8 @@ fn writeSyntheticSections(self: *Elf) !void { |
| 4269 | 4269 | } |
| 4270 | 4270 | |
| 4271 | 4271 | if (self.rela_dyn_section_index) |shndx| { |
| 4272 | // TODO: would state tracking be more appropriate here? perhaps even custom relocation type? |
| 4273 | self.rela_dyn.clearRetainingCapacity(); |
| 4272 | 4274 | const shdr = slice.items(.shdr)[shndx]; |
| 4273 | 4275 | try self.got.addRela(self); |
| 4274 | 4276 | try self.copy_rel.addRela(self); |
| ... | ... | @@ -4301,6 +4303,8 @@ fn writeSyntheticSections(self: *Elf) !void { |
| 4301 | 4303 | } |
| 4302 | 4304 | |
| 4303 | 4305 | if (self.rela_plt_section_index) |shndx| { |
| 4306 | // TODO: would state tracking be more appropriate here? perhaps even custom relocation type? |
| 4307 | self.rela_plt.clearRetainingCapacity(); |
| 4304 | 4308 | const shdr = slice.items(.shdr)[shndx]; |
| 4305 | 4309 | try self.plt.addRela(self); |
| 4306 | 4310 | try self.base.file.?.pwriteAll(mem.sliceAsBytes(self.rela_plt.items), shdr.sh_offset); |