aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/binutils-aarch64-symbol-relocation.patch
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-06-18 15:29:38 +0200
committerMarius Bakke <mbakke@fastmail.com>2018-06-18 15:29:38 +0200
commit6969c4de445a390eaa05de22bc5a537a76a76169 (patch)
tree9df3bdde497fdce705ae4eb66972f93a9ae111d9 /gnu/packages/patches/binutils-aarch64-symbol-relocation.patch
parent73d18915b597f2a386d6ae42930b49a13c8813b0 (diff)
parent32eb44240db23b2320a68a3ab17370531945587f (diff)
downloadguix-6969c4de445a390eaa05de22bc5a537a76a76169.tar
guix-6969c4de445a390eaa05de22bc5a537a76a76169.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'gnu/packages/patches/binutils-aarch64-symbol-relocation.patch')
-rw-r--r--gnu/packages/patches/binutils-aarch64-symbol-relocation.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/gnu/packages/patches/binutils-aarch64-symbol-relocation.patch b/gnu/packages/patches/binutils-aarch64-symbol-relocation.patch
new file mode 100644
index 0000000000..fbd596862b
--- /dev/null
+++ b/gnu/packages/patches/binutils-aarch64-symbol-relocation.patch
@@ -0,0 +1,36 @@
+Fix a regression in Binutils 2.30 where some symbols are incorrectly assumed
+to be addresses:
+
+https://sourceware.org/bugzilla/show_bug.cgi?id=22764
+
+Patch taken from upstream (with ChangeLog entries and tests omitted):
+
+https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=279b2f94168ee91e02ccd070d27c983fc001fe12
+
+diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
+index af448f9..2737773 100644
+--- a/bfd/elfnn-aarch64.c
++++ b/bfd/elfnn-aarch64.c
+@@ -7189,10 +7189,19 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info,
+ #if ARCH_SIZE == 64
+ case BFD_RELOC_AARCH64_32:
+ #endif
+- if (bfd_link_pic (info)
+- && (sec->flags & SEC_ALLOC) != 0
+- && (sec->flags & SEC_READONLY) != 0)
++ if (bfd_link_pic (info) && (sec->flags & SEC_ALLOC) != 0)
+ {
++ if (h != NULL
++ /* This is an absolute symbol. It represents a value instead
++ of an address. */
++ && ((h->root.type == bfd_link_hash_defined
++ && bfd_is_abs_section (h->root.u.def.section))
++ /* This is an undefined symbol. */
++ || h->root.type == bfd_link_hash_undefined))
++ break;
++
++ /* For local symbols, defined global symbols in a non-ABS section,
++ it is assumed that the value is an address. */
+ int howto_index = bfd_r_type - BFD_RELOC_AARCH64_RELOC_START;
+ _bfd_error_handler
+ /* xgettext:c-format */