diff options
author | Alan Modra <amodra@gmail.com> | 2015-08-27 10:54:28 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2015-08-27 13:32:38 +0930 |
commit | 00b2b5c400e542a436b66989841a2f3b81181e91 (patch) | |
tree | a1e5ff414118fb21d34f1adf9f4624e77d5fbae4 | |
parent | 5fc980cc8be61203db24756e17d87f24c174f1ac (diff) | |
download | gdb-00b2b5c400e542a436b66989841a2f3b81181e91.zip gdb-00b2b5c400e542a436b66989841a2f3b81181e91.tar.gz gdb-00b2b5c400e542a436b66989841a2f3b81181e91.tar.bz2 |
Don't sort ld -r output relocs on alpha
LITERAL/LITUSE relocs must be kept together.
PR 18867
* elf64-alpha.c (elf64_alpha_sort_relocs_p): New function.
(elf_backend_sort_relocs_p): Define.
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf64-alpha.c | 14 |
2 files changed, 19 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 103e2c3..9cc93a9 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,6 +1,11 @@ 2015-08-27 Alan Modra <amodra@gmail.com> Apply from master + 2015-08-27 Alan Modra <amodra@gmail.com> + PR 18867 + * elf64-alpha.c (elf64_alpha_sort_relocs_p): New function. + (elf_backend_sort_relocs_p): Define. + 2015-08-26 Alan Modra <amodra@gmail.com> PR 18867 * elflink.c (cmp_ext32l_r_offset, cmp_ext32b_r_offset): Delete. diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 8f8cf7b..094a0b9 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -1757,6 +1757,18 @@ elf64_alpha_want_plt (struct alpha_elf_link_hash_entry *ah) && (ah->flags & ~ALPHA_ELF_LINK_HASH_LU_PLT) == 0); } +/* 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 LITERAL/LITUSE + as is. On the other hand, elf-eh-frame.c processing requires .eh_frame + relocs to be sorted. */ + +static bfd_boolean +elf64_alpha_sort_relocs_p (asection *sec) +{ + return (sec->flags & SEC_CODE) == 0; +} + + /* Handle dynamic relocations when doing an Alpha ELF link. */ static bfd_boolean @@ -5518,6 +5530,8 @@ static const struct elf_size_info alpha_elf_size_info = elf64_alpha_add_symbol_hook #define elf_backend_relocs_compatible \ _bfd_elf_relocs_compatible +#define elf_backend_sort_relocs_p \ + elf64_alpha_sort_relocs_p #define elf_backend_check_relocs \ elf64_alpha_check_relocs #define elf_backend_create_dynamic_sections \ |