From Jason Merrill <jason@cygnus.com>:
authorIan Lance Taylor <ian@airs.com>
Mon, 18 May 1998 20:21:22 +0000 (20:21 +0000)
committerIan Lance Taylor <ian@airs.com>
Mon, 18 May 1998 20:21:22 +0000 (20:21 +0000)
* ldlang.c (wild_sort): Correct order of sort.
* scripttempl/elf.sc: Put *crtbegin.o before other .ctors and
.dtors.
* scripttempl/elfd10v.sc: Likewise.
start-sanitize-d30v
* scripttempl/elfd30v.sc: Likewise.
end-sanitize-d30v
* scripttempl/elfppc.sc: Likewise.

ld/ChangeLog
ld/scripttempl/elfppc.sc

index 457b6e8cc1207d83ba15c2ab6d36e428e0b48019..6a249f8dea12b8efa6971a518f6fa3d01af2693f 100644 (file)
@@ -1,3 +1,15 @@
+Mon May 18 13:14:43 1998  Ian Lance Taylor  <ian@cygnus.com>
+
+       From Jason Merrill <jason@cygnus.com>:
+       * ldlang.c (wild_sort): Correct order of sort.
+       * scripttempl/elf.sc: Put *crtbegin.o before other .ctors and
+       .dtors.
+       * scripttempl/elfd10v.sc: Likewise.
+start-sanitize-d30v
+       * scripttempl/elfd30v.sc: Likewise.
+end-sanitize-d30v
+       * scripttempl/elfppc.sc: Likewise.
+
 Fri May 15 00:22:35 1998  Ian Lance Taylor  <ian@cygnus.com>
 
        * ldlex.l: Recognize keyword SORT.
@@ -18,7 +30,9 @@ Fri May 15 00:22:35 1998  Ian Lance Taylor  <ian@cygnus.com>
        * mri.c (mri_draw_tree): Update calls to lang_add_wild.
        * scripttempl/elf.sc: Sort .ctors.* and .dtors.* by section name.
        * scripttempl/elfd10v.sc: Likewise.
+start-sanitize-d30v
        * scripttempl/elfd30v.sc: Likewise.
+end-sanitize-d30v
        * scripttempl/elfppc.sc: Likewise.
 
 Thu May 14 18:39:16 1998  Richard Henderson  <rth@cygnus.com>
index 5671d565d259227cf3c35c317f8b3f81a9ea5579..61ef1331f5d7d635b78504261f77aa626098e504 100644 (file)
@@ -129,11 +129,26 @@ SECTIONS
   .got2                ${RELOCATING-0} :  { *(.got2) }
 
                ${RELOCATING+PROVIDE (__CTOR_LIST__ = .);}
-  .ctors       ${RELOCATING-0} : { *(SORT(.ctors.*)) *(.ctors) }
+  .ctors       ${RELOCATING-0} : {
+                       /* gcc uses crtbegin.o to find the start of
+                          the constructors, so we make sure it is
+                          first.  Because this is a wildcard, it
+                          doesn't matter if the user does not
+                          actually link against crtbegin.o; the
+                          linker won't look for a file to match a
+                          wildcard.  The wildcard also means that it
+                          doesn't matter which directory crtbegin.o
+                          is in.  */
+                       *crtbegin.o(.ctors)
+                       *(SORT(.ctors.*))
+                       *(.ctors) }
                ${RELOCATING+PROVIDE (__CTOR_END__ = .);}
 
                ${RELOCATING+PROVIDE (__DTOR_LIST__ = .);}
-  .dtors       ${RELOCATING-0} : { *(SORT(.dtors.*)) *(.dtors) }
+  .dtors       ${RELOCATING-0} : {
+                       *crtbegin.o(.dtors)
+                       *(SORT(.dtors.*))
+                       *(.dtors) }
                ${RELOCATING+PROVIDE (__DTOR_END__ = .);}
 
                ${RELOCATING+PROVIDE (_FIXUP_START_ = .);}