summaryrefslogtreecommitdiff
path: root/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
commit72580780a98cb8b0019b7ec4ed88e3f3328b9969 (patch)
tree6d102a4a9edc24e52c439ea4420dbd1606770fe3 /lib/MC/MCELFStreamer.cpp
parent8ef9cebb68d6305e197c3e0b8369aa3c57570bbf (diff)
downloadllvm-72580780a98cb8b0019b7ec4ed88e3f3328b9969.tar.gz
llvm-72580780a98cb8b0019b7ec4ed88e3f3328b9969.tar.bz2
llvm-72580780a98cb8b0019b7ec4ed88e3f3328b9969.tar.xz
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". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193569 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCELFStreamer.cpp')
-rw-r--r--lib/MC/MCELFStreamer.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/MC/MCELFStreamer.cpp b/lib/MC/MCELFStreamer.cpp
index 3f6c62c062..3be71ce9b6 100644
--- a/lib/MC/MCELFStreamer.cpp
+++ b/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) {