gdb/23712: Test case for multidictionary
[deliverable/binutils-gdb.git] / ld / emultempl / elf32.em
index c0925fc9b970e66a6d014960e5a09919369d69ac..f4f7ad6b4e115e93ac08b0cf1c5a5bbb47353be4 100644 (file)
@@ -12,7 +12,7 @@ fragment <<EOF
 /* This file is is generated by a shell script.  DO NOT EDIT! */
 
 /* ${ELFSIZE} bit ELF emulation code for ${EMULATION_NAME}
-   Copyright (C) 1991-2018 Free Software Foundation, Inc.
+   Copyright (C) 1991-2019 Free Software Foundation, Inc.
    Written by Steve Chamberlain <sac@cygnus.com>
    ELF support by Ian Lance Taylor <ian@cygnus.com>
 
@@ -106,6 +106,7 @@ gld${EMULATION_NAME}_before_parse (void)
   `if test -n "$CALL_NOP_BYTE" ; then echo link_info.call_nop_byte = $CALL_NOP_BYTE; fi`;
   link_info.check_relocs_after_open_input = TRUE;
   link_info.relro = DEFAULT_LD_Z_RELRO;
+  link_info.separate_code = DEFAULT_LD_Z_SEPARATE_CODE;
 }
 
 EOF
@@ -156,7 +157,7 @@ gld${EMULATION_NAME}_load_symbols (lang_input_statement_type *entry)
 
   if (entry->flags.just_syms
       && (bfd_get_file_flags (entry->the_bfd) & DYNAMIC) != 0)
-    einfo (_("%P%F: --just-symbols may not be used on DSO: %B\n"),
+    einfo (_("%F%P: %pB: --just-symbols may not be used on DSO\n"),
           entry->the_bfd);
 
   if (link_class == 0
@@ -279,7 +280,7 @@ gld${EMULATION_NAME}_stat_needed (lang_input_statement_type *s)
 
   if (bfd_stat (s->the_bfd, &st) != 0)
     {
-      einfo (_("%P:%B: bfd_stat failed: %E\n"), s->the_bfd);
+      einfo (_("%P: %pB: bfd_stat failed: %E\n"), s->the_bfd);
       return;
     }
 
@@ -319,7 +320,7 @@ gld${EMULATION_NAME}_stat_needed (lang_input_statement_type *s)
     soname = lbasename (s->filename);
 
   if (filename_ncmp (soname, global_needed->name, suffix - global_needed->name) == 0)
-    einfo (_("%P: warning: %s, needed by %B, may conflict with %s\n"),
+    einfo (_("%P: warning: %s, needed by %pB, may conflict with %s\n"),
           global_needed->name, global_needed->by, soname);
 }
 
@@ -381,7 +382,7 @@ gld${EMULATION_NAME}_try_needed (struct dt_needed *needed,
       struct bfd_link_needed_list *needs;
 
       if (! bfd_elf_get_bfd_needed_list (abfd, &needs))
-       einfo (_("%F%P:%B: bfd_elf_get_bfd_needed_list failed: %E\n"), abfd);
+       einfo (_("%F%P: %pB: bfd_elf_get_bfd_needed_list failed: %E\n"), abfd);
 
       if (needs != NULL)
        {
@@ -438,7 +439,7 @@ fragment <<EOF
      can only check that using stat.  */
 
   if (bfd_stat (abfd, &global_stat) != 0)
-    einfo (_("%F%P:%B: bfd_stat failed: %E\n"), abfd);
+    einfo (_("%F%P: %pB: bfd_stat failed: %E\n"), abfd);
 
   /* First strip off everything before the last '/'.  */
   soname = lbasename (abfd->filename);
@@ -474,7 +475,7 @@ fragment <<EOF
 
   /* Add this file into the symbol table.  */
   if (! bfd_link_add_symbols (abfd, &link_info))
-    einfo (_("%F%B: error adding symbols: %E\n"), abfd);
+    einfo (_("%F%P: %pB: error adding symbols: %E\n"), abfd);
 
   return TRUE;
 }
@@ -1148,7 +1149,7 @@ write_build_id (bfd *abfd)
   if (bfd_is_abs_section (asec->output_section))
     {
       einfo (_("%P: warning: .note.gnu.build-id section discarded,"
-              " --build-id ignored.\n"));
+              " --build-id ignored\n"));
       return TRUE;
     }
   i_shdr = &elf_section_data (asec->output_section)->this_hdr;
