diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-08-24 11:56:58 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-24 11:56:58 +0000 |
commit | 0c7761b3f98fee270d73f5b9c440fe15e82af263 (patch) | |
tree | 8af4df64a2907bb3c054bd4a595f5aa3e413a25d /lib/MC/MCMachOStreamer.cpp | |
parent | 15af79c8f8ddc3fdefe668cf6a92548b970486e7 (diff) |
llvm-mc/Mach-O: Preliminary support for indirect symbols.
- The indirect table itself isn't being filled in yet.
- This isn't factored properly and is rather FIXMEd, but at the moment I'm more
focused on figuring out what it needs to do.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79910 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCMachOStreamer.cpp')
-rw-r--r-- | lib/MC/MCMachOStreamer.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/MC/MCMachOStreamer.cpp b/lib/MC/MCMachOStreamer.cpp index 9d60e3ebe1..f49f6e05ef 100644 --- a/lib/MC/MCMachOStreamer.cpp +++ b/lib/MC/MCMachOStreamer.cpp @@ -165,6 +165,16 @@ void MCMachOStreamer::EmitAssignment(MCSymbol *Symbol, void MCMachOStreamer::EmitSymbolAttribute(MCSymbol *Symbol, SymbolAttr Attribute) { + // Indirect symbols are handled differently, to match how 'as' handles + // them. This makes writing matching .o files easier. + if (Attribute == MCStreamer::IndirectSymbol) { + IndirectSymbolData ISD; + ISD.Symbol = Symbol; + ISD.SectionData = CurSectionData; + Assembler.getIndirectSymbols().push_back(ISD); + return; + } + // Adding a symbol attribute always introduces the symbol, note that an // important side effect of calling getSymbolData here is to register the // symbol with the assembler. @@ -177,6 +187,7 @@ void MCMachOStreamer::EmitSymbolAttribute(MCSymbol *Symbol, // In the future it might be worth trying to make these operations more well // defined. switch (Attribute) { + case MCStreamer::IndirectSymbol: case MCStreamer::Hidden: case MCStreamer::Internal: case MCStreamer::Protected: @@ -195,10 +206,6 @@ void MCMachOStreamer::EmitSymbolAttribute(MCSymbol *Symbol, SD.setFlags(SD.getFlags() | SF_ReferenceTypeUndefinedLazy); break; - case MCStreamer::IndirectSymbol: - llvm_unreachable("FIXME: Not yet implemented!"); - break; - // Since .reference sets the no dead strip bit, it is equivalent to // .no_dead_strip in practice. case MCStreamer::Reference: |