summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2013-09-17 21:24:44 +0000
committerReid Kleckner <reid@kleckner.net>2013-09-17 21:24:44 +0000
commit3ea536fef4e4121881f2e75d9fda8ed8d58c3a9e (patch)
tree5edfdb2d46c3fb0656899efa9ae367fdb79f670a /llvm/lib/MC
parent50689eb91777eba639d8d5134d2a58606a59d7c3 (diff)
downloadbcm5719-llvm-3ea536fef4e4121881f2e75d9fda8ed8d58c3a9e.tar.gz
bcm5719-llvm-3ea536fef4e4121881f2e75d9fda8ed8d58c3a9e.zip
COFF: Emit all MCSymbols rather than filtering out some of them
In particular, this means we emit non-external symbols defined to variables, such as aliases or absolute addresses. This is needed to implement /safeseh, and it appears there was some confusion about what symbols to emit previously. llvm-svn: 190888
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r--llvm/lib/MC/WinCOFFObjectWriter.cpp22
1 files changed, 3 insertions, 19 deletions
diff --git a/llvm/lib/MC/WinCOFFObjectWriter.cpp b/llvm/lib/MC/WinCOFFObjectWriter.cpp
index e85c33dc9c7..263151c6afa 100644
--- a/llvm/lib/MC/WinCOFFObjectWriter.cpp
+++ b/llvm/lib/MC/WinCOFFObjectWriter.cpp
@@ -154,8 +154,6 @@ public:
void MakeSymbolReal(COFFSymbol &S, size_t Index);
void MakeSectionReal(COFFSection &S, size_t Number);
- bool ExportSymbol(MCSymbolData const &SymbolData, MCAssembler &Asm);
-
bool IsPhysicalSection(COFFSection *S);
// Entity writing methods.
@@ -496,18 +494,6 @@ void WinCOFFObjectWriter::MakeSymbolReal(COFFSymbol &S, size_t Index) {
S.Index = Index;
}
-bool WinCOFFObjectWriter::ExportSymbol(MCSymbolData const &SymbolData,
- MCAssembler &Asm) {
- // This doesn't seem to be right. Strings referred to from the .data section
- // need symbols so they can be linked to code in the .text section right?
-
- // return Asm.isSymbolLinkerVisible (&SymbolData);
-
- // For now, all non-variable symbols are exported,
- // the linker will sort the rest out for us.
- return SymbolData.isExternal() || !SymbolData.getSymbol().isVariable();
-}
-
bool WinCOFFObjectWriter::IsPhysicalSection(COFFSection *S) {
return (S->Header.Characteristics
& COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA) == 0;
@@ -609,11 +595,9 @@ void WinCOFFObjectWriter::ExecutePostLayoutBinding(MCAssembler &Asm,
DefineSection(*i);
for (MCAssembler::const_symbol_iterator i = Asm.symbol_begin(),
- e = Asm.symbol_end(); i != e; i++) {
- if (ExportSymbol(*i, Asm)) {
- DefineSymbol(*i, Asm);
- }
- }
+ e = Asm.symbol_end();
+ i != e; i++)
+ DefineSymbol(*i, Asm);
}
void WinCOFFObjectWriter::RecordRelocation(const MCAssembler &Asm,
OpenPOWER on IntegriCloud