xscale uclibc softfloat & gdb : SIGILL
Eric BENARD / Free
ebenard at free.fr
Thu Sep 29 08:13:53 UTC 2005
Le Jeudi 29 Septembre 2005 02:16, John Bowler a écrit :
> From: Mike Frysinger [mailto:vapier at gentoo.org]
>
> >i'm not arm expert, so can someone comment on the 2nd line which John
>
> points
>
> >out ? the 'mov lr, #0'
>
> It's harmless unless gdb expects something very specific in the first two
> instructions of _start. The lr value has no significance to the ARM (or to
> Thumb code for that matter) other than the fact that it is automatically
> stored by a bl instruction.
>
It seems gdb expects a very specific code in the start of functions.
If you look at arm_skip_prologue in gdb/arm-tdep.c, you will find that the
expected instructions of the prologue of a function are hardcoded here and
that mov lr, #0
in gdb/arm-tdep.c we can find in several comments :
**
The APCS (ARM Procedure Call Standard) defines the following
prologue:
mov ip, sp
[stmfd sp!, {a1,a2,a3,a4}]
stmfd sp!, {...,fp,ip,lr,pc}
[stfe f7, [sp, #-12]!]
[stfe f6, [sp, #-12]!]
[stfe f5, [sp, #-12]!]
[stfe f4, [sp, #-12]!]
sub fp, ip, #nn @@ nn == 20 or 4 depending on second insn */
**
There are two basic forms for the ARM prologue. The fixed argument
function call will look like:
mov ip, sp
stmfd sp!, {fp, ip, lr, pc}
sub fp, ip, #4
[sub sp, sp, #4]
**
A variable argument function call will look like:
mov ip, sp
stmfd sp!, {a1, a2, a3, a4}
stmfd sp!, {fp, ip, lr, pc}
sub fp, ip, #20
I'll try to investigate more on the gdb side this afternoon.
Eric
More information about the uClibc
mailing list