]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
S/390: Disable relocation sort against code sections.
authorAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Sat, 14 Mar 2015 10:45:05 +0000 (11:45 +0100)
committerAlan Modra <amodra@gmail.com>
Wed, 18 Mar 2015 07:49:41 +0000 (18:19 +1030)
commitf12dd7bb5d7c16dc4877a5d6fa87d29231c3e93c
tree06f5b3b62013c70ce1ba4fc6ae136cc9ab1d0328
parent846daac2a1f80d44f0595994157fddc083e2cd0b
S/390: Disable relocation sort against code sections.

When downgrading from GD to IE model we rewrite the call to
__tls_get_offset to a 64 bit load instruction. This relies on the fact
that the additional relocation for the call target has already been
executed when doing the rewrite.

   f1018:       e3 20 d0 00 00 04       lg      %r2,0(%r13)
   f101e:       c0 e5 00 00 00 00       brasl   %r14,f101e <__res_init+0x1e>
                        f101e: R_390_TLS_GDCALL __libc_resp
                        f1020: R_390_PLT32DBL   __tls_get_offset+0x2

0000000f1020  39f6c00000014 R_390_PLT32DBL    0000000000000000 __tls_get_offset + 2
0000000f101e  3afb700000026 R_390_TLS_GDCALL  0000000000000008 __libc_resp + 0

Due to the reloc sorting the order changed an the PLT32DBL reloc is
executed after the rewrite and overwrites part of the load instruction
with garbage.

bfd/
2015-03-14  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* elf-s390-common.c (elf_s390_elf_sort_relocs_p): Don't sort
relocs against code sections.
* elf32-s390.c: Define elf_backend_sort_relocs_p.
* elf64-s390.c: Likewise.
bfd/ChangeLog
bfd/elf-s390-common.c
bfd/elf32-s390.c
bfd/elf64-s390.c