@@ -1193,7 +1194,7 @@ setup_build_id (bfd *ibfd)
   size = id_note_section_size (ibfd);
   if (size == 0)
     {
-      einfo (_("%P: warning: unrecognized --build-id style ignored.\n"));
+      einfo (_("%P: warning: unrecognized --build-id style ignored\n"));
       return FALSE;
     }
 
@@ -1211,8 +1212,8 @@ setup_build_id (bfd *ibfd)
       return TRUE;
     }
 
-  einfo (_("%P: warning: Cannot create .note.gnu.build-id section,"
-          " --build-id ignored.\n"));
+  einfo (_("%P: warning: cannot create .note.gnu.build-id section,"
+          " --build-id ignored\n"));
   return FALSE;
 }
 
@@ -1241,7 +1242,7 @@ gld${EMULATION_NAME}_after_open (void)
 
       if (link_info.out_implib_bfd == NULL)
        {
-         einfo (_("%F%s: Can't open for writing: %E\n"),
+         einfo (_("%F%P: %s: can't open for writing: %E\n"),
                 command_line.out_implib_filename);
        }
     }
@@ -1317,8 +1318,8 @@ gld${EMULATION_NAME}_after_open (void)
                }
              else if (seen_type != type)
                {
-                 einfo (_("%P%F: compact frame descriptions incompatible with"
-                          " DWARF2 .eh_frame from %B\n"),
+                 einfo (_("%F%P: compact frame descriptions incompatible with"
+                          " DWARF2 .eh_frame from %pB\n"),
                         type == DWARF2_EH_HDR ? abfd : elfbfd);
                  break;
                }
@@ -1352,8 +1353,8 @@ gld${EMULATION_NAME}_after_open (void)
            }
        }
       if (warn_eh_frame)
-       einfo (_("%P: warning: Cannot create .eh_frame_hdr section,"
-                " --eh-frame-hdr ignored.\n"));
+       einfo (_("%P: warning: cannot create .eh_frame_hdr section,"
+                " --eh-frame-hdr ignored\n"));
     }
 
   /* Get the list of files which appear in DT_NEEDED entries in
@@ -1407,7 +1408,7 @@ gld${EMULATION_NAME}_after_open (void)
       n.name = l->name;
       nn.by = l->by;
       if (verbose)
-       info_msg (_("%s needed by %B\n"), l->name, l->by);
+       info_msg (_("%s needed by %pB\n"), l->name, l->by);
 
       /* As-needed libs specified on the command line (or linker script)
         take priority over libs found in search dirs.  */
@@ -1541,14 +1542,14 @@ fragment <<EOF
       if (force < 2)
        continue;
 
-      einfo (_("%P: warning: %s, needed by %B, not found "
+      einfo (_("%P: warning: %s, needed by %pB, not found "
               "(try using -rpath or -rpath-link)\n"),
             l->name, l->by);
     }
 
   if (link_info.eh_frame_hdr_type == COMPACT_EH_HDR)
     if (!bfd_elf_parse_eh_frame_entries (NULL, &link_info))
-      einfo (_("%P%F: Failed to parse EH frame entries.\n"));
+      einfo (_("%F%P: failed to parse EH frame entries\n"));
 }
 
 EOF
@@ -1583,7 +1584,7 @@ gld${EMULATION_NAME}_find_exp_assignment (etree_type *exp)
                                               &link_info,
                                               exp->assign.dst, provide,
                                               exp->assign.hidden))
-           einfo (_("%P%F: failed to record assignment to %s: %E\n"),
+           einfo (_("%F%P: failed to record assignment to %s: %E\n"),
                   exp->assign.dst);
        }
       gld${EMULATION_NAME}_find_exp_assignment (exp->assign.src);
@@ -1679,11 +1680,6 @@ gld${EMULATION_NAME}_append_to_separated_string (char **to, char *op_arg)
     }
 }
 
-#if defined(__GNUC__) && GCC_VERSION < 4006
-  /* Work around a GCC uninitialized warning bug fixed in GCC 4.6.  */
-static struct bfd_link_hash_entry ehdr_start_empty;
-#endif
-
 /* This is called after the sections have been attached to output
    sections, but before any sizes or addresses have been set.  */
 
@@ -1693,13 +1689,10 @@ gld${EMULATION_NAME}_before_allocation (void)
   const char *rpath;
   asection *sinterp;
   bfd *abfd;
