[ELF][HEXAGON] Add support for GOT relocations.
authorSid Manning <sidneym@codeaurora.org>
Thu, 4 Oct 2018 14:54:17 +0000 (14:54 +0000)
committerSid Manning <sidneym@codeaurora.org>
Thu, 4 Oct 2018 14:54:17 +0000 (14:54 +0000)
commit261eec5fa5deae96a454835092a09098ced277a6
tree28bc666e8e7b8ae8c64b716047513cccdd5fd897
parentdee7bfdb9fb839973b9635530a270189bb7d94b3
[ELF][HEXAGON] Add support for GOT relocations.

The GOT is referenced through the symbol _GLOBAL_OFFSET_TABLE_ .

The relocation added calculates the offset into the global offset table for
the entry of a symbol.  In order to get the correct TargetVA I needed to
create an new relocation expression, HEXAGON_GOT.  It does
Sym.getGotVA() - In.GotPlt->getVA().

Differential Revision: https://reviews.llvm.org/D52744

llvm-svn: 343784
lld/ELF/Arch/Hexagon.cpp
lld/ELF/InputSection.cpp
lld/ELF/Relocations.cpp
lld/ELF/Relocations.h
lld/test/ELF/hexagon-shared.s