[rtems commit] bsps/sparc: Fix global construction/destruction
    Sebastian Huber 
    sebh at rtems.org
       
    Thu Aug 12 12:47:42 UTC 2021
    
    
  
Module:    rtems
Branch:    4.11
Commit:    63c6b06fd1cf051ea57a9b22c9986c8421b10446
Changeset: http://git.rtems.org/rtems/commit/?id=63c6b06fd1cf051ea57a9b22c9986c8421b10446
Author:    Thanassis Tsiodras <Thanassis.Tsiodras at esa.int>
Date:      Tue Mar  6 07:23:07 2018 +0100
bsps/sparc: Fix global construction/destruction
The
  KEEP (*(SORT(.ctors.*)))
  KEEP (*(.ctors))
cannot be simplified to
  KEEP (*(SORT(.ctors*)))
since
  .ctors < .ctors.*
in lexicographical order.
See spglobalcon02 test case.
Close #3319.
---
 c/src/lib/libbsp/sparc/shared/startup/linkcmds.base | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/c/src/lib/libbsp/sparc/shared/startup/linkcmds.base b/c/src/lib/libbsp/sparc/shared/startup/linkcmds.base
index 219a060..c4a9b23 100644
--- a/c/src/lib/libbsp/sparc/shared/startup/linkcmds.base
+++ b/c/src/lib/libbsp/sparc/shared/startup/linkcmds.base
@@ -87,11 +87,13 @@ SECTIONS
        The .ctor section from the crtend file contains the
        end of ctors marker and it must be last */
     KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
-    KEEP (*(SORT(.ctors*)))
+    KEEP (*(SORT(.ctors.*)))
+    KEEP (*(.ctors))
     KEEP (*crtbegin.o(.dtors))
     KEEP (*crtbegin?.o(.dtors))
     KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
-    KEEP (*(SORT(.dtors*)))
+    KEEP (*(SORT(.dtors.*)))
+    KEEP (*(.dtors))
 
     _rodata_start = . ;
     *(.rodata*)
    
    
More information about the vc
mailing list