Fix TLS handling in ELF's getAddress and llvm-nm to print 'D' for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200433 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2014-01-30 00:42:30 +00:00
parent 0bdaca5058
commit b0dcfa5c1f
3 changed files with 4 additions and 2 deletions

View File

@ -295,6 +295,7 @@ error_code ELFObjectFile<ELFT>::getSymbolAddress(DataRefImpl Symb,
case ELF::STT_FUNC:
case ELF::STT_OBJECT:
case ELF::STT_NOTYPE:
case ELF::STT_TLS:
bool IsRelocatable;
switch (EF.getHeader()->e_type) {
case ELF::ET_EXEC:

View File

@ -12,7 +12,7 @@ ELF-32: 0012cc A _end
ELF-32: 0012c8 B common_sym
ELF-32: 0012c4 D defined_sym
ELF-32: 0001f0 T global_func
ELF-32: ? tls_sym
ELF-32: 000000 D tls_sym
ELF-64: 200454 A __bss_start
ELF-64: 200454 A _edata
@ -20,4 +20,4 @@ ELF-64: 200458 A _end
ELF-64: 200454 B common_sym
ELF-64: 200450 D defined_sym
ELF-64: 0002f0 T global_func
ELF-64: ? tls_sym
ELF-64: 000000 D tls_sym

View File

@ -331,6 +331,7 @@ static error_code getSymbolNMTypeChar(ELFObjectFile<ELFT> &Obj,
case(ELF::SHF_ALLOC | ELF::SHF_EXECINSTR) :
Ret = 't';
break;
case(ELF::SHF_TLS | ELF::SHF_ALLOC | ELF::SHF_WRITE) :
case(ELF::SHF_ALLOC | ELF::SHF_WRITE) :
Ret = 'd';
break;