mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
[llvm-nm] Display STT_GNU_IFUNC as 'i'
Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D71803
This commit is contained in:
parent
d3bcd94780
commit
8e823f1246
@ -1,7 +1,7 @@
|
|||||||
; RUN: opt -module-summary -o %t.bc %s
|
; RUN: opt -module-summary -o %t.bc %s
|
||||||
; RUN: llvm-lto2 run %t.bc -r %t.bc,foo,pl -o %t2
|
; RUN: llvm-lto2 run %t.bc -r %t.bc,foo,pl -o %t2
|
||||||
; RUN: llvm-nm %t2.1 | FileCheck %s
|
; RUN: llvm-nm %t2.1 | FileCheck %s
|
||||||
; CHECK: T foo
|
; CHECK: i foo
|
||||||
; CHECK: t foo_ifunc
|
; CHECK: t foo_ifunc
|
||||||
|
|
||||||
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
||||||
|
27
test/tools/llvm-nm/ifunc.test
Normal file
27
test/tools/llvm-nm/ifunc.test
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
## Test that the symbol type of STT_GNU_IFUNC is 'i'.
|
||||||
|
|
||||||
|
# RUN: yaml2obj %s -o %t
|
||||||
|
# RUN: llvm-nm --no-sort %t | FileCheck %s
|
||||||
|
|
||||||
|
# CHECK: i ifunc_local
|
||||||
|
# CHECK-NEXT: i ifunc_global
|
||||||
|
|
||||||
|
!ELF
|
||||||
|
FileHeader:
|
||||||
|
Class: ELFCLASS64
|
||||||
|
Data: ELFDATA2LSB
|
||||||
|
Type: ET_REL
|
||||||
|
Machine: EM_X86_64
|
||||||
|
Sections:
|
||||||
|
- Name: .text
|
||||||
|
Type: SHT_PROGBITS
|
||||||
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
||||||
|
Symbols:
|
||||||
|
- Name: ifunc_local
|
||||||
|
Type: STT_GNU_IFUNC
|
||||||
|
Binding: STB_LOCAL
|
||||||
|
Section: .text
|
||||||
|
- Name: ifunc_global
|
||||||
|
Type: STT_GNU_IFUNC
|
||||||
|
Binding: STB_GLOBAL
|
||||||
|
Section: .text
|
@ -1133,15 +1133,18 @@ static char getNMSectionTagAndName(SymbolicFile &Obj, basic_symbol_iterator I,
|
|||||||
Ret = getSymbolNMTypeChar(*MachO, I);
|
Ret = getSymbolNMTypeChar(*MachO, I);
|
||||||
else if (WasmObjectFile *Wasm = dyn_cast<WasmObjectFile>(&Obj))
|
else if (WasmObjectFile *Wasm = dyn_cast<WasmObjectFile>(&Obj))
|
||||||
Ret = getSymbolNMTypeChar(*Wasm, I);
|
Ret = getSymbolNMTypeChar(*Wasm, I);
|
||||||
else
|
else if (ELFObjectFileBase *ELF = dyn_cast<ELFObjectFileBase>(&Obj)) {
|
||||||
Ret = getSymbolNMTypeChar(cast<ELFObjectFileBase>(Obj), I);
|
if (ELFSymbolRef(*I).getELFType() == ELF::STT_GNU_IFUNC)
|
||||||
|
return 'i';
|
||||||
|
Ret = getSymbolNMTypeChar(*ELF, I);
|
||||||
|
if (ELFSymbolRef(*I).getBinding() == ELF::STB_GNU_UNIQUE)
|
||||||
|
return Ret;
|
||||||
|
} else
|
||||||
|
llvm_unreachable("unknown binary format");
|
||||||
|
|
||||||
if (!(Symflags & object::SymbolRef::SF_Global))
|
if (!(Symflags & object::SymbolRef::SF_Global))
|
||||||
return Ret;
|
return Ret;
|
||||||
|
|
||||||
if (Obj.isELF() && ELFSymbolRef(*I).getBinding() == ELF::STB_GNU_UNIQUE)
|
|
||||||
return Ret;
|
|
||||||
|
|
||||||
return toupper(Ret);
|
return toupper(Ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user