This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PIC and arm/linux-crt0.S


On 6/26/06, Shaun Jackman <sjackman@gmail.com> wrote:
...
Although, with this change the primary purpose of linux-crt0.S would
be to change into thumb mode. I could do instead accomplish this task
in a couple lines of inline assembler and entirely replace
linux-crt0.S with linux-crt0.c.

... something like this.


__attribute__((naked))
void _start(void)
{
	register int *sp asm("sp");
#if __thumb__
	// Switch to thumb mode.
	asm(".code 32\n\tadd r0, pc, #1\n\tbx r0");
#endif
	_main(*sp, (char **)(sp + 1));
}

Perhaps I should wait to I collect all my thoughts in one email before
I start posting. =P

Cheers,
Shaun


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]