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) {...@@ -95,16 +95,16 @@ pub const File = union(enum) {
95 log.debug("'{s}' is non-local", .{sym.name(ef)});95 log.debug("'{s}' is non-local", .{sym.name(ef)});
96 try ef.dynsym.addSymbol(ref, ef);96 try ef.dynsym.addSymbol(ref, ef);
97 }97 }
98 if (sym.flags.needs_got) {98 if (sym.flags.needs_got and !sym.flags.has_got) {
99 log.debug("'{s}' needs GOT", .{sym.name(ef)});99 log.debug("'{s}' needs GOT", .{sym.name(ef)});
100 _ = try ef.got.addGotSymbol(ref, ef);100 _ = try ef.got.addGotSymbol(ref, ef);
101 }101 }
102 if (sym.flags.needs_plt) {102 if (sym.flags.needs_plt and !sym.flags.has_plt) {
103 if (sym.flags.is_canonical) {103 if (sym.flags.is_canonical) {
104 log.debug("'{s}' needs CPLT", .{sym.name(ef)});104 log.debug("'{s}' needs CPLT", .{sym.name(ef)});
105 sym.flags.@"export" = true;105 sym.flags.@"export" = true;
106 try ef.plt.addSymbol(ref, ef);106 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) {
108 log.debug("'{s}' needs PLTGOT", .{sym.name(ef)});108 log.debug("'{s}' needs PLTGOT", .{sym.name(ef)});
109 try ef.plt_got.addSymbol(ref, ef);109 try ef.plt_got.addSymbol(ref, ef);
110 } else {110 } else {
...@@ -116,15 +116,15 @@ pub const File = union(enum) {...@@ -116,15 +116,15 @@ pub const File = union(enum) {
116 log.debug("'{s}' needs COPYREL", .{sym.name(ef)});116 log.debug("'{s}' needs COPYREL", .{sym.name(ef)});
117 try ef.copy_rel.addSymbol(ref, ef);117 try ef.copy_rel.addSymbol(ref, ef);
118 }118 }
119 if (sym.flags.needs_tlsgd) {119 if (sym.flags.needs_tlsgd and !sym.flags.has_tlsgd) {
120 log.debug("'{s}' needs TLSGD", .{sym.name(ef)});120 log.debug("'{s}' needs TLSGD", .{sym.name(ef)});
121 try ef.got.addTlsGdSymbol(ref, ef);121 try ef.got.addTlsGdSymbol(ref, ef);
122 }122 }
123 if (sym.flags.needs_gottp) {123 if (sym.flags.needs_gottp and !sym.flags.has_gottp) {
124 log.debug("'{s}' needs GOTTP", .{sym.name(ef)});124 log.debug("'{s}' needs GOTTP", .{sym.name(ef)});
125 try ef.got.addGotTpSymbol(ref, ef);125 try ef.got.addGotTpSymbol(ref, ef);
126 }126 }
127 if (sym.flags.needs_tlsdesc) {127 if (sym.flags.needs_tlsdesc and !sym.flags.has_tlsdesc) {
128 log.debug("'{s}' needs TLSDESC", .{sym.name(ef)});128 log.debug("'{s}' needs TLSDESC", .{sym.name(ef)});
129 try ef.got.addTlsDescSymbol(ref, ef);129 try ef.got.addTlsDescSymbol(ref, ef);
130 }130 }