| ... | @@ -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 | } |