[llvm-commits] PATCH: Object: Fix SymbolRef::getAddress implementation for ELF

Alexey Samsonov samsonov at google.com
Fri Sep 21 00:10:03 PDT 2012


On Thu, Sep 20, 2012 at 10:15 AM, Eric Christopher <echristo at apple.com>wrote:

>
> On Sep 19, 2012, at 12:07 AM, Alexey Samsonov <samsonov at google.com> wrote:
>
> Hi!
>
> <re-sending this patch in its own thread in case it got lost>
>
>
> It did, apologies.
>
> LLVM's Object library incorrectly calculates symbol addresses for ELF: in
> fact, symbol table entry has "value" field which
> should be interpreted differently for different object types (relocated
> and relocatable).
>
> This patch fixes llvm-nm output for executables and shared objects on
> Linux (addresses in symbol table are now correct).
>
> Probably, the name SymbolRef::getAddress is somewhat confusing, and better
> naming would be smth like SymbolRef::getVirtualAddress,
> but this renaming would touch all Object specializations and many users of
> this library (I have the patch that does this as well, though).
>
> Code review: https://codereview.appspot.com/6532054/
>
>
> LGTM.
>

r164365, thanks!


-- 
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120921/e633f439/attachment.html>


More information about the llvm-commits mailing list