Remove sunos.em
[deliverable/binutils-gdb.git] / ld / emultempl / nios2elf.em
index c86eba1f52b41f066e22e377522b52d2f073950a..805eb96d4678ba77a177695ab0362da779843d0e 100644 (file)
@@ -1,5 +1,5 @@
 # This shell script emits a C file. -*- C -*-
-#   Copyright (C) 2013, 2014 Free Software Foundation, Inc.
+#   Copyright (C) 2013-2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Binutils.
 #
@@ -41,16 +41,16 @@ static int need_laying_out = 0;
 static void
 nios2elf_create_output_section_statements (void)
 {
-  extern const bfd_target bfd_elf32_littlenios2_vec, bfd_elf32_bignios2_vec;
+  extern const bfd_target nios2_elf32_le_vec, nios2_elf32_be_vec;
 
-  if (link_info.output_bfd->xvec != &bfd_elf32_littlenios2_vec
-      && link_info.output_bfd->xvec != &bfd_elf32_bignios2_vec)
+  if (link_info.output_bfd->xvec != &nios2_elf32_le_vec
+      && link_info.output_bfd->xvec != &nios2_elf32_be_vec)
     return;
 
   /* If --no-relax was not explicitly specified by the user, enable
      relaxation.  If it's not enabled (either explicitly or by default),
      we're done, as we won't need to create any stubs.  */
-  if (!link_info.relocatable && RELAXATION_DISABLED_BY_DEFAULT)
+  if (!bfd_link_relocatable (&link_info) && RELAXATION_DISABLED_BY_DEFAULT)
     ENABLE_RELAXATION;
   if (!RELAXATION_ENABLED)
     return;
@@ -64,7 +64,7 @@ nios2elf_create_output_section_statements (void)
                              bfd_get_arch (link_info.output_bfd),
                              bfd_get_mach (link_info.output_bfd)))
     {
-      einfo ("%X%P: can not create BFD %E\n");
+      einfo (_("%F%P: can not create BFD: %E\n"));
       return;
     }
 
@@ -195,7 +195,7 @@ nios2elf_add_stub_section (const char *stub_sec_name, asection *input_section,
     return stub_sec;
 
  err_ret:
-  einfo ("%X%P: can not make stub section: %E\n");
+  einfo (_("%X%P: can not make stub section: %E\n"));
   return NULL;
 }
 
@@ -236,25 +236,33 @@ build_section_lists (lang_statement_union_type *statement)
 static void
 gld${EMULATION_NAME}_after_allocation (void)
 {
+  int ret;
+
   /* bfd_elf_discard_info just plays with data and debugging sections,
      ie. doesn't affect code size, so we can delay resizing the
      sections.  It's likely we'll resize everything in the process of
      adding stubs.  */
-  if (bfd_elf_discard_info (link_info.output_bfd, &link_info))
+  ret = bfd_elf_discard_info (link_info.output_bfd, &link_info);
+  if (ret < 0)
+    {
+      einfo (_("%X%P: .eh_frame/.stab edit: %E\n"));
+      return;
+    }
+  else if (ret > 0)
     need_laying_out = 1;
 
   /* If generating a relocatable output file, then we don't
      have to examine the relocs.  */
-  if (stub_file != NULL && !link_info.relocatable && RELAXATION_ENABLED)
+  if (stub_file != NULL
+      && !bfd_link_relocatable (&link_info)
+      && RELAXATION_ENABLED)
     {
-      int ret = nios2_elf32_setup_section_lists (link_info.output_bfd,
-                                                &link_info);
-
+      ret = nios2_elf32_setup_section_lists (link_info.output_bfd, &link_info);
       if (ret != 0)
        {
          if (ret < 0)
            {
-             einfo ("%X%P: can not size stub section: %E\n");
+             einfo (_("%X%P: can not size stub section: %E\n"));
              return;
            }
 
@@ -267,7 +275,7 @@ gld${EMULATION_NAME}_after_allocation (void)
                                        &nios2elf_add_stub_section,
                                        &nios2elf_layout_sections_again))
            {
-             einfo ("%X%P: can not size stub section: %E\n");
+             einfo (_("%X%P: can not size stub section: %E\n"));
              return;
            }
        }
@@ -276,13 +284,13 @@ gld${EMULATION_NAME}_after_allocation (void)
   if (need_laying_out != -1)
     gld${EMULATION_NAME}_map_segments (need_laying_out);
 
-  if (!link_info.relocatable && RELAXATION_ENABLED)
+  if (!bfd_link_relocatable (&link_info) && RELAXATION_ENABLED)
     {
       /* Now build the linker stubs.  */
       if (stub_file != NULL && stub_file->the_bfd->sections != NULL)
        {
          if (! nios2_elf32_build_stubs (&link_info))
-           einfo ("%X%P: can not build stubs: %E\n");
+           einfo (_("%X%P: can not build stubs: %E\n"));
        }
     }
 }
This page took 0.02588 seconds and 4 git commands to generate.