Follow aliases when determining if a symbol is thumb.

This fixes pr19484.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206917 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2014-04-22 19:11:07 +00:00
parent 8dd58d1f02
commit 8c8fae7268
2 changed files with 12 additions and 3 deletions

View File

@ -492,7 +492,6 @@ uint64_t ELFObjectWriter::SymbolValue(MCSymbolData &OrigData,
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(MCSymbolData &OrigData,
}
}
if (IsThumbFunc)
if (Data && Data->getFlags() & ELF_Other_ThumbFunc)
Res |= 1;
if (!Symbol || !Symbol->isInSection())

View File

@ -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)
@CHECK: Symbol {
@CHECK: Name: bar
@CHECK-NEXT: Value: 0x1
@CHECK-NEXT: Size: 0
@CHECK-NEXT: Binding: Global
@CHECK-NEXT: Type: Function
@CHECK: Symbol {
@CHECK: Name: foo
@CHECK-NEXT: Value: 0x1