mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:32:44 +01:00
[MC] Don't resolve relocations referencing STB_LOCAL STT_GNU_IFUNC
This commit is contained in:
parent
8fb73cb820
commit
2f4e86624d
@ -1514,7 +1514,8 @@ bool ELFObjectWriter::isSymbolRefDifferenceFullyResolvedImpl(
|
||||
const auto &SymA = cast<MCSymbolELF>(SA);
|
||||
if (IsPCRel) {
|
||||
assert(!InSet);
|
||||
if (SymA.getBinding() != ELF::STB_LOCAL)
|
||||
if (SymA.getBinding() != ELF::STB_LOCAL ||
|
||||
SymA.getType() == ELF::STT_GNU_IFUNC)
|
||||
return false;
|
||||
}
|
||||
return MCObjectWriter::isSymbolRefDifferenceFullyResolvedImpl(Asm, SymA, FB,
|
||||
|
@ -9,6 +9,7 @@
|
||||
# RELOC-NEXT: 0xA R_X86_64_PLT32 weak 0xFFFFFFFFFFFFFFFC
|
||||
# RELOC-NEXT: 0x19 R_X86_64_PLT32 global 0xFFFFFFFFFFFFFFFC
|
||||
# RELOC-NEXT: 0x1E R_X86_64_PLT32 weak 0xFFFFFFFFFFFFFFFC
|
||||
# RELOC-NEXT: 0x23 R_X86_64_PLT32 ifunc 0xFFFFFFFFFFFFFFFC
|
||||
# RELOC-NEXT: }
|
||||
|
||||
# CHECK: 0: jmp
|
||||
@ -19,14 +20,17 @@
|
||||
# CHECK-NEXT: 13: callq
|
||||
# CHECK-NEXT: 18: callq
|
||||
# CHECK-NEXT: 1d: callq
|
||||
# CHECK-NEXT: 22: retq
|
||||
# CHECK-NEXT: 22: callq
|
||||
# CHECK-NEXT: 27: retq
|
||||
|
||||
.globl global
|
||||
.weak weak
|
||||
.type ifunc,@gnu_indirect_function
|
||||
global:
|
||||
weak:
|
||||
local:
|
||||
.set var,global
|
||||
ifunc:
|
||||
jmp var
|
||||
jmp local
|
||||
jmp global
|
||||
@ -36,4 +40,6 @@ local:
|
||||
call local
|
||||
call global
|
||||
call weak
|
||||
|
||||
call ifunc
|
||||
ret
|
||||
|
Loading…
Reference in New Issue
Block a user