[PATCH] D21297: [ELF][MIPS] Support GOT entries for non-preemptible symbols with different addends
Simon Atanasyan via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 15 23:08:06 PDT 2016
atanasyan updated this revision to Diff 60947.
atanasyan added a comment.
I was not quite right when said that BFD/Gold linkers are able to handle GOT relocations against preemptable symbols and non-zero addends. The accept such relocations because sometimes we need to create a GOT entry just because we need to create a dynamic relocation and the dynamic relocation handles addend (see http://reviews.llvm.org/rL266921). But anyway each preemptable symbol referenced by GOT relocations got single GOT entry.
In this patch I try to handle GOT relocation for preemptable and non-preemptable symbols uniformly.
- There are only two MIPS GOT specific relocation expressions R_MIPS_GOT_LOCAL_PAGE and R_MIPS_GOT_OFF.
- All GOT entries created for R_MIPS_GOT_OFF expressions stored in `MipsLocal` and `MipsGlobal` vectors.
- We do not need to save addends for preemptable symbol but using the same type for `MipsLocal` and `MipsGlobal` elements simplify the code.
- All GOT offsets calculated by `GotSection<ELFT>::getMipsGotOffset` method. I did not put this code to the `SymbolBody::getGotOffset` to escape exposing `GotSection` implementation details.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 30562 bytes
Desc: not available
More information about the llvm-commits