aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2024-09-26 20:59:42 +0200
committerAndrew Kelley <andrew@ziglang.org>2024-10-09 12:27:30 -0700
commitbc7e0342b52a24a1052721396dfa88cd86e1304b (patch)
tree6d062dac418e13368b0bc43e8c81a4d3b7df2156 /src
parent7fead5d6dd078beda041ef2f490fb50ffae4dc82 (diff)
downloadzig-bc7e0342b52a24a1052721396dfa88cd86e1304b.tar.gz
zig-bc7e0342b52a24a1052721396dfa88cd86e1304b.zip
elf: do not re-populate synthetic sections when updating
Diffstat (limited to 'src')
-rw-r--r--src/link/Elf/file.zig12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/link/Elf/file.zig b/src/link/Elf/file.zig
index 88dc807274..a1db5110f0 100644
--- 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);
}