-  struct elf_link_hash_entry *ehdr_start = NULL;
-#if defined(__GNUC__) && GCC_VERSION < 4006
-  /* Work around a GCC uninitialized warning bug fixed in GCC 4.6.  */
-  struct bfd_link_hash_entry ehdr_start_save = ehdr_start_empty;
-#else
-  struct bfd_link_hash_entry ehdr_start_save;
-#endif
+  struct bfd_link_hash_entry *ehdr_start = NULL;
+  unsigned char ehdr_start_save_type = 0;
+  char ehdr_start_save_u[sizeof ehdr_start->u
+                        - sizeof ehdr_start->u.def.next] = "";
 
   if (is_elf_hash_table (link_info.hash))
     {
@@ -1731,11 +1724,14 @@ gld${EMULATION_NAME}_before_allocation (void)
                 we most likely will need dynamic relocations for
                 __ehdr_start if we are building a PIE or shared
                 library.  */
-             ehdr_start = h;
-             ehdr_start_save = h->root;
-             h->root.type = bfd_link_hash_defined;
-             h->root.u.def.section = bfd_abs_section_ptr;
-             h->root.u.def.value = 0;
+             ehdr_start = &h->root;
+             ehdr_start_save_type = ehdr_start->type;
+             memcpy (ehdr_start_save_u,
+                     (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
+                     sizeof ehdr_start_save_u);
+             ehdr_start->type = bfd_link_hash_defined;
+             ehdr_start->u.def.section = bfd_abs_section_ptr;
+             ehdr_start->u.def.value = 0;
            }
        }
 
@@ -1786,7 +1782,7 @@ gld${EMULATION_NAME}_before_allocation (void)
          command_line.filter_shlib, audit, depaudit,
          (const char * const *) command_line.auxiliary_filters,
          &link_info, &sinterp)))
-    einfo (_("%P%F: failed to set dynamic section sizes: %E\n"));
+    einfo (_("%F%P: failed to set dynamic section sizes: %E\n"));
 
 ${ELF_INTERPRETER_SET_DEFAULT}
   /* Let the user override the dynamic linker we are using.  */
@@ -1820,7 +1816,7 @@ ${ELF_INTERPRETER_SET_DEFAULT}
        msg = (char *) xmalloc ((size_t) (sz + 1));
        if (! bfd_get_section_contents (is->the_bfd, s, msg,
                                        (file_ptr) 0, sz))
