From 0db131fb835e4c4f6a024e86743467e7e01c965e Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Thu, 2 Jan 2020 14:06:01 +0000 Subject: AArch64: Set the correct ELF class for AArch64 stubs (PR/25210) This fixes PR 25210 by specifying the the correct ELF class for AArch64 stubs. After doing this the stub section starts behaving like a normal object file loaded from disk. That is SEC_LINKER_CREATED causes us to have to write the section manually. This flag was added as a fix for PR 24753. I believe that fix to still be correct as linker created sections don't have a size on disk and it fixes the Arm bootstrap regression. But in this case specifying the correct section class also makes the stub section not be considered by compress.c. So I'm partially revert this change so that we don't have to manage the section manually as implied by SEC_LINKER_CREATED. bfd/ChangeLog: PR 25210 PR 24753 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class. ld/ChangeLog: PR 25210 PR 24753 * emultempl/aarch64elf.em (elf${ELFSIZE}_aarch64_add_stub_section): Remove SEC_LINKER_CREATED. * testsuite/ld-aarch64/aarch64-elf.exp: Add erratum835769-843419. * testsuite/ld-aarch64/erratum835769-843419.d: New test. --- ld/emultempl/aarch64elf.em | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ld/emultempl/aarch64elf.em') diff --git a/ld/emultempl/aarch64elf.em b/ld/emultempl/aarch64elf.em index 7137502..d0519b3 100644 --- a/ld/emultempl/aarch64elf.em +++ b/ld/emultempl/aarch64elf.em @@ -170,7 +170,7 @@ elf${ELFSIZE}_aarch64_add_stub_section (const char *stub_sec_name, lang_output_section_statement_type *os; struct hook_stub_info info; - flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE | SEC_LINKER_CREATED + flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE | SEC_HAS_CONTENTS | SEC_RELOC | SEC_IN_MEMORY | SEC_KEEP); stub_sec = bfd_make_section_anyway_with_flags (stub_file->the_bfd, stub_sec_name, flags); -- cgit v1.1