This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[COMMITTED][PATCH][Binutils][AArch64] Revert setting of elf class in linker stub.
- From: Tamar Christina <Tamar dot Christina at arm dot com>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Cc: nd <nd at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>
- Date: Fri, 10 Jan 2020 13:53:17 +0000
- Subject: [COMMITTED][PATCH][Binutils][AArch64] Revert setting of elf class in linker stub.
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g8BICKSlRdPzlvuuJlF4U5BwXuyIPub4R/nB+SnzWWc=; b=Y0jpGHOLu6RTi8xyCrPdOUIXRWE1heESpZCGhhr2h5Tpmsf5FyLMddAfN6L2uhLnS9gSn88OUZdToEiR8IbEsHw13u1VcpGHydBDBzxiC2dzczRLAA7lKWpkMj1apjtN509/1qHdP0FQvzWk4j7T2Hs+1GMm5k1cPPmYGVnwNtw/8Zek+XYPexj099nwxgWJKIt6WIU5w/oSxRMlCVlsP/nJV9wvppxQDJMFwUuV0PefbHP0hOt1ntcJEsnttywVDxjjldmDfDccOARbDf863Hf9dNgWznFVq/f9qB1UPAXY7iiun8d1b8gipfULWgDMnoLCuBnwq7KpMHX6TD+IZw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kPxlf3O7WYonAFLO44fLoLZ00utkWSvIpZ05JIMVvNOe5SuLN2SfXse25CNjaiFcxa6hJkGo4AVTDFLwz9SBRusTaA1ailqRYTPWNb7DchIG3WPLApehMkGOgZPZiDRDKqYJW20iPFCqkjJc7kSTLj5ROfVkavYEEnTkHhfZ2x9fjTCchk8jciRwo5yAl+uIPWyjQCL0sPQP2C+Q2BG0RgyfUeEUFxbzhRrSfq38KLutU3i00eJ+C8RqcUOCNoM21K3giRafVFqj5NJ0O5SViRyZma4S8diKtWAnHfxaqdduALQn6Nt9pep2R6deIn5KcZ+VYItwzdL+kmOOSigf6Q==
- Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tamar dot Christina at arm dot com;
Hi All,
This changes the fix to PR 25210 by removing the ELF class change.
As it turns out the correct change was only the change in compress.c.
Everything else is unneeded and setting the elf class is making the linker
behave very oddly under LTO. The first stub is correctly written out but for
the rest the suddenly don't have a pointer to the stub section anymore.
This caused SPEC to fail as the program would branch to the stub and it wouldn't
be filled in.
build on native hardware and regtested on
aarch64-none-elf, aarch64-none-elf (32 bit host),
aarch64-none-linux-gnu, aarch64-none-linux-gnu (32 bit host),
arm-none-eabi, arm-none-eabi (32 bit host),
arm-none-linux-gnueabihf, arm-none-linux-gnueabihf (32 bit host)
Cross-compiled and regtested on
aarch64-none-linux-gnu, aarch64_be-none-linux-gnu,
arm-none-eabi, armeb-none-eabi, arm-wince-pe
and no issues.
Also performed a full toolchain build for aarch64-none-linux-gnu to confirm
that this doesn't re-introduce the issue mentioned in PR 24753 and also did a SPEC2017
run to verify that the errata workarounds are correct again.
Committed to master under the trivial rule as this is partially reverting a previous commit.
Thanks,
Tamar
bfd/ChangeLog:
2020-01-10 Tamar Christina <tamar.christina@arm.com>
PR 25210
* elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
--
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index 756ffeb6bdad04ce7fc466e7f3c23c462c6a806a..5fabcd8f6462730aef10ec942b594d589759994e 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -3177,10 +3177,6 @@ _bfd_aarch64_create_stub_section (asection *section,
if (s_name == NULL)
return NULL;
- /* PR 25210. Set the right class on the stub_bfd. */
- elf_elfheader (htab->stub_bfd)->e_ident[EI_CLASS] = ELFCLASSNN;
- BFD_ASSERT (ELFCLASSNN == get_elf_backend_data (htab->stub_bfd)->s->elfclass);
-
memcpy (s_name, section->name, namelen);
memcpy (s_name + namelen, STUB_SUFFIX, sizeof (STUB_SUFFIX));
return (*htab->add_stub_section) (s_name, section);