* score-tdep.c (score_print_insn): Get the current endianess from
[deliverable/binutils-gdb.git] / ld / emultempl / ppc32elf.em
index b0239e0b76a5eb8e02ed54dabab385191cd1f4a5..1a93ed44927a68b055faf54b191cc5b851d1465b 100644 (file)
@@ -1,11 +1,11 @@
 # This shell script emits a C file. -*- C -*-
-#   Copyright 2003, 2005, 2007 Free Software Foundation, Inc.
+#   Copyright 2003, 2005, 2007, 2008 Free Software Foundation, Inc.
 #
-# This file is part of GLD, the Gnu Linker.
+# This file is part of the GNU Binutils.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+# MA 02110-1301, USA.
 #
 
 # This file is sourced from elf32.em, and defines extra powerpc32-elf
 # specific routines.
 #
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
 
 #include "libbfd.h"
 #include "elf32-ppc.h"
 
-extern const bfd_target bfd_elf32_powerpc_vec;
-extern const bfd_target bfd_elf32_powerpcle_vec;
-extern const bfd_target bfd_elf32_powerpc_vxworks_vec;
-
-static inline int
-is_ppc_elf32_vec(const bfd_target * vec)
-{
-  return (vec == &bfd_elf32_powerpc_vec
-         || vec == &bfd_elf32_powerpc_vxworks_vec
-         || vec == &bfd_elf32_powerpcle_vec);
-}
+#define is_ppc_elf(bfd) \
+  (bfd_get_flavour (bfd) == bfd_target_elf_flavour \
+   && elf_object_id (bfd) == PPC32_ELF_TDATA)
 
 /* Whether to run tls optimization.  */
 static int notlsopt = 0;
@@ -51,7 +44,7 @@ static int old_got = 0;
 static void
 ppc_after_open (void)
 {
-  if (is_ppc_elf32_vec (link_info.hash->creator))
+  if (is_ppc_elf (link_info.output_bfd))
     {
       int new_plt;
       int keep_new;
@@ -62,8 +55,8 @@ ppc_after_open (void)
       lang_output_section_statement_type *got_os[2];
 
       emit_stub_syms |= link_info.emitrelocations;
-      new_plt = ppc_elf_select_plt_layout (output_bfd, &link_info, plt_style,
-                                          emit_stub_syms);
+      new_plt = ppc_elf_select_plt_layout (link_info.output_bfd, &link_info,
+                                          plt_style, emit_stub_syms);
       if (new_plt < 0)
        einfo ("%X%P: select_plt_layout problem %E\n");
 
@@ -108,11 +101,11 @@ ppc_after_open (void)
 static void
 ppc_before_allocation (void)
 {
-  if (is_ppc_elf32_vec (link_info.hash->creator))
+  if (is_ppc_elf (link_info.output_bfd))
     {
-      if (ppc_elf_tls_setup (output_bfd, &link_info) && !notlsopt)
+      if (ppc_elf_tls_setup (link_info.output_bfd, &link_info) && !notlsopt)
        {
-         if (!ppc_elf_tls_optimize (output_bfd, &link_info))
+         if (!ppc_elf_tls_optimize (link_info.output_bfd, &link_info))
            {
              einfo ("%X%P: TLS problem %E\n");
              return;
@@ -125,7 +118,7 @@ ppc_before_allocation (void)
 EOF
 
 if grep -q 'ld_elf32_spu_emulation' ldemul-list.h; then
-  cat >>e${EMULATION_NAME}.c <<EOF
+  fragment <<EOF
 /* Special handling for embedded SPU executables.  */
 extern bfd_boolean embedded_spu_file (lang_input_statement_type *, const char *);
 static bfd_boolean gld${EMULATION_NAME}_load_symbols (lang_input_statement_type *);
@@ -164,11 +157,11 @@ PARSE_AND_LIST_LONGOPTS='
 
 PARSE_AND_LIST_OPTIONS='
   fprintf (file, _("\
-  --emit-stub-syms      Label linker stubs with a symbol.\n\
-  --no-tls-optimize     Don'\''t try to optimize TLS accesses.\n\
-  --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"
+  --emit-stub-syms            Label linker stubs with a symbol.\n\
+  --no-tls-optimize           Don'\''t try to optimize TLS accesses.\n\
+  --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"
                   ));
 '
 
This page took 0.037962 seconds and 4 git commands to generate.