[llvm] r206917 - Follow aliases when determining if a symbol is thumb.

Rafael Espindola rafael.espindola at gmail.com
Tue Apr 22 12:11:07 PDT 2014


Author: rafael
Date: Tue Apr 22 14:11:07 2014
New Revision: 206917

URL: http://llvm.org/viewvc/llvm-project?rev=206917&view=rev
Log:
Follow aliases when determining if a symbol is thumb.

This fixes pr19484.

Modified:
    llvm/trunk/lib/MC/ELFObjectWriter.cpp
    llvm/trunk/test/MC/ARM/elf-thumbfunc.s

Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=206917&r1=206916&r2=206917&view=diff
==============================================================================
--- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Tue Apr 22 14:11:07 2014
@@ -492,7 +492,6 @@ uint64_t ELFObjectWriter::SymbolValue(MC
     return Data->getCommonAlignment();
 
   const MCSymbol *Symbol = &Data->getSymbol();
-  bool IsThumbFunc = OrigData.getFlags() & ELF_Other_ThumbFunc;
 
   uint64_t Res = 0;
   if (Symbol->isVariable()) {
@@ -514,7 +513,7 @@ uint64_t ELFObjectWriter::SymbolValue(MC
     }
   }
 
-  if (IsThumbFunc)
+  if (Data && Data->getFlags() & ELF_Other_ThumbFunc)
     Res |= 1;
 
   if (!Symbol || !Symbol->isInSection())

Modified: llvm/trunk/test/MC/ARM/elf-thumbfunc.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/elf-thumbfunc.s?rev=206917&r1=206916&r2=206917&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/elf-thumbfunc.s (original)
+++ llvm/trunk/test/MC/ARM/elf-thumbfunc.s Tue Apr 22 14:11:07 2014
@@ -11,7 +11,17 @@
 foo:
 	bx	lr
 
-@@ make sure foo is thumb function: bit 0 = 1 (st_value)
+	.global bar
+bar = foo
+
+@@ make sure foo and bar are thumb function: bit 0 = 1 (st_value)
+ at CHECK:        Symbol {
+ at CHECK:          Name: bar
+ at CHECK-NEXT:     Value: 0x1
+ at CHECK-NEXT:     Size: 0
+ at CHECK-NEXT:     Binding: Global
+ at CHECK-NEXT:     Type: Function
+
 @CHECK:        Symbol {
 @CHECK:          Name: foo
 @CHECK-NEXT:     Value: 0x1





More information about the llvm-commits mailing list