[PATCH] D17956: Set the thumb flag for thumb symbols coming from an ELF file

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 3 07:45:31 PDT 2016


testcase?

On 8 March 2016 at 06:59, Tamas Berghammer <tberghammer at google.com> wrote:
> tberghammer created this revision.
> tberghammer added reviewers: rengolin, rafael.
> tberghammer added a subscriber: llvm-commits.
> Herald added subscribers: rengolin, aemerson.
>
> Set the thumb flag for thumb symbols coming from an ELF file
>
> Without setting the flag there is no way to determine if a symbol
> points to an arm or to a thumb function as the LSB of the address
> masked out in all getter function.
>
> http://reviews.llvm.org/D17956
>
> Files:
>   include/llvm/Object/ELFObjectFile.h
>
> Index: include/llvm/Object/ELFObjectFile.h
> ===================================================================
> --- include/llvm/Object/ELFObjectFile.h
> +++ include/llvm/Object/ELFObjectFile.h
> @@ -493,6 +493,8 @@
>            Name.startswith("$a"))
>          Result |= SymbolRef::SF_FormatSpecific;
>      }
> +    if (ESym->getType() == ELF::STT_FUNC && (ESym->st_value & 1) == 1)
> +      Result |= SymbolRef::SF_Thumb;
>    }
>
>    if (ESym->st_shndx == ELF::SHN_UNDEF)
>
>


More information about the llvm-commits mailing list