MC/Mach-O/Thumb: Set the thumb bit in the symbol table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122630 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2010-12-29 14:14:06 +00:00
parent dd061b3177
commit b2624eda5a
3 changed files with 8 additions and 3 deletions

View File

@ -34,6 +34,7 @@ namespace llvm {
SF_ReferenceTypePrivateUndefinedLazy = 0x0005,
// Other 'desc' flags.
SF_ThumbFunc = 0x0008,
SF_NoDeadStrip = 0x0020,
SF_WeakReference = 0x0040,
SF_WeakDefinition = 0x0080,

View File

@ -140,12 +140,16 @@ void MCMachOStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {
}
}
void MCMachOStreamer::EmitThumbFunc(MCSymbol *Func) {
void MCMachOStreamer::EmitThumbFunc(MCSymbol *Symbol) {
// FIXME: Flag the function ISA as thumb with DW_AT_APPLE_isa.
// Remember that the function is a thumb function. Fixup and relocation
// values will need adjusted.
getAssembler().setIsThumbFunc(Func);
getAssembler().setIsThumbFunc(Symbol);
// Mark the thumb bit on the symbol.
MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol);
SD.setFlags(SD.getFlags() | SF_ThumbFunc);
}
void MCMachOStreamer::EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {

View File

@ -98,7 +98,7 @@ L_.str:
@ CHECK: (('n_strx', 1)
@ CHECK: ('n_type', 0xf)
@ CHECK: ('n_sect', 1)
@ CHECK-FIXME: ('n_desc', 8)
@ CHECK: ('n_desc', 8)
@ CHECK: ('n_value', 0)
@ CHECK: ('_string', '_main')
@ CHECK: ),