Only create GOT or GOT entry when needed
commit523b55d82d455951659868d68eb54c4f5dbfb5a4
authorThomas Preud'homme <robotux@celest.fr>
Thu, 17 Nov 2016 22:54:06 +0000 (17 22:54 +0000)
committerThomas Preud'homme <robotux@celest.fr>
Sat, 3 Dec 2016 17:26:51 +0000 (3 17:26 +0000)
tree5b73752ab76c0365f763a354920a78bd3ec27b07
parent6cd23d1d8cb904e7168893e67b7ffbc718b3237d
Only create GOT or GOT entry when needed

Currently we always build a GOT when we recognize a relocation in
build_got_entries even if the relocation does not require one. In the
same spirit, when the relocation does require one we always create a GOT
entry even if not entry is necessary. This patch restricts the creation
of a GOT and a GOT entry to relocations that needs it, ie:
- do not create a GOT if relocation is not related to GOT and symbol is
  not UNDEF
- do not create a GOT entry if relocation only relates to beginning of
  GOT
tccelf.c