sets bit 0 of the function address of thumb function in .symtab

("T is 1 if the target symbol S has type STT_FUNC and the
symbol addresses a Thumb instruction ;it is 0 otherwise."
from "ELF for the ARM Architecture" 4.7.1.2)

Patch by Koan-Sin Tan!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131406 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2011-05-16 16:17:21 +00:00
parent ac53b0a48a
commit 6469540adf
8 changed files with 59 additions and 12 deletions

View File

@@ -193,8 +193,13 @@ uint64_t ELFObjectWriter::SymbolValue(MCSymbolData &Data,
if (!Symbol.isInSection())
return 0;
if (Data.getFragment())
return Layout.getSymbolOffset(&Data);
if (Data.getFragment()) {
if (Data.getFlags() & ELF_Other_ThumbFunc)
return Layout.getSymbolOffset(&Data)+1;
else
return Layout.getSymbolOffset(&Data);
}
return 0;
}