[llvm-commits] Patch to add way to access a symbol's st_value

Michael Spencer bigcheesegs at gmail.com
Tue Jul 10 12:29:27 PDT 2012


On Mon, Jul 9, 2012 at 4:44 PM, Sid Manning <sidneym at codeaurora.org> wrote:
> Hi,
>
> I wanted to add an interface to allow direct access to a symbol's st_value.
> I did notice that getSymbolAddress/getSymbolFileOffset can also return
> st_value in some cases.
>
> When type symbol is common or undefined the returned Result from
> getSymbolAddress for example is UnknownAddressOrSize, however the ELF spec
> says that, "In relocatable files, st_value holds alignment constraints for a
> symbol whose section index is SHN_COMMON."  So I guess in this case the API
> name getSymbolAddress wouldn't make sense if it did return alignment.
>
> The reason for adding this is that it addresses a comment in the
> ReaderELF.cpp patch regarding what an Atom's rawContent (Defined Atom's Data
> paramenter) should be.

This is uneeded. You can directly access st_value. The only reason the
other assessors exist is to provide access to the packed values.

- Michael Spencer



More information about the llvm-commits mailing list