aboutsummaryrefslogtreecommitdiff
path: root/lib/MC/MCAssembler.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-08-24 08:40:12 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-08-24 08:40:12 +0000
commit6aff2fbd56d4bc2d6029f7c9bd49a97f6dc01213 (patch)
treef0b95f730e178cc34e26a9625c07fc44569aaaa2 /lib/MC/MCAssembler.cpp
parent50e48b359eb4e3d3e22d6e447583619d1feaeeae (diff)
llvm-mc/Mach-O: Support symbol attributes.
- This is mostly complete, the main thing missing is .indirect_symbol support (which would be straight-forward, except that the way it is implemented in 'as' makes getting an exact .o match interesting). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79899 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCAssembler.cpp')
-rw-r--r--lib/MC/MCAssembler.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp
index 80e1b9e43c..9315422502 100644
--- a/lib/MC/MCAssembler.cpp
+++ b/lib/MC/MCAssembler.cpp
@@ -291,7 +291,8 @@ public:
// FIXME: Set STAB bits.
- // FIXME: Set private external bit.
+ if (MSD.SymbolData->isPrivateExtern())
+ Type |= STF_PrivateExtern;
// Set external bit.
if (MSD.SymbolData->isExternal() || Symbol.isUndefined())
@@ -302,7 +303,11 @@ public:
Write32(MSD.StringIndex);
Write8(Type);
Write8(MSD.SectionIndex);
- Write16(0); // FIXME: Desc
+
+ // The Mach-O streamer uses the lowest 16-bits of the flags for the 'desc'
+ // value.
+ Write16(MSD.SymbolData->getFlags() & 0xFFFF);
+
Write32(0); // FIXME: Value
}
@@ -544,7 +549,7 @@ MCSymbolData::MCSymbolData() : Symbol(*(MCSymbol*)0) {}
MCSymbolData::MCSymbolData(MCSymbol &_Symbol, MCFragment *_Fragment,
uint64_t _Offset, MCAssembler *A)
: Symbol(_Symbol), Fragment(_Fragment), Offset(_Offset),
- IsExternal(false)
+ IsExternal(false), IsPrivateExtern(false), Flags(0)
{
if (A)
A->getSymbolList().push_back(this);