[llvm] r212029 - ARM: take care not to set the ThumbFunc bit on TLS data symbols
Scott Douglass
sdouglass at arm.com
Mon Jun 30 02:37:24 PDT 2014
Author: scott-0
Date: Mon Jun 30 04:37:24 2014
New Revision: 212029
URL: http://llvm.org/viewvc/llvm-project?rev=212029&view=rev
Log:
ARM: take care not to set the ThumbFunc bit on TLS data symbols
This fixes LNT SingleSource/UnitTests/Threads with -mthumb.
Differential Revision: http://reviews.llvm.org/D4324
Modified:
llvm/trunk/include/llvm/MC/MCELFSymbolFlags.h
llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
llvm/trunk/test/MC/ARM/thumb-types.s
Modified: llvm/trunk/include/llvm/MC/MCELFSymbolFlags.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCELFSymbolFlags.h?rev=212029&r1=212028&r2=212029&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCELFSymbolFlags.h (original)
+++ llvm/trunk/include/llvm/MC/MCELFSymbolFlags.h Mon Jun 30 04:37:24 2014
@@ -41,6 +41,7 @@ namespace llvm {
ELF_STT_File = (ELF::STT_FILE << ELF_STT_Shift),
ELF_STT_Common = (ELF::STT_COMMON << ELF_STT_Shift),
ELF_STT_Tls = (ELF::STT_TLS << ELF_STT_Shift),
+ ELF_STT_GnuIFunc = (ELF::STT_GNU_IFUNC << ELF_STT_Shift),
ELF_STT_Loproc = (ELF::STT_LOPROC << ELF_STT_Shift),
ELF_STT_Hiproc = (ELF::STT_HIPROC << ELF_STT_Shift),
Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp?rev=212029&r1=212028&r2=212029&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp Mon Jun 30 04:37:24 2014
@@ -992,7 +992,8 @@ void ARMTargetELFStreamer::emitLabel(MCS
return;
const MCSymbolData &SD = Streamer.getOrCreateSymbolData(Symbol);
- if (MCELF::GetType(SD) & (ELF::STT_FUNC << ELF_STT_Shift))
+ unsigned Type = MCELF::GetType(SD);
+ if (Type == ELF_STT_Func || Type == ELF_STT_GnuIFunc)
Streamer.EmitThumbFunc(Symbol);
}
Modified: llvm/trunk/test/MC/ARM/thumb-types.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/thumb-types.s?rev=212029&r1=212028&r2=212029&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/thumb-types.s (original)
+++ llvm/trunk/test/MC/ARM/thumb-types.s Mon Jun 30 04:37:24 2014
@@ -29,6 +29,12 @@ untyped_text_label:
explicit_function:
nop
+ .long tls(TPOFF)
+
+ .type indirect_function,%gnu_indirect_function
+indirect_function:
+ nop
+
.data
untyped_data_label:
@@ -38,6 +44,14 @@ untyped_data_label:
explicit_data:
.long 0
+ .section .tdata,"awT",%progbits
+ .type tls,%object
+ .align 2
+tls:
+ .long 42
+ .size tls, 4
+
+
@ CHECK: Symbol {
@ CHECK: Name: arm_function
@ CHECK: Value: 0x6
@@ -69,6 +83,18 @@ explicit_data:
@ CHECK: }
@ CHECK: Symbol {
+@ CHECK: Name: indirect_function
+@ CHECK: Value: 0x13
+@ CHECK: Type: GNU_IFunc
+@ CHECK: }
+
+@ CHECK: Symbol {
+@ CHECK: Name: tls
+@ CHECK: Value: 0x0
+@ CHECK: Type: TLS
+@ CHECK: }
+
+@ CHECK: Symbol {
@ CHECK: Name: untyped_data_label
@ CHECK: Value: 0x0
@ CHECK: Type: None
More information about the llvm-commits
mailing list