summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj/ELFDumper.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-06-12 17:23:39 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-06-12 17:23:39 +0000
commitc74ac023d83730307835b6c67bbfb326b64eaf62 (patch)
tree6657f77604910e603e94d6f04308b9c0044e9d26 /llvm/tools/llvm-readobj/ELFDumper.cpp
parent141e8bdfc26a5c83c12df63b08c9c71f94038bb0 (diff)
downloadbcm5719-llvm-c74ac023d83730307835b6c67bbfb326b64eaf62.tar.gz
bcm5719-llvm-c74ac023d83730307835b6c67bbfb326b64eaf62.zip
Have the ELF symbol predicates match more directly the spec.
The underlaying issues is that this code can't really know if an OS specific or processor specific section number should return true or false. One option would be to assert or return an error, but that looks like over engineering since extensions are not that common. It seems better to have these be direct implementation of the ELF spec so that they are natural for someone familiar with ELF reading the code. Code that does have to handle OS/Architecture specific values can do it at a higher level. llvm-svn: 239618
Diffstat (limited to 'llvm/tools/llvm-readobj/ELFDumper.cpp')
-rw-r--r--llvm/tools/llvm-readobj/ELFDumper.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp
index 0931cb70f6d..85363f152bf 100644
--- a/llvm/tools/llvm-readobj/ELFDumper.cpp
+++ b/llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -147,12 +147,12 @@ getSectionNameIndex(const ELFO &Obj, typename ELFO::Elf_Sym_Iter Symbol,
SectionName = "Processor Specific";
else if (Symbol->isOSSpecific())
SectionName = "Operating System Specific";
- else if (Symbol->isReserved())
- SectionName = "Reserved";
else if (Symbol->isAbsolute())
SectionName = "Absolute";
else if (Symbol->isCommon())
SectionName = "Common";
+ else if (Symbol->isReserved() && SectionIndex != SHN_XINDEX)
+ SectionName = "Reserved";
else {
if (SectionIndex == SHN_XINDEX)
SectionIndex = Obj.getSymbolTableIndex(&*Symbol);
OpenPOWER on IntegriCloud