From 97503aa5e3ada1e04d60bf906eb438465cadc521 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 5 Jan 1999 17:50:03 +0000 Subject: Patch from Chris Johns to get around a C++ problem with psim. This problem should and likely was occurring with other BSPs. This is from Chris' email: I had a look in the psim bsp for the older snapshot I have and it looks like you are using the `libbsp/shared/main.c' and this is known to work. I have just built the powerpc tools, and compiled the bsp. I have not added the linker command file patch so got the list of linker warnings. It looks to me like a compiler bug. The `main' call is being inlined and when that happens the special code to call `__eabi' is not being added to the inlined version. I have attached a patch which places `main' after `boot_card' and a call to main is now generated. I have not tested it but it should work. I also include a dump of `boot_card' and `main' showing the bug. --- c/src/lib/libbsp/shared/main.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'c/src/lib/libbsp/shared/main.c') diff --git a/c/src/lib/libbsp/shared/main.c b/c/src/lib/libbsp/shared/main.c index 5a49524cba..f413a0628b 100644 --- a/c/src/lib/libbsp/shared/main.c +++ b/c/src/lib/libbsp/shared/main.c @@ -30,19 +30,6 @@ extern rtems_cpu_table Cpu_table; rtems_interrupt_level bsp_isr_level; -int main(int argc, char **argv) -{ - - if ((argc > 0) && argv && argv[0]) - rtems_progname = argv[0]; - else - rtems_progname = "RTEMS"; - - rtems_initialize_executive_late( bsp_isr_level ); - - return 0; -} - int boot_card(int argc, char **argv) { int status; @@ -104,3 +91,16 @@ int boot_card(int argc, char **argv) return status; } +int main(int argc, char **argv) +{ + + if ((argc > 0) && argv && argv[0]) + rtems_progname = argv[0]; + else + rtems_progname = "RTEMS"; + + rtems_initialize_executive_late( bsp_isr_level ); + + return 0; +} + -- cgit v1.2.3