2009-03-02 Daniel Hellstrom <daniel@gaisler.com>

PR 1390/bsps
	* startup/linkcmds: Fix sections so C++ global constructors and
	destructors work with late model (>= 4.3) gcc versions.
This commit is contained in:
Joel Sherrill
2009-03-02 17:27:54 +00:00
parent bdc8d46647
commit 27d29e18b8
6 changed files with 87 additions and 32 deletions

View File

@@ -1,3 +1,9 @@
2009-03-02 Daniel Hellstrom <daniel@gaisler.com>
PR 1390/bsps
* startup/linkcmds: Fix sections so C++ global constructors and
destructors work with late model (>= 4.3) gcc versions.
2009-02-12 Joel Sherrill <joel.sherrill@oarcorp.com> 2009-02-12 Joel Sherrill <joel.sherrill@oarcorp.com>
* startup/setvec.c: Change prototype of IDLE thread to consistently * startup/setvec.c: Change prototype of IDLE thread to consistently

View File

@@ -94,13 +94,11 @@ SECTIONS
.text : .text :
{ {
CREATE_OBJECT_SYMBOLS CREATE_OBJECT_SYMBOLS
start = .;
text_start = .; text_start = .;
_text_start = .; _text_start = .;
*(.text*) *(.text*)
. = ALIGN (16); . = ALIGN (16);
/* /*
* Special FreeBSD sysctl sections. * Special FreeBSD sysctl sections.
*/ */
@@ -119,16 +117,29 @@ SECTIONS
/* /*
* C++ constructors * C++ constructors
*/ */
__CTOR_LIST__ = .; /* gcc uses crtbegin.o to find the start of
LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) the constructors, so we make sure it is
*(.ctors) first. Because this is a wildcard, it
LONG(0) doesn't matter if the user does not
__CTOR_END__ = .; actually link against crtbegin.o; the
__DTOR_LIST__ = .; linker won't look for a file to match a
LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) wildcard. The wildcard also means that it
*(.dtors) doesn't matter which directory crtbegin.o
LONG(0) is in. */
__DTOR_END__ = .; KEEP (*crtbegin.o(.ctors))
KEEP (*crtbegin?.o(.ctors))
/* We don't want to include the .ctor section from
the crtend.o file until after the sorted ctors.
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 (*(.ctors))
KEEP (*crtbegin.o(.dtors))
KEEP (*crtbegin?.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
_rodata_start = . ; _rodata_start = . ;
*(.rodata*) *(.rodata*)

View File

@@ -1,3 +1,9 @@
2009-03-02 Daniel Hellstrom <daniel@gaisler.com>
PR 1390/bsps
* startup/linkcmds: Fix sections so C++ global constructors and
destructors work with late model (>= 4.3) gcc versions.
2008-12-04 Ralf Corsépius <ralf.corsepius@rtems.org> 2008-12-04 Ralf Corsépius <ralf.corsepius@rtems.org>
* bsp_specs: Remove -e start from %link. * bsp_specs: Remove -e start from %link.

View File

@@ -117,16 +117,29 @@ SECTIONS
/* /*
* C++ constructors * C++ constructors
*/ */
__CTOR_LIST__ = .; /* gcc uses crtbegin.o to find the start of
LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) the constructors, so we make sure it is
*(.ctors) first. Because this is a wildcard, it
LONG(0) doesn't matter if the user does not
__CTOR_END__ = .; actually link against crtbegin.o; the
__DTOR_LIST__ = .; linker won't look for a file to match a
LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) wildcard. The wildcard also means that it
*(.dtors) doesn't matter which directory crtbegin.o
LONG(0) is in. */
__DTOR_END__ = .; KEEP (*crtbegin.o(.ctors))
KEEP (*crtbegin?.o(.ctors))
/* We don't want to include the .ctor section from
the crtend.o file until after the sorted ctors.
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 (*(.ctors))
KEEP (*crtbegin.o(.dtors))
KEEP (*crtbegin?.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
_rodata_start = . ; _rodata_start = . ;
*(.rodata*) *(.rodata*)

View File

@@ -1,3 +1,9 @@
2009-03-02 Daniel Hellstrom <daniel@gaisler.com>
PR 1390/bsps
* startup/linkcmds: Fix sections so C++ global constructors and
destructors work with late model (>= 4.3) gcc versions.
2008-12-04 Ralf Corsépius <ralf.corsepius@rtems.org> 2008-12-04 Ralf Corsépius <ralf.corsepius@rtems.org>
* bsp_specs: Remove -e start from %link. * bsp_specs: Remove -e start from %link.

View File

@@ -117,16 +117,29 @@ SECTIONS
/* /*
* C++ constructors * C++ constructors
*/ */
__CTOR_LIST__ = .; /* gcc uses crtbegin.o to find the start of
LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) the constructors, so we make sure it is
*(.ctors) first. Because this is a wildcard, it
LONG(0) doesn't matter if the user does not
__CTOR_END__ = .; actually link against crtbegin.o; the
__DTOR_LIST__ = .; linker won't look for a file to match a
LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) wildcard. The wildcard also means that it
*(.dtors) doesn't matter which directory crtbegin.o
LONG(0) is in. */
__DTOR_END__ = .; KEEP (*crtbegin.o(.ctors))
KEEP (*crtbegin?.o(.ctors))
/* We don't want to include the .ctor section from
the crtend.o file until after the sorted ctors.
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 (*(.ctors))
KEEP (*crtbegin.o(.dtors))
KEEP (*crtbegin?.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
_rodata_start = . ; _rodata_start = . ;
*(.rodata*) *(.rodata*)