]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - ld/emultempl/cr16elf.em
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / ld / emultempl / cr16elf.em
index d9f8bfc0533eccd55771e28ec7d93b1a63ef1948..abae7e6c86a4ce88ec1bdbee033513aa4680882e 100644 (file)
@@ -1,5 +1,5 @@
 # This shell script emits a C file. -*- C -*-
-# Copyright (C) 2007-2018 Free Software Foundation, Inc.
+# Copyright (C) 2007-2021 Free Software Foundation, Inc.
 # Contributed by M R Swami Reddy <MR.Swami.Reddy@nsc.com>
 #
 # This file is part of the GNU Binutils.
 # MA 02110-1301, USA.
 #
 
-# This file is sourced from elf32.em, and defines extra cr16-elf
+# This file is sourced from elf.em, and defines extra cr16-elf
 # specific routines.
 #
 fragment <<EOF
 
 #include "ldctor.h"
+#include "elf32-cr16.h"
 
 static void check_sections (bfd *, asection *, void *);
 
@@ -57,7 +58,7 @@ cr16_elf_after_open (void)
             COFF and ELF.  */
          if (bfd_get_flavour (abfd) != bfd_target_coff_flavour
              && bfd_get_flavour (abfd) != bfd_target_elf_flavour)
-           einfo (_("%F%B: all input objects must be COFF or ELF "
+           einfo (_("%F%P: %pB: all input objects must be COFF or ELF "
                     "for --embedded-relocs\n"));
 
          datasec = bfd_get_section_by_name (abfd, ".data.rel");
@@ -75,15 +76,13 @@ cr16_elf_after_open (void)
 
              relsec = bfd_make_section (abfd, ".emreloc");
              if (relsec == NULL
-                 || ! bfd_set_section_flags (abfd, relsec,
-                                             (SEC_ALLOC
-                                              | SEC_LOAD
-                                              | SEC_HAS_CONTENTS
-                                              | SEC_IN_MEMORY))
-                 || ! bfd_set_section_alignment (abfd, relsec, 2)
-                 || ! bfd_set_section_size (abfd, relsec,
-                                            datasec->reloc_count * 8))
-               einfo (_("%F%B: can not create .emreloc section: %E\n"));
+                 || !bfd_set_section_flags (relsec, (SEC_ALLOC
+                                                     | SEC_LOAD
+                                                     | SEC_HAS_CONTENTS
+                                                     | SEC_IN_MEMORY))
+                 || !bfd_set_section_alignment (relsec, 2)
+                 || !bfd_set_section_size (relsec, datasec->reloc_count * 8))
+               einfo (_("%F%P: %pB: can not create .emreloc section: %E\n"));
            }
 
          /* Double check that all other data sections are empty, as is
@@ -99,11 +98,11 @@ cr16_elf_after_open (void)
 static void
 check_sections (bfd *abfd, asection *sec, void *datasec)
 {
-  if ((strncmp (bfd_get_section_name (abfd, sec), ".data.rel", 9) == 0)
+  if ((strncmp (bfd_section_name (sec), ".data.rel", 9) == 0)
       && sec != datasec
       && sec->reloc_count == 0 )
-    einfo (_("%B%X: section %s has relocs; can not use --embedded-relocs\n"),
-          abfd, bfd_get_section_name (abfd, sec));
+    einfo (_("%X%P: %pB: section %s has relocs; can not use --embedded-relocs\n"),
+          abfd, bfd_section_name (sec));
 }
 
 static void
@@ -120,7 +119,7 @@ cr16elf_after_parse (void)
      is true the link sometimes fails.  */
   config.magic_demand_paged = FALSE;
 
-  gld${EMULATION_NAME}_after_parse ();
+  ldelf_after_parse ();
 }
 
 /* This is called after the sections have been attached to output
@@ -158,10 +157,10 @@ cr16elf_before_allocation (void)
                                                       &errmsg))
            {
              if (errmsg == NULL)
-               einfo (_("%B%X: can not create runtime reloc information: %E\n"),
+               einfo (_("%X%P: %pB: can not create runtime reloc information: %E\n"),
                       abfd);
              else
-               einfo (_("%X%B: can not create runtime reloc information: %s\n"),
+               einfo (_("%X%P: %pB: can not create runtime reloc information: %s\n"),
                       abfd, errmsg);
            }
        }