[lld] r176489 - [ELF] Set symbol type to STT_SECTION, so that objdump.bfd doesnot get confused when disassembling output
Shankar Easwaran
shankare at codeaurora.org
Tue Mar 5 08:09:32 PST 2013
Author: shankare
Date: Tue Mar 5 10:09:32 2013
New Revision: 176489
URL: http://llvm.org/viewvc/llvm-project?rev=176489&view=rev
Log:
[ELF] Set symbol type to STT_SECTION, so that objdump.bfd doesnot get confused when disassembling output
Modified:
lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h
Modified: lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h?rev=176489&r1=176488&r2=176489&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h Tue Mar 5 10:09:32 2013
@@ -672,10 +672,13 @@ void SymbolTable<ELFT>::addSymbol(const
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<ELFT>::addSymbol(const
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
More information about the llvm-commits
mailing list