aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2015-08-27 10:54:28 +0930
committerAlan Modra <amodra@gmail.com>2015-08-27 10:56:51 +0930
commit6fc5bb5718b72250cffb9c09110515971f72e116 (patch)
tree730b7e1d22cda1ad01195d87cb1c41ad00c4b7be /bfd
parente9756d52bea3834ffb31d0a907944bd022250ed8 (diff)
downloadgdb-6fc5bb5718b72250cffb9c09110515971f72e116.zip
gdb-6fc5bb5718b72250cffb9c09110515971f72e116.tar.gz
gdb-6fc5bb5718b72250cffb9c09110515971f72e116.tar.bz2
Don't sort ld -r output relocs on alpha
LITERAL/LITUSE relocs must be kept together. * elf64-alpha.c (elf64_alpha_sort_relocs_p): New function. (elf_backend_sort_relocs_p): Define.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf64-alpha.c14
2 files changed, 19 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 00035c4..9e254a3 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2015-08-27 Alan Modra <amodra@gmail.com>
+
+ * 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
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index df19da7..35c1ec6 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
@@ -5525,6 +5537,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 \