summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCELFStreamer.cpp
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@bec.de>2013-10-29 01:06:17 +0000
committerJoerg Sonnenberger <joerg@bec.de>2013-10-29 01:06:17 +0000
commitfc184734009df551eb36e80396875cc9a2ec4acf (patch)
tree1243a1f280d31e97aadc96ab2a083a8b76639eda /llvm/lib/MC/MCELFStreamer.cpp
parent4a841a86bd8ad8f9af8320bcbb1beeedb5c443c1 (diff)
downloadbcm5719-llvm-fc184734009df551eb36e80396875cc9a2ec4acf.tar.gz
bcm5719-llvm-fc184734009df551eb36e80396875cc9a2ec4acf.zip
Move the STT_FILE symbols out of the normal symbol table processing for
ELF. They can overlap with the other symbols, e.g. if a source file "foo.c" contains a function "foo" with a static variable "c". llvm-svn: 193569
Diffstat (limited to 'llvm/lib/MC/MCELFStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCELFStreamer.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/llvm/lib/MC/MCELFStreamer.cpp b/llvm/lib/MC/MCELFStreamer.cpp
index 3f6c62c0625..3be71ce9b61 100644
--- a/llvm/lib/MC/MCELFStreamer.cpp
+++ b/llvm/lib/MC/MCELFStreamer.cpp
@@ -316,17 +316,11 @@ void MCELFStreamer::EmitValueToAlignment(unsigned ByteAlignment,
ValueSize, MaxBytesToEmit);
}
-
-// Add a symbol for the file name of this module. This is the second
-// entry in the module's symbol table (the first being the null symbol).
+// Add a symbol for the file name of this module. They start after the
+// null symbol and don't count as normal symbol, i.e. a non-STT_FILE symbol
+// with the same name may appear.
void MCELFStreamer::EmitFileDirective(StringRef Filename) {
- MCSymbol *Symbol = getAssembler().getContext().GetOrCreateSymbol(Filename);
- Symbol->setSection(*getCurrentSection().first);
- Symbol->setAbsolute();
-
- MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol);
-
- SD.setFlags(ELF_STT_File | ELF_STB_Local | ELF_STV_Default);
+ getAssembler().addFileName(Filename);
}
void MCELFStreamer::EmitIdent(StringRef IdentString) {
OpenPOWER on IntegriCloud