This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Tidy up arm-elf header files (v4)
- To: Rod Stewart <stewart at lab43 dot org>
- Subject: Re: Tidy up arm-elf header files (v4)
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- Date: 11 Sep 2001 23:00:43 +0100
- Cc: <gcc-patches at gcc dot gnu dot org>
- References: <Pine.LNX.4.33.0109111409290.16126-100000@dystopia.lab43.org>
Hi Rod,
> BTW, the second attachment you sent was empty..
Hmm, strange - I wonder what I did wrong. Oh well, here it is again.
> > * crti.asm: New file.
> > * crtn.asm: New file.
>
> I take it these two files go in config/arm? That's where I put them.
Yes - sorry.
Cheers
Nick
cvs [server aborted]: no such directory `newlib/libc/sys/arm'
Index: newlib/libc/sys/arm/crt0.S
===================================================================
RCS file: /cvs/cvsfiles/devo/newlib/libc/sys/arm/crt0.S,v
retrieving revision 1.19
diff -p -r1.19 crt0.S
*** crt0.S 2000/06/28 18:15:21 1.19
--- crt0.S 2001/09/11 22:00:47
*************** __change_mode:
*** 181,192 ****
#endif
#endif
bl FUNCTION (main)
! bl FUNCTION (exit) /* Should not return */
#ifdef __thumb__
! /* Come out of Thumb mode... This code should be redundant... */
mov a4, pc
bx a4
--- 181,203 ----
#endif
#endif
+
+ #ifdef __USES_INITFINI__
+ /* Some arm/elf targets use the .init and .fini sections
+ to create constructors and destructors, and for these
+ targets we need to call the _init function and arrange
+ for _fini to be called at program exit. */
+ bl FUNCTION (_init)
+ ldr r0, .Lfini
+ bl FUNCTION (atexit)
+ #endif
+
bl FUNCTION (main)
! bl FUNCTION (exit) /* Should not return. */
#ifdef __thumb__
! /* Come out of Thumb mode. This code should be redundant. */
mov a4, pc
bx a4
*************** __change_mode:
*** 195,210 ****
.global change_back
change_back:
/* Halt the execution. This code should never be executed. */
! /*
! ** With no debug monitor, this probably aborts (eventually).
! ** With a Demon debug monitor, this halts cleanly.
! ** With an Angel debug monitor, this will report 'Unknown SWI'.
! */
swi SWI_Exit
#endif
/* For Thumb, constants must be after the code since only
! positive offsets are supported for PC relative addresses. */
.align 0
.LC0:
--- 206,219 ----
.global change_back
change_back:
/* Halt the execution. This code should never be executed. */
! /* With no debug monitor, this probably aborts (eventually).
! With a Demon debug monitor, this halts cleanly.
! With an Angel debug monitor, this will report 'Unknown SWI'. */
swi SWI_Exit
#endif
/* For Thumb, constants must be after the code since only
! positive offsets are supported for PC relative addresses. */
.align 0
.LC0:
*************** change_back:
*** 215,221 ****
#ifdef __pe__
.word 0x800000
#else
! /* .word 0x80000 */ /* Top of RAM on the PIE board */
#endif
#endif
#endif
--- 224,230 ----
#ifdef __pe__
.word 0x800000
#else
! /* .word 0x80000 */ /* Top of RAM on the PIE board. */
#endif
#endif
#endif
*************** change_back:
*** 223,245 ****
.word __bss_start__
.LC2:
.word __bss_end__
!
#ifdef ARM_RDI_MONITOR
! .LC30: .word CommandLine
.word 255
! /* Workspace for Angel calls. */
.data
! /* Data returned by monitor SWI */
HeapBase: .word 0
HeapLimit: .word 0
StackBase: .word 0
StackLimit: .word 0
! CommandLine: .space 256,0 /* Maximum length of 255 chars handled */
#endif
#ifdef __pe__
.section .idata$3
.long 0,0,0,0,0,0,0,0
#endif
-
--- 232,257 ----
.word __bss_start__
.LC2:
.word __bss_end__
! #ifdef __USES_INITFINI__
! .Lfini:
! .word FUNCTION(_fini)
! #endif
#ifdef ARM_RDI_MONITOR
! .LC30:
! .word CommandLine
.word 255
! /* Workspace for Angel calls. */
.data
! /* Data returned by monitor SWI. */
HeapBase: .word 0
HeapLimit: .word 0
StackBase: .word 0
StackLimit: .word 0
! CommandLine: .space 256,0 /* Maximum length of 255 chars handled. */
#endif
#ifdef __pe__
.section .idata$3
.long 0,0,0,0,0,0,0,0
#endif