diff options
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/elf-s390-common.c | 12 | ||||
-rw-r--r-- | bfd/elf32-s390.c | 1 | ||||
-rw-r--r-- | bfd/elf64-s390.c | 1 |
4 files changed, 21 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 68b8549..06f13b2 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +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. + 2015-03-11 Alan Modra <amodra@gmail.com> * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Examine stubs in diff --git a/bfd/elf-s390-common.c b/bfd/elf-s390-common.c index 6fd1027..462da16 100644 --- a/bfd/elf-s390-common.c +++ b/bfd/elf-s390-common.c @@ -242,3 +242,15 @@ elf_s390_add_symbol_hook (bfd *abfd, return TRUE; } + +/* Whether to sort relocs output by ld -r or ld --emit-relocs, by + r_offset. Don't do so for code sections. We want to keep ordering + of GDCALL / PLT32DBL for TLS optimizations as is. On the other + hand, elf-eh-frame.c processing requires .eh_frame relocs to be + sorted. */ + +static bfd_boolean +elf_s390_elf_sort_relocs_p (asection *sec) +{ + return (sec->flags & SEC_CODE) == 0; +} diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index f5403e2..0127eab 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -4028,6 +4028,7 @@ elf32_s390_merge_private_bfd_data (bfd *ibfd, bfd *obfd) #define elf_backend_grok_prstatus elf_s390_grok_prstatus #define elf_backend_plt_sym_val elf_s390_plt_sym_val #define elf_backend_add_symbol_hook elf_s390_add_symbol_hook +#define elf_backend_sort_relocs_p elf_s390_elf_sort_relocs_p #define bfd_elf32_mkobject elf_s390_mkobject #define elf_backend_object_p elf_s390_object_p diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index e002f06..f06b58a 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -3840,6 +3840,7 @@ const struct elf_size_info s390_elf64_size_info = #define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_plt_sym_val elf_s390_plt_sym_val #define elf_backend_add_symbol_hook elf_s390_add_symbol_hook +#define elf_backend_sort_relocs_p elf_s390_elf_sort_relocs_p #define bfd_elf64_mkobject elf_s390_mkobject #define elf_backend_object_p elf_s390_object_p |