[uClibc]Another small bug in crt0pic.S for ARM

Thuys, Michiel michiel.thuys at intersil.com
Wed Feb 7 09:48:15 UTC 2001


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.

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?

Regards,

Michiel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: crt0pic.patch2
Type: application/octet-stream
Size: 217 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20010207/83c2bf4a/attachment.obj 


More information about the uClibc mailing list