forked from OSchip/llvm-project
[ELF] Read IFUNC symbols correctly as typeResolver.
llvm-svn: 173299
This commit is contained in:
parent
4f2162f8f8
commit
563d33a6f1
|
@ -1,5 +1,6 @@
|
|||
include "llvm/Option/OptParser.td"
|
||||
|
||||
def core : Flag<["-"], "core">;
|
||||
def flavor : Separate<["-"], "flavor">;
|
||||
def target : Separate<["-"], "target">, HelpText<"Target triple to link for">;
|
||||
def mllvm : Separate<["-"], "mllvm">, HelpText<"Options to pass to LLVM">;
|
||||
|
|
|
@ -236,6 +236,9 @@ public:
|
|||
ContentType ret = typeUnknown;
|
||||
uint64_t flags = _section->sh_flags;
|
||||
|
||||
if (_symbol->getType() == llvm::ELF::STT_GNU_IFUNC)
|
||||
return typeResolver;
|
||||
|
||||
if (_symbol->st_shndx == llvm::ELF::SHN_COMMON)
|
||||
return typeZeroFill;
|
||||
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
.text
|
||||
.globl hey;
|
||||
.type hey, @function;
|
||||
hey:
|
||||
.type hey, @gnu_indirect_function;
|
||||
leaq __hey_1(%rip), %rax
|
||||
ret
|
||||
|
||||
.text
|
||||
.type __hey_1, @function;
|
||||
.globl __hey_1;
|
||||
__hey_1:
|
||||
movq $42, %rax
|
||||
ret
|
Binary file not shown.
|
@ -0,0 +1,6 @@
|
|||
RUN: lld -core -target x86_64-linux -emit-yaml -output=- %p/Inputs/ifunc.x86-64 \
|
||||
RUN: | FileCheck %s
|
||||
|
||||
CHECK: name: hey
|
||||
CHECK: scope: global
|
||||
CHECK: type: resolver
|
Loading…
Reference in New Issue