zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit bc7e0342b52a24a1052721396dfa88cd86e1304b (tree)
parent 7fead5d6dd078beda041ef2f490fb50ffae4dc82
Author: Jakub Konka <kubkon@jakubkonka.com>
Date:   Thu, 26 Sep 2024 20:59:42 +0200

elf: do not re-populate synthetic sections when updating

Diffstat:
Msrc/link/Elf/file.zig | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/link/Elf/file.zig b/src/link/Elf/file.zig @@ -95,16 +95,16 @@ pub const File = union(enum) { log.debug("'{s}' is non-local", .{sym.name(ef)}); try ef.dynsym.addSymbol(ref, ef); } - if (sym.flags.needs_got) { + if (sym.flags.needs_got and !sym.flags.has_got) { log.debug("'{s}' needs GOT", .{sym.name(ef)}); _ = try ef.got.addGotSymbol(ref, ef); } - if (sym.flags.needs_plt) { + if (sym.flags.needs_plt and !sym.flags.has_plt) { if (sym.flags.is_canonical) { log.debug("'{s}' needs CPLT", .{sym.name(ef)}); sym.flags.@"export" = true; try ef.plt.addSymbol(ref, ef); - } else if (sym.flags.needs_got) { + } else if (sym.flags.needs_got and !sym.flags.has_got) { log.debug("'{s}' needs PLTGOT", .{sym.name(ef)}); try ef.plt_got.addSymbol(ref, ef); } else { @@ -116,15 +116,15 @@ pub const File = union(enum) { log.debug("'{s}' needs COPYREL", .{sym.name(ef)}); try ef.copy_rel.addSymbol(ref, ef); } - if (sym.flags.needs_tlsgd) { + if (sym.flags.needs_tlsgd and !sym.flags.has_tlsgd) { log.debug("'{s}' needs TLSGD", .{sym.name(ef)}); try ef.got.addTlsGdSymbol(ref, ef); } - if (sym.flags.needs_gottp) { + if (sym.flags.needs_gottp and !sym.flags.has_gottp) { log.debug("'{s}' needs GOTTP", .{sym.name(ef)}); try ef.got.addGotTpSymbol(ref, ef); } - if (sym.flags.needs_tlsdesc) { + if (sym.flags.needs_tlsdesc and !sym.flags.has_tlsdesc) { log.debug("'{s}' needs TLSDESC", .{sym.name(ef)}); try ef.got.addTlsDescSymbol(ref, ef); }