summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/MC/MCMachOSymbolFlags.h1
-rw-r--r--llvm/lib/MC/MCMachOStreamer.cpp8
-rw-r--r--llvm/test/MC/MachO/darwin-Thumb-reloc.s2
3 files changed, 8 insertions, 3 deletions
diff --git a/llvm/include/llvm/MC/MCMachOSymbolFlags.h b/llvm/include/llvm/MC/MCMachOSymbolFlags.h
index 78713124554..696436dffa6 100644
--- a/llvm/include/llvm/MC/MCMachOSymbolFlags.h
+++ b/llvm/include/llvm/MC/MCMachOSymbolFlags.h
@@ -34,6 +34,7 @@ namespace llvm {
SF_ReferenceTypePrivateUndefinedLazy = 0x0005,
// Other 'desc' flags.
+ SF_ThumbFunc = 0x0008,
SF_NoDeadStrip = 0x0020,
SF_WeakReference = 0x0040,
SF_WeakDefinition = 0x0080,
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp
index 0e21f4d00c1..7e1cda25b6f 100644
--- a/llvm/lib/MC/MCMachOStreamer.cpp
+++ b/llvm/lib/MC/MCMachOStreamer.cpp
@@ -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) {
diff --git a/llvm/test/MC/MachO/darwin-Thumb-reloc.s b/llvm/test/MC/MachO/darwin-Thumb-reloc.s
index 200b8593791..567573d9ef1 100644
--- a/llvm/test/MC/MachO/darwin-Thumb-reloc.s
+++ b/llvm/test/MC/MachO/darwin-Thumb-reloc.s
@@ -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: ),
OpenPOWER on IntegriCloud