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

Alexey Samsonov samsonov at google.com
Wed Sep 19 00:07:13 PDT 2012


Hi!

<re-sending this patch in its own thread in case it got lost>
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/

-- 
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120919/d794d10d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: issue6532054_1.diff
Type: application/octet-stream
Size: 3613 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120919/d794d10d/attachment.obj>


More information about the llvm-commits mailing list