This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Add support for PE startup files that want to define their own constructor and desctructor sequencin


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ca6f2be7f6bc638fd4fad48def1fae4ae4d7906e

commit ca6f2be7f6bc638fd4fad48def1fae4ae4d7906e
Author: Nick Clifton <nickc@redhat.com>
Date:   Thu Aug 10 13:17:12 2017 +0100

    Add support for PE startup files that want to define their own constructor and desctructor sequencing.
    
    	* scripttempl/pep.sc: Enclose __CTOR_LIST__, ___CTOR_LIST__,
    	__DTOR_LIST__ and ___DTOR_LIST__ in PROVIDE statements so that
    	they can be overrridden by crt input files.
    	* scripttempl/pe.sc: Likewise.

Diff:
---
 ld/ChangeLog          |  7 +++++++
 ld/scripttempl/pe.sc  | 22 ++++++++++++++++++----
 ld/scripttempl/pep.sc | 30 ++++++++++++++++++------------
 3 files changed, 43 insertions(+), 16 deletions(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index b0191cf..12c3a74 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2017-08-10  Nick Clifton  <nickc@redhat.com>
+
+	* scripttempl/pep.sc: Enclose __CTOR_LIST__, ___CTOR_LIST__,
+	__DTOR_LIST__ and ___DTOR_LIST__ in PROVIDE statements so that
+	they can be overrridden by crt input files.
+	* scripttempl/pe.sc: Likewise.
+
 2017-08-09  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* testsuite/config/default.exp (LD_CLASS): Check .libs/ld-new
diff --git a/ld/scripttempl/pe.sc b/ld/scripttempl/pe.sc
index 9f7b2b2..5de44e5 100644
--- a/ld/scripttempl/pe.sc
+++ b/ld/scripttempl/pe.sc
@@ -97,10 +97,24 @@ SECTIONS
     ${RELOCATING+ *(.gnu.linkonce.t.*)}
     ${RELOCATING+*(.glue_7t)}
     ${RELOCATING+*(.glue_7)}
-    ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
-			LONG (-1);*(.ctors); *(.ctor); *(SORT(.ctors.*));  LONG (0); }
-    ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
-			LONG (-1); *(.dtors); *(.dtor); *(SORT(.dtors.*));  LONG (0); }
+    ${CONSTRUCTING+
+       PROVIDE(___CTOR_LIST__ = .);
+       PROVIDE(__CTOR_LIST__ = .);
+       LONG (-1);
+       KEEP(*(.ctors));
+       KEEP(*(.ctor));
+       KEEP(*(SORT_BY_NAME(.ctors.*)));
+       LONG (0);
+     }
+    ${CONSTRUCTING+
+       PROVIDE(___DTOR_LIST__ = .);
+       PROVIDE(__DTOR_LIST__ = .);
+       LONG (-1);
+       KEEP(*(.dtors));
+       KEEP(*(.dtor));
+       KEEP(*(SORT_BY_NAME(.dtors.*)));
+       LONG (0);
+     }
     ${RELOCATING+ KEEP (*(.fini))}
     /* ??? Why is .gcc_exc here?  */
     ${RELOCATING+ *(.gcc_exc)}
diff --git a/ld/scripttempl/pep.sc b/ld/scripttempl/pep.sc
index 57eb75c..e972ec8 100644
--- a/ld/scripttempl/pep.sc
+++ b/ld/scripttempl/pep.sc
@@ -98,18 +98,24 @@ SECTIONS
     ${RELOCATING+*(.glue_7t)}
     ${RELOCATING+*(.glue_7)}
     ${CONSTRUCTING+. = ALIGN(8);}
-    ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
-			LONG (-1); LONG (-1);
-			KEEP (*(.ctors));
-			KEEP (*(.ctor));
-			KEEP (*(SORT(.ctors.*)));
-			LONG (0); LONG (0); }
-    ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
-			LONG (-1); LONG (-1);
-			KEEP (*(.dtors));
-			KEEP (*(.dtor));
-			KEEP (*(SORT(.dtors.*)));
-			LONG (0); LONG (0); }
+    ${CONSTRUCTING+
+       PROVIDE(___CTOR_LIST__ = .);
+       PROVIDE(__CTOR_LIST__ = .);
+       LONG (-1); LONG (-1);
+       KEEP (*(.ctors));
+       KEEP (*(.ctor));
+       KEEP (*(SORT_BY_NAME(.ctors.*)));
+       LONG (0); LONG (0);
+     }
+    ${CONSTRUCTING+
+       PROVIDE(___DTOR_LIST__ = .);
+       PROVIDE(__DTOR_LIST__ = .);
+       LONG (-1); LONG (-1);
+       KEEP (*(.dtors));
+       KEEP (*(.dtor));
+       KEEP (*(SORT_BY_NAME(.dtors.*)));
+       LONG (0); LONG (0);
+     }
     ${RELOCATING+ KEEP (*(.fini))}
     /* ??? Why is .gcc_exc here?  */
     ${RELOCATING+ *(.gcc_exc)}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]