S/390: Prevent GOT access rewrite for certain symbols
authorAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Mon, 17 Sep 2018 09:01:24 +0000 (11:01 +0200)
committerAndreas Krebbel <krebbel@linux.ibm.com>
Mon, 17 Sep 2018 09:01:24 +0000 (11:01 +0200)
commite6213e09ed0ef6ee40d00981c38baac6964aa95b
treeca32212da5f51751ecf178dd17e5b271ed87224d
parentcb5248409d7a5a10748c2aa70824ecddf2f913d5
S/390: Prevent GOT access rewrite for certain symbols

When dereferencing a GOT slot with lgrl or lg we rewrite this using
larl to get rid of the extra memory access.  However, we cannot do
this for:

- symbols marked for absolute addressing
- symbols at odd addresses (larl can handle only even addresses)

Fixed with the attached patch.

bfd/ChangeLog:

2018-09-17  Andreas Krebbel  <krebbel@linux.ibm.com>

* elf64-s390.c (elf_s390_relocate_section): Prevent rewriting of
GOT accesses with larl for ABS or misaligned symbols.

ld/ChangeLog:

2018-09-17  Andreas Krebbel  <krebbel@linux.ibm.com>

* testsuite/ld-s390/gotreloc-1.s: Add tests for ABS and misaligned
symbol. Move variables into data section. Make bar 8 bytes wide.
* testsuite/ld-s390/gotreloc-1.ver: Make misaligned_sym resolve locally.
* testsuite/ld-s390/gotreloc_31-1.dd: Adjust patterns.
* testsuite/ld-s390/gotreloc_64-norelro-1.dd: Likewise.
* testsuite/ld-s390/gotreloc_64-relro-1.dd: Likewise.
bfd/elf64-s390.c
ld/testsuite/ld-s390/gotreloc-1.s
ld/testsuite/ld-s390/gotreloc-1.ver
ld/testsuite/ld-s390/gotreloc_31-1.dd
ld/testsuite/ld-s390/gotreloc_64-norelro-1.dd
ld/testsuite/ld-s390/gotreloc_64-relro-1.dd
This page took 0.036186 seconds and 4 git commands to generate.