-         einfo (_("%F%B: Can't read contents of section .gnu.warning: %E\n"),
+         einfo (_("%F%P: %pB: can't read contents of section .gnu.warning: %E\n"),
                 is->the_bfd);
        msg[sz] = '\0';
        (*link_info.callbacks->warning) (&link_info, msg,
@@ -1848,14 +1844,16 @@ ${ELF_INTERPRETER_SET_DEFAULT}
   before_allocation_default ();
 
   if (!bfd_elf_size_dynsym_hash_dynstr (link_info.output_bfd, &link_info))
-    einfo (_("%P%F: failed to set dynamic section sizes: %E\n"));
+    einfo (_("%F%P: failed to set dynamic section sizes: %E\n"));
 
   if (ehdr_start != NULL)
     {
       /* If we twiddled __ehdr_start to defined earlier, put it back
         as it was.  */
-      ehdr_start->root.type = ehdr_start_save.type;
-      ehdr_start->root.u = ehdr_start_save.u;
+      ehdr_start->type = ehdr_start_save_type;
+      memcpy ((char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
+             ehdr_start_save_u,
+             sizeof ehdr_start_save_u);
     }
 }
 
@@ -1956,7 +1954,7 @@ fragment <<EOF
 /* A variant of lang_output_section_find used by place_orphan.  */
 
 static lang_output_section_statement_type *
-output_rel_find (asection *sec, int isdyn)
+output_rel_find (int isdyn, int rela)
 {
   lang_output_section_statement_type *lookup;
   lang_output_section_statement_type *last = NULL;
@@ -1964,7 +1962,6 @@ output_rel_find (asection *sec, int isdyn)
   lang_output_section_statement_type *last_ro_alloc = NULL;
   lang_output_section_statement_type *last_rel = NULL;
   lang_output_section_statement_type *last_rel_alloc = NULL;
-  int rela = sec->name[4] == 'a';
 
   for (lookup = &lang_output_section_statement.head->output_section_statement;
        lookup != NULL;
@@ -2272,8 +2269,9 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
   else if ((flags & SEC_ALLOC) == 0)
     ;
   else if ((flags & SEC_LOAD) != 0
-          && ((elfinput && sh_type == SHT_NOTE)
-              || (!elfinput && CONST_STRNEQ (secname, ".note"))))
+          && (elfinput
+              ? sh_type == SHT_NOTE
+              : CONST_STRNEQ (secname, ".note")))
     place = &hold[orphan_interp];
   else if ((flags & (SEC_LOAD | SEC_HAS_CONTENTS | SEC_THREAD_LOCAL)) == 0)
     place = &hold[orphan_bss];
@@ -2283,9 +2281,10 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
     place = &hold[orphan_tdata];
   else if ((flags & SEC_READONLY) == 0)
     place = &hold[orphan_data];
-  else if (((elfinput && (sh_type == SHT_RELA || sh_type == SHT_REL))
-           || (!elfinput && CONST_STRNEQ (secname, ".rel")))
-          && (flags & SEC_LOAD) != 0)
+  else if ((flags & SEC_LOAD) != 0
+          && (elfinput
+              ? sh_type == SHT_RELA || sh_type == SHT_REL
+              : CONST_STRNEQ (secname, ".rel")))
     place = &hold[orphan_rel];
   else if ((flags & SEC_CODE) == 0)
     place = &hold[orphan_rodata];
@@ -2300,7 +2299,10 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
          if (place->name != NULL)
            place->os = lang_output_section_find (place->name);
          else
-           place->os = output_rel_find (s, isdyn);
+           {
+             int rela = elfinput ? sh_type == SHT_RELA : secname[4] == 'a';
+             place->os = output_rel_find (isdyn, rela);
+           }
        }
       after = place->os;
       if (after == NULL)
@@ -2375,17 +2377,41 @@ echo '             && link_info.combreloc'              >> e${EMULATION_NAME}.c
 echo '             && link_info.relro'                 >> e${EMULATION_NAME}.c
 echo '             && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xdw                        >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo '  ; else if (bfd_link_pie (&link_info)'          >> e${EMULATION_NAME}.c
+echo '             && link_info.combreloc'             >> e${EMULATION_NAME}.c
+echo '             && link_info.separate_code'         >> e${EMULATION_NAME}.c
+echo '             && link_info.relro) return'         >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xdceo              >> e${EMULATION_NAME}.c
+fi
 echo '  ; else if (bfd_link_pie (&link_info)'          >> e${EMULATION_NAME}.c
 echo '             && link_info.separate_code'         >> e${EMULATION_NAME}.c
 echo '             && link_info.combreloc) return'     >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xdce               >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo '  ; else if (bfd_link_pie (&link_info)'          >> e${EMULATION_NAME}.c
+echo '             && link_info.combreloc'             >> e${EMULATION_NAME}.c
+echo '             && link_info.relro) return'         >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xdco               >> e${EMULATION_NAME}.c
+fi
 echo '  ; else if (bfd_link_pie (&link_info)'          >> e${EMULATION_NAME}.c
 echo '             && link_info.combreloc) return'     >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xdc                        >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo '  ; else if (bfd_link_pie (&link_info)'          >> e${EMULATION_NAME}.c
+echo '             && link_info.separate_code'         >> e${EMULATION_NAME}.c
+echo '             && link_info.relro) return'         >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xdeo               >> e${EMULATION_NAME}.c
+fi
 fi
 echo '  ; else if (bfd_link_pie (&link_info)'          >> e${EMULATION_NAME}.c
 echo '             && link_info.separate_code) return' >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xde                        >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo '  ; else if (bfd_link_pie (&link_info)'          >> e${EMULATION_NAME}.c
+echo '             && link_info.relro) return'         >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xdo                >> e${EMULATION_NAME}.c
+fi
 echo '  ; else if (bfd_link_pie (&link_info)) return'  >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xd                 >> e${EMULATION_NAME}.c
 fi
@@ -2401,17 +2427,41 @@ echo '             && link_info.combreloc'              >> e${EMULATION_NAME}.c
 echo '             && link_info.relro'                 >> e${EMULATION_NAME}.c
 echo '             && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xsw                        >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo '  ; else if (bfd_link_dll (&link_info)'          >> e${EMULATION_NAME}.c
+echo '             && link_info.combreloc'             >> e${EMULATION_NAME}.c
+echo '             && link_info.separate_code'         >> e${EMULATION_NAME}.c
+echo '             && link_info.relro) return'         >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xsceo              >> e${EMULATION_NAME}.c
+fi
 echo '  ; else if (bfd_link_dll (&link_info)'          >> e${EMULATION_NAME}.c
 echo '             && link_info.combreloc'             >> e${EMULATION_NAME}.c
 echo '             && link_info.separate_code) return' >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xsce                       >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo '  ; else if (bfd_link_dll (&link_info)'          >> e${EMULATION_NAME}.c
+echo '             && link_info.combreloc'             >> e${EMULATION_NAME}.c
+echo '             && link_info.relro) return'         >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xsco               >> e${EMULATION_NAME}.c
+fi
 echo '  ; else if (bfd_link_dll (&link_info)'          >> e${EMULATION_NAME}.c
 echo '             && link_info.combreloc) return'     >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xsc                        >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo '  ; else if (bfd_link_dll (&link_info)'          >> e${EMULATION_NAME}.c
+echo '             && link_info.separate_code'         >> e${EMULATION_NAME}.c
+echo '             && link_info.relro) return'         >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xseo               >> e${EMULATION_NAME}.c
+fi
 fi
 echo '  ; else if (bfd_link_dll (&link_info)'          >> e${EMULATION_NAME}.c
 echo '             && link_info.separate_code) return' >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xse                        >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo '  ; else if (bfd_link_dll (&link_info)'          >> e${EMULATION_NAME}.c
+echo '             && link_info.relro) return'         >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xso               >> e${EMULATION_NAME}.c
+fi
 echo '  ; else if (bfd_link_dll (&link_info)) return'  >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xs                 >> e${EMULATION_NAME}.c
 fi
@@ -2424,14 +2474,34 @@ echo '  ; else if (link_info.combreloc'                 >> e${EMULATION_NAME}.c
 echo '             && link_info.relro'                 >> e${EMULATION_NAME}.c
 echo '             && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xw                 >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo '  ; else if (link_info.combreloc'                 >> e${EMULATION_NAME}.c
+echo '             && link_info.separate_code'         >> e${EMULATION_NAME}.c
+echo '             && link_info.relro) return'          >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xceo                >> e${EMULATION_NAME}.c
+fi
 echo '  ; else if (link_info.combreloc'                        >> e${EMULATION_NAME}.c
 echo '             && link_info.separate_code) return' >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xce                        >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo '  ; else if (link_info.combreloc'                 >> e${EMULATION_NAME}.c
+echo '             && link_info.relro) return'          >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xco                 >> e${EMULATION_NAME}.c
+fi
 echo '  ; else if (link_info.combreloc) return'                >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xc                 >> e${EMULATION_NAME}.c
 fi
-echo '  ; else if (link_info.separate_code) return'            >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo '  ; else if (link_info.separate_code'             >> e${EMULATION_NAME}.c
+echo '             && link_info.relro) return'          >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xeo                 >> e${EMULATION_NAME}.c
+fi
+echo '  ; else if (link_info.separate_code) return'     >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xe                 >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo '  ; else if (link_info.relro) return'             >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xo                  >> e${EMULATION_NAME}.c
+fi
 echo '  ; else return'                                 >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.x                  >> e${EMULATION_NAME}.c
 echo '; }'                                             >> e${EMULATION_NAME}.c
@@ -2470,6 +2540,21 @@ fragment <<EOF
       else
        return "ldscripts/${EMULATION_NAME}.xdw";
     }
+EOF
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+fragment <<EOF
+  else if (bfd_link_pie (&link_info)
+          && link_info.combreloc
+          && link_info.relro)
+    {
+      if (link_info.separate_code)
+       return "ldscripts/${EMULATION_NAME}.xdceo";
+      else
+       return "ldscripts/${EMULATION_NAME}.xdco";
+    }
+EOF
+fi
+fragment <<EOF
   else if (bfd_link_pie (&link_info)
           && link_info.combreloc)
     {
@@ -2480,6 +2565,18 @@ fragment <<EOF
     }
 EOF
 fi
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+fragment <<EOF
+  else if (bfd_link_pie (&link_info)
+          && link_info.relro)
+    {
+      if (link_info.separate_code)
+       return "ldscripts/${EMULATION_NAME}.xdeo";
+      else
+       return "ldscripts/${EMULATION_NAME}.xdo";
+    }
+EOF
+fi
 fragment <<EOF
   else if (bfd_link_pie (&link_info))
     {
@@ -2501,6 +2598,21 @@ fragment <<EOF
       else
        return "ldscripts/${EMULATION_NAME}.xsw";
     }
+EOF
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+fragment <<EOF
+  else if (bfd_link_dll (&link_info)
+          && link_info.combreloc
+          && link_info.relro)
+    {
+      if (link_info.separate_code)
+       return "ldscripts/${EMULATION_NAME}.xsceo";
+      else
+       return "ldscripts/${EMULATION_NAME}.xsco";
+    }
+EOF
+fi
+fragment <<EOF
   else if (bfd_link_dll (&link_info) && link_info.combreloc)
     {
       if (link_info.separate_code)
@@ -2510,6 +2622,18 @@ fragment <<EOF
     }
 EOF
 fi
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+fragment <<EOF
+  else if (bfd_link_dll (&link_info)
+          && link_info.relro)
+    {
+      if (link_info.separate_code)
+       return "ldscripts/${EMULATION_NAME}.xseo";
+      else
+       return "ldscripts/${EMULATION_NAME}.xso";
+    }
+EOF
+fi
 fragment <<EOF
   else if (bfd_link_dll (&link_info))
     {
@@ -2530,6 +2654,20 @@ fragment <<EOF
       else
        return "ldscripts/${EMULATION_NAME}.xw";
     }
+EOF
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+fragment <<EOF
+  else if (link_info.combreloc
+          && link_info.relro)
+    {
+      if (link_info.separate_code)
+       return "ldscripts/${EMULATION_NAME}.xceo";
+      else
+       return "ldscripts/${EMULATION_NAME}.xco";
+    }
+EOF
+fi
+fragment <<EOF
   else if (link_info.combreloc)
     {
       if (link_info.separate_code)
@@ -2539,6 +2677,17 @@ fragment <<EOF
     }
 EOF
 fi
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+fragment <<EOF
+  else if (link_info.relro)
+    {
+      if (link_info.separate_code)
+       return "ldscripts/${EMULATION_NAME}.xeo";
+      else
+       return "ldscripts/${EMULATION_NAME}.xo";
+    }
+EOF
+fi
 fragment <<EOF
   else
     {
@@ -2662,7 +2811,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
       else if (strcasecmp (optarg, "zlib-gabi") == 0)
        link_info.compress_debug = COMPRESS_DEBUG_GABI_ZLIB;
       else
-       einfo (_("%P%F: invalid --compress-debug-sections option: \`%s'\n"),
+       einfo (_("%F%P: invalid --compress-debug-sections option: \`%s'\n"),
               optarg);
       break;
 EOF
@@ -2717,7 +2866,7 @@ fragment <<EOF
          link_info.emit_gnu_hash = TRUE;
        }
       else
-       einfo (_("%P%F: invalid hash style \`%s'\n"), optarg);
+       einfo (_("%F%P: invalid hash style \`%s'\n"), optarg);
       break;
 
 EOF
@@ -2736,7 +2885,7 @@ fragment <<EOF
 
          config.maxpagesize = strtoul (optarg + 14, &end, 0);
          if (*end || (config.maxpagesize & (config.maxpagesize - 1)) != 0)
-           einfo (_("%P%F: invalid maxium page size \`%s'\n"),
+           einfo (_("%F%P: invalid maximum page size \`%s'\n"),
                   optarg + 14);
        }
       else if (CONST_STRNEQ (optarg, "common-page-size="))
@@ -2745,7 +2894,7 @@ fragment <<EOF
          config.commonpagesize = strtoul (optarg + 17, &end, 0);
          if (*end
              || (config.commonpagesize & (config.commonpagesize - 1)) != 0)
-           einfo (_("%P%F: invalid common page size \`%s'\n"),
+           einfo (_("%F%P: invalid common page size \`%s'\n"),
                   optarg + 17);
        }
       else if (CONST_STRNEQ (optarg, "stack-size="))
@@ -2753,7 +2902,7 @@ fragment <<EOF
          char *end;
          link_info.stacksize = strtoul (optarg + 11, &end, 0);
          if (*end || link_info.stacksize < 0)
-           einfo (_("%P%F: invalid stack size \`%s'\n"), optarg + 11);
+           einfo (_("%F%P: invalid stack size \`%s'\n"), optarg + 11);
          if (!link_info.stacksize)
            /* Use -1 for explicit no-stack, because zero means
               'default'.   */
@@ -2843,7 +2992,7 @@ fi
 
 fragment <<EOF
       else
-       einfo (_("%P: warning: -z %s ignored.\n"), optarg);
+       einfo (_("%P: warning: -z %s ignored\n"), optarg);
       break;
 EOF
 
This page took 0.032864 seconds and 4 git commands to generate.