Skip to content

Commit 164194a

Browse files
committed
[ELF] Untangle R_GOT style TLS IE and processRelocAux. NFC
1 parent 948b91a commit 164194a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lld/ELF/Relocations.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,9 +1279,9 @@ handleTlsRelocation(RelType type, Symbol &sym, InputSectionBase &c,
12791279
} else if (expr != R_TLSIE_HINT) {
12801280
if (!sym.isInGot())
12811281
addTpOffsetGotEntry(sym);
1282-
// R_GOT may not be a link-time constant.
1283-
if (expr == R_GOT)
1284-
processRelocAux<ELFT>(c, expr, type, offset, sym, addend);
1282+
// R_GOT needs a relative relocation for PIC on i386 and Hexagon.
1283+
if (expr == R_GOT && config->isPic && !target->usesOnlyLowPageBits(type))
1284+
addRelativeReloc(&c, offset, sym, addend, expr, type);
12851285
else
12861286
c.relocations.push_back({expr, type, offset, addend, &sym});
12871287
}

0 commit comments

Comments
 (0)