bfd, ld: add CTF section linking
[deliverable/binutils-gdb.git] / ld / emultempl / pep.em
index 1dc1664f9851bca872875763b20f1252b4787da7..ec2d83fa633527589a60ff03ed5eb36b8c57f068 100644 (file)
@@ -18,7 +18,7 @@ esac
 rm -f e${EMULATION_NAME}.c
 (echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
 fragment <<EOF
-/* Copyright (C) 2006-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2019 Free Software Foundation, Inc.
    Written by Kai Tietz, OneVision Software GmbH&CoKg.
 
    This file is part of the GNU Binutils.
@@ -51,6 +51,7 @@ fragment <<EOF
 #include "sysdep.h"
 #include "bfd.h"
 #include "bfdlink.h"
+#include "ctf-api.h"
 #include "getopt.h"
 #include "libiberty.h"
 #include "filenames.h"
@@ -1348,7 +1349,8 @@ gld_${EMULATION_NAME}_after_open (void)
      FIXME: This should be done via a function, rather than by
      including an internal BFD header.  */
 
-  if (coff_data (link_info.output_bfd) == NULL
+  if (bfd_get_flavour (link_info.output_bfd) != bfd_target_coff_flavour
+      || coff_data (link_info.output_bfd) == NULL
       || coff_data (link_info.output_bfd)->pe == 0)
     einfo (_("%F%P: cannot perform PE operations on non PE output file '%pB'\n"),
           link_info.output_bfd);
@@ -1479,7 +1481,7 @@ gld_${EMULATION_NAME}_after_open (void)
                      {
                        struct bfd_symbol *s;
                        struct bfd_link_hash_entry * blhe;
-                       char *other_bfd_filename;
+                       const char *other_bfd_filename;
                        char *n;
 
                        s = (relocs[i]->sym_ptr_ptr)[0];
@@ -1509,7 +1511,7 @@ gld_${EMULATION_NAME}_after_open (void)
                        /* Rename this implib to match the other one.  */
                        n = xmalloc (strlen (other_bfd_filename) + 1);
                        strcpy (n, other_bfd_filename);
-                       is->the_bfd->my_archive->filename = n;
+                       bfd_set_filename (is->the_bfd->my_archive, n);
                      }
 
                    free (relocs);
@@ -1614,7 +1616,7 @@ gld_${EMULATION_NAME}_after_open (void)
 
                new_name = xmalloc (strlen (is->the_bfd->filename) + 3);
                sprintf (new_name, "%s.%c", is->the_bfd->filename, seq);
-               is->the_bfd->filename = new_name;
+               bfd_set_filename (is->the_bfd, new_name);
 
                new_name = xmalloc (strlen (is->filename) + 3);
                sprintf (new_name, "%s.%c", is->filename, seq);
@@ -1913,9 +1915,7 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
                && (nexts->flags & SEC_EXCLUDE) == 0
                && ((nexts->flags ^ flags) & (SEC_LOAD | SEC_ALLOC)) == 0
                && (nexts->owner->flags & DYNAMIC) == 0
-               && nexts->owner->usrdata != NULL
-               && !(((lang_input_statement_type *) nexts->owner->usrdata)
-                    ->flags.just_syms))
+               && !bfd_input_just_syms (nexts->owner))
              flags = (((flags ^ SEC_READONLY)
                        | (nexts->flags ^ SEC_READONLY))
                       ^ SEC_READONLY);
@@ -1950,8 +1950,7 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
                                                       NULL);
          if (after == NULL)
            /* *ABS* is always the first output section statement.  */
-           after = (&lang_output_section_statement.head
-                    ->output_section_statement);
+           after = &lang_os_list.head->output_section_statement;
        }
 
       /* All sections in an executable must be aligned to a page boundary.
@@ -1979,7 +1978,7 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
 
       ls = &(*pl)->input_section;
 
-      lname = bfd_get_section_name (ls->section->owner, ls->section);
+      lname = bfd_section_name (ls->section);
       if (strchr (lname, '\$') != NULL
          && (dollar == NULL || strcmp (orig_secname, lname) < 0))
        break;
@@ -2167,6 +2166,8 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
   gld_${EMULATION_NAME}_recognized_file,
   gld_${EMULATION_NAME}_find_potential_libraries,
   NULL,        /* new_vers_pattern.  */
-  NULL /* extra_map_file_text */
+  NULL,        /* extra_map_file_text */
+  ${LDEMUL_EMIT_CTF_EARLY-NULL},
+  ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL}
 };
 EOF
This page took 0.026193 seconds and 4 git commands to generate.