ELF: Teach SymbolBody about how to get its addresses.
authorRui Ueyama <ruiu@google.com>
Mon, 1 Feb 2016 21:00:35 +0000 (21:00 +0000)
committerRui Ueyama <ruiu@google.com>
Mon, 1 Feb 2016 21:00:35 +0000 (21:00 +0000)
commitb5a6970acef78eea784f2972f55b8c802c725396
treefe1cfad66dd37e4d895b2ff09307bae5152f367e
parent53907161cc20292fd7de53e8e1f0a7ff105076a7
ELF: Teach SymbolBody about how to get its addresses.

Previously, the methods to get symbol addresses were somewhat scattered
in many places. You can use getEntryAddr returns the address of the symbol,
but if you want to get the GOT address for the symbol, you needed to call
Out<ELFT>::Got->getEntryAddr(Sym). This change adds new functions, getVA,
getGotVA, getGotPltVA, and getPltVA to SymbolBody, so that you can use
SymbolBody as the central place to ask about symbols.

http://reviews.llvm.org/D16710

llvm-svn: 259404
lld/ELF/InputSection.cpp
lld/ELF/OutputSections.cpp
lld/ELF/OutputSections.h
lld/ELF/Symbols.cpp
lld/ELF/Symbols.h
lld/ELF/Writer.cpp