diff options
author | Jason W Kim <jason.w.kim.2009@gmail.com> | 2010-12-16 03:12:17 +0000 |
---|---|---|
committer | Jason W Kim <jason.w.kim.2009@gmail.com> | 2010-12-16 03:12:17 +0000 |
commit | f13743bb3c3fb37a59b59f26056bc391bf0adcdc (patch) | |
tree | d7b9a84b10bccb7b243d03a583fdfae5d59bb1fa /lib/MC/MCELFStreamer.cpp | |
parent | 745dacc91d7ee9531bfba76b21beb5d4eef93a7d (diff) | |
download | external_llvm-f13743bb3c3fb37a59b59f26056bc391bf0adcdc.zip external_llvm-f13743bb3c3fb37a59b59f26056bc391bf0adcdc.tar.gz external_llvm-f13743bb3c3fb37a59b59f26056bc391bf0adcdc.tar.bz2 |
1. ARM/MC/ELF: A few more ELF relocs for .o
2. Fixed EmitLocalCommonSymbol for ELF (Yes, they exist. :)
Test added.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121951 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCELFStreamer.cpp')
-rw-r--r-- | lib/MC/MCELFStreamer.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/MC/MCELFStreamer.cpp b/lib/MC/MCELFStreamer.cpp index 6900b24..4636e2a 100644 --- a/lib/MC/MCELFStreamer.cpp +++ b/lib/MC/MCELFStreamer.cpp @@ -113,9 +113,8 @@ public: SD.setSize(Value); } - virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size) { - assert(0 && "ELF doesn't support this directive"); - } + virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size); + virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0, unsigned Size = 0, unsigned ByteAlignment = 0) { assert(0 && "ELF doesn't support this directive"); @@ -362,6 +361,16 @@ void MCELFStreamer::EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, SD.setSize(MCConstantExpr::Create(Size, getContext())); } +void MCELFStreamer::EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size) { + // FIXME: Should this be caught and done earlier? + MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol); + SetBinding(SD, ELF::STB_LOCAL); + SD.setExternal(false); + BindingExplicitlySet.insert(Symbol); + // FIXME: ByteAlignment is not needed here, but is required. + EmitCommonSymbol(Symbol, Size, 1); +} + void MCELFStreamer::EmitBytes(StringRef Data, unsigned AddrSpace) { // TODO: This is exactly the same as WinCOFFStreamer. Consider merging into // MCObjectStreamer. |