[uClibc]Another small bug in crt0pic.S for ARM
Erik Andersen
andersen at lineo.com
Wed Feb 7 18:27:19 UTC 2001
On Wed Feb 07, 2001 at 04:48:15AM -0500, Thuys, Michiel wrote:
> Hi all,
>
> I discovered another small bug in the PIC startupcode for ARM
> (sysdeps/linux/arm/crt0pic.S). Currently, the function 'void_void_null_func' is
> implemented like this:
>
> _void_void_null_func:
> nop
>
> This means that if it is called, it will execute a 'nop' but will never return.
> In my setup, the program code immediately follows the startup code in memory, so
> when '_void_void_null_func' is called, the main program is executed. The correct
> implementation should be:
>
> _void_void_null_func:
> mov pc, lr
>
> I appended a patch to correct this.
Ahh, yes. I was doing some testing on my NetWinder yesterday evening
and noticed the same problem.
> Another thing that doesn't work correctly for us is the Makefile in this
> directory. It determines if it has to compile the PIC startup code by executing
> the command:
>
> TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine)
>
> if TARGET_MACHINE_TYPE equals 'arm-pic-elf' then the PIC code is compiled. Our
> compiler, however, (Aplio version) returns 'arm-uclinux' although it _does_
> generate PIC. This leads to using the wrong startup code.
>
> I'm not sure how this is best fixed. Maybe it should be a Config option. Does
> anyone have a good idea?
Hmm. Yes, I suppose that is probably the best way to do it (or we could
just convince everyone to use the same format for crosscompile naming ;-)
-Erik
--
Erik B. Andersen email: andersen at lineo.com
--This message was written using 73% post-consumer electrons--
More information about the uClibc
mailing list