Skip to content

Commit efaa9e2

Browse files
committed
Limit special behavior to AArch64
1 parent af42aeb commit efaa9e2

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

lld/ELF/Driver.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2638,11 +2638,16 @@ void LinkerDriver::compileBitcodeFiles(bool skipLinkedOutput) {
26382638
auto *obj = cast<ObjFile<ELFT>>(file.get());
26392639
obj->parse(/*ignoreComdats=*/true);
26402640

2641-
for (typename ELFT::Sym elfSym : obj->template getGlobalELFSyms<ELFT>()) {
2642-
StringRef elfSymName = check(elfSym.getName(obj->getStringTable()));
2643-
if (Symbol *sym = ctx.symtab->find(elfSymName))
2644-
if (sym->type == STT_NOTYPE)
2645-
sym->type = elfSym.getType();
2641+
// This is only needed for AArch64 PAuth to set correct key in AUTH GOT
2642+
// entry based on symbol type (STT_FUNC or not).
2643+
// TODO: check if PAuth is actually used.
2644+
if (ctx.arg.emachine == EM_AARCH64) {
2645+
for (typename ELFT::Sym elfSym : obj->template getGlobalELFSyms<ELFT>()) {
2646+
StringRef elfSymName = check(elfSym.getName(obj->getStringTable()));
2647+
if (Symbol *sym = ctx.symtab->find(elfSymName))
2648+
if (sym->type == STT_NOTYPE)
2649+
sym->type = elfSym.getType();
2650+
}
26462651
}
26472652

26482653
// For defined symbols in non-relocatable output,

0 commit comments

Comments
 (0)