mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-24 20:29:53 +00:00
Small fix for llvm-nm handling of weak symbols on ELF (print 'v').
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200808 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
524f08d603
commit
7e369ff2e5
BIN
test/Object/Inputs/weak.elf-x86-64
Normal file
BIN
test/Object/Inputs/weak.elf-x86-64
Normal file
Binary file not shown.
@ -6,6 +6,8 @@ RUN: llvm-nm %p/Inputs/trivial-object-test.elf-i386 \
|
||||
RUN: | FileCheck %s -check-prefix ELF
|
||||
RUN: llvm-nm %p/Inputs/trivial-object-test.elf-x86-64 \
|
||||
RUN: | FileCheck %s -check-prefix ELF
|
||||
RUN: llvm-nm %p/Inputs/weak.elf-x86-64 \
|
||||
RUN: | FileCheck %s -check-prefix WEAK-ELF
|
||||
RUN: llvm-nm %p/Inputs/trivial-object-test.macho-i386 \
|
||||
RUN: | FileCheck %s -check-prefix macho
|
||||
RUN: llvm-nm %p/Inputs/trivial-object-test.macho-x86-64 \
|
||||
@ -34,6 +36,10 @@ ELF: U SomeOtherFunction
|
||||
ELF: 00000000 T main
|
||||
ELF: U puts
|
||||
|
||||
WEAK-ELF: w f1
|
||||
WEAK-ELF: 00000000 W f2
|
||||
WEAK-ELF: v x1
|
||||
WEAK-ELF: 00000000 V x2
|
||||
|
||||
macho: 00000000 U _SomeOtherFunction
|
||||
macho: 00000000 T _main
|
||||
|
@ -360,8 +360,12 @@ static char getSymbolNMTypeChar(ELFObjectFile<ELFT> &Obj, symbol_iterator I) {
|
||||
Ret = ::toupper(Ret);
|
||||
break;
|
||||
case ELF::STB_WEAK:
|
||||
if (EF.getSymbolTableIndex(ESym) == ELF::SHN_UNDEF)
|
||||
Ret = 'w';
|
||||
if (EF.getSymbolTableIndex(ESym) == ELF::SHN_UNDEF) {
|
||||
if (ESym->getType() == ELF::STT_OBJECT)
|
||||
Ret = 'v';
|
||||
else
|
||||
Ret = 'w';
|
||||
}
|
||||
else if (ESym->getType() == ELF::STT_OBJECT)
|
||||
Ret = 'V';
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user