]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix ELF ppc32 targets that don't use ppc32elf.em
authorAlan Modra <amodra@gmail.com>
Thu, 27 Feb 2014 13:01:35 +0000 (23:31 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 16 Apr 2014 02:38:35 +0000 (12:08 +0930)
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.

bfd/ChangeLog
bfd/elf32-ppc.c
ld/ChangeLog
ld/emulparams/elf32ppcvxworks.sh
ld/emultempl/ppc32elf.em

index 38926af8a2732cab889998ff6199da6fe92ee01d..1e54a3cf3eacd6bcfa21cf397a23f3f10b82cc85 100644 (file)
@@ -1,6 +1,10 @@
 2014-04-16  Alan Modra  <amodra@gmail.com>
 
        Apply mainline patches for ppc476 workaround
+       2014-02-27  Alan Modra  <amodra@gmail.com>
+       * 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  <amodra@gmail.com>
        * elf32-ppc.c (ppc_elf_relocate_section): Move relocs on insns
        patched for ppc476 workaround.  Reapply branch taken/not taken
index 5e3ded4696ab99aa81b2682b52fb4cbe8bcbfb4f..22f3511432a011162ebfbb2d1a58db0f124d787c 100644 (file)
@@ -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";
index cb2d907aab21845a5e2774ce66e9ba929919acef..b4b155343315da79f6d1e39ac76f713ca2c51dae 100644 (file)
@@ -1,6 +1,15 @@
 2014-04-16  Alan Modra  <amodra@gmail.com>
 
        Apply mainline patches for ppc476 workaround
+       2014-02-27  Alan Modra  <amodra@gmail.com>
+       * 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  <amodra@gmail.com>
        * emultempl/ppc32elf.em (ppc_after_open_output): Really enable
        ppc476 workaround for ld -r.
index 1bc3f3093c962fe476bc26cbc871f18dc900d60c..88c1da0c226d9930e23e82322baafd123dd6d8f6 100644 (file)
@@ -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
index f5a3a70e8f165942c635fd8053a096e29521c192..fc796a2295a977998bbdb2cc87a531ad600a4834 100644 (file)
@@ -54,6 +54,11 @@ ppc_after_open_output (void)
   ppc_elf_link_params (&link_info, &params);
 }
 
+EOF
+
+# No --secure-plt, --bss-plt, or --sdata-got for vxworks.
+if test -z "$VXWORKS_BASE_EM_FILE" ; then
+  fragment <<EOF
 static void
 ppc_after_open (void)
 {
@@ -109,6 +114,9 @@ ppc_after_open (void)
   gld${EMULATION_NAME}_after_open ();
 }
 
+EOF
+fi
+fragment <<EOF
 static void
 ppc_before_allocation (void)
 {
@@ -206,10 +214,14 @@ PARSE_AND_LIST_LONGOPTS=${PARSE_AND_LIST_LONGOPTS}'
   { "emit-stub-syms", no_argument, NULL, OPTION_STUBSYMS },
   { "no-emit-stub-syms", no_argument, NULL, OPTION_NO_STUBSYMS },
   { "no-tls-optimize", no_argument, NULL, OPTION_NO_TLS_OPT },
-  { "no-tls-get-addr-optimize", no_argument, NULL, OPTION_NO_TLS_GET_ADDR_OPT },
+  { "no-tls-get-addr-optimize", no_argument, NULL, OPTION_NO_TLS_GET_ADDR_OPT },'
+if test -z "$VXWORKS_BASE_EM_FILE" ; then
+  PARSE_AND_LIST_LONGOPTS=${PARSE_AND_LIST_LONGOPTS}'
   { "secure-plt", no_argument, NULL, OPTION_NEW_PLT },
   { "bss-plt", no_argument, NULL, OPTION_OLD_PLT },
-  { "sdata-got", no_argument, NULL, OPTION_OLD_GOT },
+  { "sdata-got", no_argument, NULL, OPTION_OLD_GOT },'
+fi
+PARSE_AND_LIST_LONGOPTS=${PARSE_AND_LIST_LONGOPTS}'
   { "ppc476-workaround", optional_argument, NULL, OPTION_PPC476_WORKAROUND },
   { "no-ppc476-workaround", no_argument, NULL, OPTION_NO_PPC476_WORKAROUND },
 '
@@ -219,10 +231,14 @@ PARSE_AND_LIST_OPTIONS=${PARSE_AND_LIST_OPTIONS}'
   --emit-stub-syms            Label linker stubs with a symbol.\n\
   --no-emit-stub-syms         Don'\''t label linker stubs with a symbol.\n\
   --no-tls-optimize           Don'\''t try to optimize TLS accesses.\n\
-  --no-tls-get-addr-optimize  Don'\''t use a special __tls_get_addr call.\n\
+  --no-tls-get-addr-optimize  Don'\''t use a special __tls_get_addr call.\n'
+if test -z "$VXWORKS_BASE_EM_FILE" ; then
+  PARSE_AND_LIST_OPTIONS=${PARSE_AND_LIST_OPTIONS}'\
   --secure-plt                Use new-style PLT if possible.\n\
   --bss-plt                   Force old-style BSS PLT.\n\
-  --sdata-got                 Force GOT location just before .sdata.\n\
+  --sdata-got                 Force GOT location just before .sdata.\n'
+fi
+PARSE_AND_LIST_OPTIONS=${PARSE_AND_LIST_OPTIONS}'\
   --ppc476-workaround [=pagesize]\n\
                               Avoid a cache bug on ppc476.\n\
   --no-ppc476-workaround      Disable workaround.\n"
@@ -284,5 +300,7 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}'
 # Put these extra ppc32elf routines in ld_${EMULATION_NAME}_emulation
 #
 LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=ppc_after_open_output
-LDEMUL_AFTER_OPEN=ppc_after_open
+if test -z "$VXWORKS_BASE_EM_FILE" ; then
+  LDEMUL_AFTER_OPEN=ppc_after_open
+fi
 LDEMUL_BEFORE_ALLOCATION=ppc_before_allocation