From: ludo@gnu.org (Ludovic Courtès)
To: Marius Bakke <mbakke@fastmail.com>
Cc: 31741@debbugs.gnu.org
Subject: [bug#31741] [PATCH] gnu: linux-libre: Fix build on AArch64.
Date: Fri, 08 Jun 2018 18:45:08 +0200 [thread overview]
Message-ID: <87y3fpi5wr.fsf@gnu.org> (raw)
In-Reply-To: <20180606223635.12450-1-mbakke@fastmail.com> (Marius Bakke's message of "Thu, 7 Jun 2018 00:36:35 +0200")
Hello Marius!
Marius Bakke <mbakke@fastmail.com> skribis:
> * gnu/packages/patches/binutils-aarch64-symbol-relocation.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Register it.
> * gnu/packages/base.scm (binutils-sans-bug-22764): New public variable.
> * gnu/packages/linux.scm (make-linux-libre)[native-inputs]: On aarch64, define
> new ld-wrapper with the above binutils and use it.
Woohoo, excellent!
> +++ b/gnu/packages/patches/binutils-aarch64-symbol-relocation.patch
> @@ -0,0 +1,108 @@
> +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 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 */
Perhaps you can omit the ld/testsuite bits that follow (I don’t think we
run this test suite, do we?).
Apart from that LGTM, thank you!
Ludo’.
next prev parent reply other threads:[~2018-06-08 16:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-06 22:36 [bug#31741] [PATCH] gnu: linux-libre: Fix build on AArch64 Marius Bakke
2018-06-08 16:45 ` Ludovic Courtès [this message]
2018-06-16 19:42 ` bug#31741: " Marius Bakke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y3fpi5wr.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=31741@debbugs.gnu.org \
--cc=mbakke@fastmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).