From: Alan Modra Date: Thu, 27 Feb 2014 13:01:35 +0000 (+1030) Subject: Fix ELF ppc32 targets that don't use ppc32elf.em X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1e82f67aeaeffb362b2960b444b9fbc2b3628358;p=thirdparty%2Fbinutils-gdb.git Fix ELF ppc32 targets that don't use ppc32elf.em 5446cbdf82892a800ed7eef563a795e75223ec52 broke powerpc-lynxos, powerpc-netware, powerpc-windiss and powerpc-vxworks. bfd/ * elf32-ppc.c (ppc_elf_link_hash_table_create): Provide default params for targets that don't use ppc32elf.em. ld/ * emulparams/elf32ppcvxworks.sh: Source plt_unwind.sh and use ppc32elf.em. * emultempl/ppc32elf.em (ppc_after_open): Don't compile for vxworks. (LDEMUL_AFTER_OPEN): Don't set for vxworks. (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS): Exclude -secure-plt, -bss-plt and -sdata-got when vxworks. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 38926af8a27..1e54a3cf3ea 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,6 +1,10 @@ 2014-04-16 Alan Modra Apply mainline patches for ppc476 workaround + 2014-02-27 Alan Modra + * elf32-ppc.c (ppc_elf_link_hash_table_create): Provide default + params for targets that don't use ppc32elf.em. + 2014-02-17 Alan Modra * elf32-ppc.c (ppc_elf_relocate_section): Move relocs on insns patched for ppc476 workaround. Reapply branch taken/not taken diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 5e3ded4696a..22f3511432a 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -3252,6 +3252,7 @@ static struct bfd_link_hash_table * ppc_elf_link_hash_table_create (bfd *abfd) { struct ppc_elf_link_hash_table *ret; + static struct ppc_elf_params default_params = { PLT_OLD, 0, 1, 0, 0, 4096 }; ret = bfd_zmalloc (sizeof (struct ppc_elf_link_hash_table)); if (ret == NULL) @@ -3271,6 +3272,8 @@ ppc_elf_link_hash_table_create (bfd *abfd) ret->elf.init_plt_offset.offset = 0; ret->elf.init_plt_offset.glist = NULL; + ret->params = &default_params; + ret->sdata[0].name = ".sdata"; ret->sdata[0].sym_name = "_SDA_BASE_"; ret->sdata[0].bss_name = ".sbss"; diff --git a/ld/ChangeLog b/ld/ChangeLog index cb2d907aab2..b4b15534331 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,6 +1,15 @@ 2014-04-16 Alan Modra Apply mainline patches for ppc476 workaround + 2014-02-27 Alan Modra + * emulparams/elf32ppcvxworks.sh: Source plt_unwind.sh and + use ppc32elf.em. + * emultempl/ppc32elf.em (ppc_after_open): Don't compile for + vxworks. + (LDEMUL_AFTER_OPEN): Don't set for vxworks. + (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS): Exclude + -secure-plt, -bss-plt and -sdata-got when vxworks. + 2014-02-17 Alan Modra * emultempl/ppc32elf.em (ppc_after_open_output): Really enable ppc476 workaround for ld -r. diff --git a/ld/emulparams/elf32ppcvxworks.sh b/ld/emulparams/elf32ppcvxworks.sh index 1bc3f3093c9..88c1da0c226 100644 --- a/ld/emulparams/elf32ppcvxworks.sh +++ b/ld/emulparams/elf32ppcvxworks.sh @@ -1,3 +1,5 @@ . ${srcdir}/emulparams/elf32ppccommon.sh +. ${srcdir}/emulparams/plt_unwind.sh +EXTRA_EM_FILE=ppc32elf OUTPUT_FORMAT="elf32-powerpc-vxworks" . ${srcdir}/emulparams/vxworks.sh diff --git a/ld/emultempl/ppc32elf.em b/ld/emultempl/ppc32elf.em index f5a3a70e8f1..fc796a2295a 100644 --- a/ld/emultempl/ppc32elf.em +++ b/ld/emultempl/ppc32elf.em @@ -54,6 +54,11 @@ ppc_after_open_output (void) ppc_elf_link_params (&link_info, ¶ms); } +EOF + +# No --secure-plt, --bss-plt, or --sdata-got for vxworks. +if test -z "$VXWORKS_BASE_EM_FILE" ; then + fragment <