Index: include/llvm/MC/MCELFSymbolFlags.h =================================================================== --- include/llvm/MC/MCELFSymbolFlags.h +++ include/llvm/MC/MCELFSymbolFlags.h @@ -41,6 +41,7 @@ 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), Index: lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp =================================================================== --- lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp +++ lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp @@ -992,7 +992,8 @@ 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); } Index: test/MC/ARM/thumb-types.s =================================================================== --- test/MC/ARM/thumb-types.s +++ test/MC/ARM/thumb-types.s @@ -29,6 +29,12 @@ explicit_function: nop + .long tls(TPOFF) + + .type indirect_function,%gnu_indirect_function +indirect_function: + nop + .data untyped_data_label: @@ -38,6 +44,14 @@ 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 @@ @ 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