From 49ae01999769b8a533ea15315cbbb498e90368a8 Mon Sep 17 00:00:00 2001 From: Shankar Easwaran Date: Tue, 5 Mar 2013 16:09:32 +0000 Subject: [PATCH] [ELF] Set symbol type to STT_SECTION, so that objdump.bfd doesnot get confused when disassembling output llvm-svn: 176489 --- lld/lib/ReaderWriter/ELF/SectionChunks.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lld/lib/ReaderWriter/ELF/SectionChunks.h b/lld/lib/ReaderWriter/ELF/SectionChunks.h index 12f1c20..13eaab4 100644 --- a/lld/lib/ReaderWriter/ELF/SectionChunks.h +++ b/lld/lib/ReaderWriter/ELF/SectionChunks.h @@ -672,10 +672,13 @@ void SymbolTable::addSymbol(const Atom *atom, int32_t sectionIndex, case DefinedAtom::typeDataFast: case DefinedAtom::typeData: case DefinedAtom::typeConstant: - case DefinedAtom::typeGOT: symbol.st_value = addr; type = llvm::ELF::STT_OBJECT; break; + case DefinedAtom::typeGOT: + symbol.st_value = addr; + type = llvm::ELF::STT_NOTYPE; + break; case DefinedAtom::typeZeroFill: case DefinedAtom::typeZeroFillFast: type = llvm::ELF::STT_OBJECT; @@ -689,6 +692,9 @@ void SymbolTable::addSymbol(const Atom *atom, int32_t sectionIndex, default: type = llvm::ELF::STT_NOTYPE; } + if (da->customSectionName() == da->name()) + type = llvm::ELF::STT_SECTION; + if (da->scope() == DefinedAtom::scopeTranslationUnit) binding = llvm::ELF::STB_LOCAL; else -- 2.7.4