summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-06-15 22:01:04 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-06-15 22:01:04 +0000
commit8e0dcadec548ebd6d2f581c3bcc46d70e147a793 (patch)
tree829cbc25e454a3c3a5109688f3210f29b5c680ca /c/src/lib/libbsp
parentDirectives -> services. (diff)
downloadrtems-8e0dcadec548ebd6d2f581c3bcc46d70e147a793.tar.bz2
Patch from Rosimildo DaSilva <rdasilva@connecttel.com> to make C++
exceptions work on the pc386 BSP with i386-elf. This patch also included changes to the i386-rtemself egcs configuration.
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/i386/pc386/bsp_specs5
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/Makefile.in4
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/linkcmds7
-rw-r--r--c/src/lib/libbsp/shared/main.c10
4 files changed, 23 insertions, 3 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/bsp_specs b/c/src/lib/libbsp/i386/pc386/bsp_specs
index 61dac86b53..4411a8f01d 100644
--- a/c/src/lib/libbsp/i386/pc386/bsp_specs
+++ b/c/src/lib/libbsp/i386/pc386/bsp_specs
@@ -7,6 +7,9 @@
*cpp:
%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
+*endfile:
+crtend.o%s crtn.o%s
+
*lib:
%{!qrtems: %(old_lib)} %{qrtems: --start-group \
%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
@@ -15,7 +18,7 @@
*startfile:
%{!qrtems: %(old_startfile)} %{qrtems: \
-%{!qrtems_debug: start.o%s} \
+%{!qrtems_debug: start.o%s crti.o%s crtbegin.o%s} \
%{qrtems_debug: start_g.o%s}}
*link:
diff --git a/c/src/lib/libbsp/i386/pc386/startup/Makefile.in b/c/src/lib/libbsp/i386/pc386/startup/Makefile.in
index 6ff0dff45e..a9a359bea8 100644
--- a/c/src/lib/libbsp/i386/pc386/startup/Makefile.in
+++ b/c/src/lib/libbsp/i386/pc386/startup/Makefile.in
@@ -39,7 +39,9 @@ include $(RTEMS_ROOT)/make/leaf.cfg
# (OPTIONAL) Add local stuff here using +=
#
-DEFINES +=
+# USE_INIT_FINI tells main.c what C++ help we need.
+
+DEFINES += -DUSE_INIT_FINI
CPPFLAGS +=
CFLAGS +=
diff --git a/c/src/lib/libbsp/i386/pc386/startup/linkcmds b/c/src/lib/libbsp/i386/pc386/startup/linkcmds
index 5dd7a675a3..712c5cfae4 100644
--- a/c/src/lib/libbsp/i386/pc386/startup/linkcmds
+++ b/c/src/lib/libbsp/i386/pc386/startup/linkcmds
@@ -67,7 +67,12 @@ SECTIONS
_etext = ALIGN( 0x10 ) ;
}
- .data ADDR( .text ) + SIZEOF( .text ):
+ .init :
+ { *( .init ) } = 0x9090
+ .fini :
+ { *( .fini ) } = 0x9090
+
+ .data ADDR( .fini ) + SIZEOF( .fini ):
{
_data_start = . ;
*(.data)
diff --git a/c/src/lib/libbsp/shared/main.c b/c/src/lib/libbsp/shared/main.c
index a23e2d8a45..d516ff9b08 100644
--- a/c/src/lib/libbsp/shared/main.c
+++ b/c/src/lib/libbsp/shared/main.c
@@ -28,6 +28,11 @@ extern rtems_configuration_table Configuration;
extern rtems_configuration_table BSP_Configuration;
extern rtems_cpu_table Cpu_table;
+#if defined(USE_INIT_FINI)
+extern void _fini( void );
+extern void _init( void );
+#endif
+
rtems_interrupt_level bsp_isr_level;
/*
@@ -82,6 +87,11 @@ int boot_card(int argc, char **argv)
* are any.
*/
+#if defined(USE_INIT_FINI)
+ atexit( _fini );
+ _init();
+#endif
+
status = main(argc, argv);
/*