ld: Pass -z notext to linker for tests with DT_TEXTREL
[deliverable/binutils-gdb.git] / ld / scripttempl / pep.sc
index a7157dcdcc23affbe24bc9ee63cbf006593aa2ef..d856e4f4814d947732ad570389287dae5365a837 100644 (file)
@@ -1,6 +1,6 @@
 # Linker script for PE.
 #
-# Copyright (C) 2014-2018 Free Software Foundation, Inc.
+# Copyright (C) 2014-2020 Free Software Foundation, Inc.
 #
 # Copying and distribution of this file, with or without modification,
 # are permitted in any medium without royalty provided the copyright
@@ -70,7 +70,7 @@ else
 fi
 
 cat <<EOF
-/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2020 Free Software Foundation, Inc.
 
    Copying and distribution of this script, with or without modification,
    are permitted in any medium without royalty provided the copyright
@@ -90,7 +90,7 @@ SECTIONS
   ${RELOCATING+. = ALIGN(__section_alignment__);}
   .text ${RELOCATING+ __image_base__ + ( __section_alignment__ < ${TARGET_PAGE_SIZE} ? . : __section_alignment__ )} :
   {
-    ${RELOCATING+ KEEP(*(.init))}
+    ${RELOCATING+KEEP (*(SORT_NONE(.init)))}
     *(.text)
     ${R_TEXT}
     ${RELOCATING+ *(.text.*)}
@@ -105,6 +105,7 @@ SECTIONS
           expectation that they will be overridden by the definitions
          here.  If we PROVIDE the symbols then they will not be
          overridden and global constructors will not be run.
+         See PR 22762 for more details.
          
          This does mean that it is not possible for a user to define
          their own __CTOR_LIST__ and __DTOR_LIST__ symbols; if they do,
@@ -114,7 +115,9 @@ SECTIONS
          (The custom script can just be a copy of this script with the
          PROVIDE() qualifiers added).
 
-         See PR 22762 for more details.  */
+         In particular this means that ld -Ur does not work, because
+         the proper __CTOR_LIST__ set by ld -Ur is overridden by a
+         bogus __CTOR_LIST__ set by the final link.  See PR 46.  */
        ___CTOR_LIST__ = .;
        __CTOR_LIST__ = .;
        LONG (-1); LONG (-1);
@@ -134,8 +137,8 @@ SECTIONS
        KEEP (*(SORT_BY_NAME(.dtors.*)));
        LONG (0); LONG (0);
      }
-    ${RELOCATING+ KEEP (*(.fini))}
-    /* ??? Why is .gcc_exc here?  */
+    ${RELOCATING+KEEP (*(SORT_NONE(.fini)))}
+    ${RELOCATING+/* ??? Why is .gcc_exc here?  */}
     ${RELOCATING+ *(.gcc_exc)}
     ${RELOCATING+PROVIDE (etext = .);}
     ${RELOCATING+ KEEP (*(.gcc_except_table))}
@@ -161,6 +164,7 @@ SECTIONS
   .rdata ${RELOCATING+BLOCK(__section_alignment__)} :
   {
     ${R_RDATA}
+    . = ALIGN(4);
     ${RELOCATING+__rt_psrelocs_start = .;}
     ${RELOCATING+KEEP(*(.rdata_runtime_pseudo_reloc))}
     ${RELOCATING+__rt_psrelocs_end = .;}
This page took 0.023938 seconds and 4 git commands to generate.