From 53b81c6de19a1f89e3c797631e72d05ba41444dc Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 10 Apr 2019 11:58:15 +0930 Subject: [PATCH] cskyelf.em branch stub handling This fixes the csky-elf ld-elf/pr21884 and ld-unique/pr21529 failures, by disabling branch stubs for binary (and other non-csky) output. The csky-linux target gets branch stubs off by default because presumably there are reasons why branch stubs were disabled, but rather than killing the support completely it can be enabled by --branch-stub. * emultempl/cskyelf.em (csk_elf_before_parse): New function, setting use_branch_stub false for linux. (csky_elf_create_output_section_statements): Do emit this function and all others in the file for linux, plus the branch option control. Disable branch stubs when non-ELF. --- ld/ChangeLog | 8 ++++++++ ld/emultempl/cskyelf.em | 31 +++++++++++++++---------------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 4df91b7..0f36d6c 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,13 @@ 2019-04-10 Alan Modra + * emultempl/cskyelf.em (csk_elf_before_parse): New function, + setting use_branch_stub false for linux. + (csky_elf_create_output_section_statements): Do emit this + function and all others in the file for linux, plus the branch + option control. Disable branch stubs when non-ELF. + +2019-04-10 Alan Modra + * Makefile.am (eskyelf.c, eskyelf_linux.c): Depend on cskyelf.em. (ecskyelf_linux.c): Depend on cskyelf.sh. (eelf32microblazeel.c): Depend on elf32microblaze.sh. diff --git a/ld/emultempl/cskyelf.em b/ld/emultempl/cskyelf.em index 690bb49..3651bb2 100644 --- a/ld/emultempl/cskyelf.em +++ b/ld/emultempl/cskyelf.em @@ -116,25 +116,32 @@ EOF case ${target} in csky-*-linux-*) fragment <the_bfd = bfd_create ("linker stubs", link_info.output_bfd); @@ -150,11 +157,7 @@ csky_elf_create_output_section_statements (void) stub_file->the_bfd->flags |= BFD_LINKER_CREATED; ldlang_add_file (stub_file); } -EOF - ;; -esac -fragment <