authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-09-26 20:59:42+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-10-09 12:27:30-07:00
logbc7e0342b52a24a1052721396dfa88cd86e1304b
tree6d062dac418e13368b0bc43e8c81a4d3b7df2156
parent7fead5d6dd078beda041ef2f490fb50ffae4dc82

elf: do not re-populate synthetic sections when updating


1 files changed, 6 insertions(+), 6 deletions(-)

src/link/Elf/file.zig+6-6
......@@ -95,16 +95,16 @@ pub const File = union(enum) {
9595 log.debug("'{s}' is non-local", .{sym.name(ef)});
9696 try ef.dynsym.addSymbol(ref, ef);
9797 }
98 if (sym.flags.needs_got) {
98 if (sym.flags.needs_got and !sym.flags.has_got) {
9999 log.debug("'{s}' needs GOT", .{sym.name(ef)});
100100 _ = try ef.got.addGotSymbol(ref, ef);
101101 }
102 if (sym.flags.needs_plt) {
102 if (sym.flags.needs_plt and !sym.flags.has_plt) {
103103 if (sym.flags.is_canonical) {
104104 log.debug("'{s}' needs CPLT", .{sym.name(ef)});
105105 sym.flags.@"export" = true;
106106 try ef.plt.addSymbol(ref, ef);
107 } else if (sym.flags.needs_got) {
107 } else if (sym.flags.needs_got and !sym.flags.has_got) {
108108 log.debug("'{s}' needs PLTGOT", .{sym.name(ef)});
109109 try ef.plt_got.addSymbol(ref, ef);
110110 } else {
......@@ -116,15 +116,15 @@ pub const File = union(enum) {
116116 log.debug("'{s}' needs COPYREL", .{sym.name(ef)});
117117 try ef.copy_rel.addSymbol(ref, ef);
118118 }
119 if (sym.flags.needs_tlsgd) {
119 if (sym.flags.needs_tlsgd and !sym.flags.has_tlsgd) {
120120 log.debug("'{s}' needs TLSGD", .{sym.name(ef)});
121121 try ef.got.addTlsGdSymbol(ref, ef);
122122 }
123 if (sym.flags.needs_gottp) {
123 if (sym.flags.needs_gottp and !sym.flags.has_gottp) {
124124 log.debug("'{s}' needs GOTTP", .{sym.name(ef)});
125125 try ef.got.addGotTpSymbol(ref, ef);
126126 }
127 if (sym.flags.needs_tlsdesc) {
127 if (sym.flags.needs_tlsdesc and !sym.flags.has_tlsdesc) {
128128 log.debug("'{s}' needs TLSDESC", .{sym.name(ef)});
129129 try ef.got.addTlsDescSymbol(ref, ef);
130130 }