[llvm] r200578 - Mark the first dynamic elf symbol as SF_FormatSpecific.
Rafael Espindola
rafael.espindola at gmail.com
Fri Jan 31 13:40:13 PST 2014
Author: rafael
Date: Fri Jan 31 15:40:13 2014
New Revision: 200578
URL: http://llvm.org/viewvc/llvm-project?rev=200578&view=rev
Log:
Mark the first dynamic elf symbol as SF_FormatSpecific.
Modified:
llvm/trunk/include/llvm/Object/ELFObjectFile.h
llvm/trunk/test/Object/nm-shared-object.test
Modified: llvm/trunk/include/llvm/Object/ELFObjectFile.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELFObjectFile.h?rev=200578&r1=200577&r2=200578&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELFObjectFile.h (original)
+++ llvm/trunk/include/llvm/Object/ELFObjectFile.h Fri Jan 31 15:40:13 2014
@@ -379,7 +379,8 @@ error_code ELFObjectFile<ELFT>::getSymbo
template <class ELFT>
uint32_t ELFObjectFile<ELFT>::getSymbolFlags(DataRefImpl Symb) const {
- const Elf_Sym *ESym = getSymbol(Symb);
+ Elf_Sym_Iter EIter = toELFSymIter(Symb);
+ const Elf_Sym *ESym = &*EIter;
uint32_t Result = SymbolRef::SF_None;
@@ -393,7 +394,7 @@ uint32_t ELFObjectFile<ELFT>::getSymbolF
Result |= SymbolRef::SF_Absolute;
if (ESym->getType() == ELF::STT_FILE || ESym->getType() == ELF::STT_SECTION ||
- ESym == &*EF.begin_symbols())
+ EIter == EF.begin_symbols() || EIter == EF.begin_dynamic_symbols())
Result |= SymbolRef::SF_FormatSpecific;
if (EF.getSymbolTableIndex(ESym) == ELF::SHN_UNDEF)
Modified: llvm/trunk/test/Object/nm-shared-object.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/nm-shared-object.test?rev=200578&r1=200577&r2=200578&view=diff
==============================================================================
--- llvm/trunk/test/Object/nm-shared-object.test (original)
+++ llvm/trunk/test/Object/nm-shared-object.test Fri Jan 31 15:40:13 2014
@@ -1,6 +1,7 @@
RUN: llvm-nm -D %p/Inputs/shared-object-test.elf-i386 \
RUN: | FileCheck %s -check-prefix ELF-32
+ELF-32-NOT: U
ELF-32: 0012c8 A __bss_start
ELF-32: 0012c8 A _edata
ELF-32: 0012cc A _end
@@ -12,6 +13,7 @@ ELF-32: 000000 D tls_sym
RUN: llvm-nm -D %p/Inputs/shared-object-test.elf-x86-64 \
RUN: | FileCheck %s -check-prefix ELF-64
+ELF-64-NOT: U
ELF-64: 200454 A __bss_start
ELF-64: 200454 A _edata
ELF-64: 200458 A _end
More information about the llvm-commits
mailing list