Hello,

I would like to generate a PNO with PODS. It works pretty well but I
have an issue in the following case that I couldn't understand.

I would like to do the following call: 
FrmCustomAlert(1000, p, 0, 0)

So I use the macros that have been published in this newsgroup, like
this:
    PACE_PARAMS_INIT()
    PACE_PARAMS_ADD16(1000)
    PACE_PARAMS_ADD32(p)
    PACE_PARAMS_ADD32(0)
    PACE_PARAMS_ADD32(0)
    PACE_PARAMS_DONE()
    PACE_EXEC(sysTrapFrmCustomAlert, kPceNativeWantA0)


First I got link errors

palink: error: (LINK0033) undefined symbol: (from
DebugDevice/NativeCode/PNOMain.o) memmove
palink: error: (LINK0033) undefined symbol: (from eabi_memops.o in
f:/program files/pods/palmostools/lib/pa_support_pure4T_SF.a) memmove
palink: error: (LINK0033) undefined symbol: (from
DebugDevice/NativeCode/PNOMain.o) memset
palink: error: (LINK0033) undefined symbol: (from eabi_memops.o in
f:/program files/pods/palmostools/lib/pa_support_pure4T_SF.a) memset
palink: error: (LINK0033) undefined symbol: (from
DebugDevice/NativeCode/PNOMain.o) memcpy
palink: error: (LINK0033) undefined symbol: (from eabi_memops.o in
f:/program files/pods/palmostools/lib/pa_support_pure4T_SF.a) memcpy

I guess "pa_support_pure4T_SF.a" is the pacc compiler helper lib. Which
library defining the 3 "memxxx" functions should I add to link
successfully, I couldn't find any convenient libc for ARM in PODS ?

I installed the cygwin "prc-tools-arm" package that has not been
installed by PODS and tried to use the arm "libc.a" 
library and could successfully call all C library functions including
the 3 mentionned above. But I experience a crash now. 
I looked at both the assembler code and the ARM disassemble in the POD
debugger and saw a bad memory access. Indeed, [pc,#0xa8] contains
0x800004B0 which is a quite large offset, r10's value is so r1 will be
0x8 which is a wrong address.

In the assembler code I saw several things I wonder about.

1) A first initialized data offset is initialized with
        .pcword RDATA.+224
where as the second one with 0x800004B0 is defined with
        .sbword DATA.
does 's' mean signed?

2) I saw a "-XYpicreg=r10" option in the pacfe.exe running, I couldn't
find any information about this tool and it's options
;Options: -XYO1g,retpts1sinllev0 -XYpicreg=r10 -XYaddr=pic
-XYlinkfpemu=1 -XYtarget=pno -O0 -Xdiag1 And can see a
"_SetR10ToThisPointer" function generated in my PNO code. May r10 be
corrupted explaining this wrong address access?

Here is the instructions generated by the PACE_PARAMS/PACE_EXEC macros,
and the issue occurs at pc 0x00210404-0x00210408

; copy the bss area "0x03 0xe8 (=1000) and 3x4 zeros (=p 0 0) to the
array on the stack 
0x00210400:  0xe28d003c  add r0,sp,#0x3c                    ; r0 is the
"params" array on the stack
0x00210404:  0xe59f10a8  ldr r1,[pc,#0xa8]         ; 0x002104b4 
0x00210408:  0xe08a1001  add r1,r10,r1              ; r1 should be the
initialized data address
0x0021040c:  0xe3a0200e  mov r2,#0xe                ; 14 bytes to copy
0x00210410:  0xeb0000b3  bl *+0x2d4                ; 0x002106e4 is
"__aeabi_memcpy" (uses libc's memcpy)

; set p in the array on the stack
0x00210414:  0xe59d000c  ldr r0,[sp,#0xc] 
0x00210418:  0xe1a00c20  mov r0,r0,lsr #24      ; p >> 24
0x0021041c:  0xe20000ff  and r0,r0,#0xff                ; &FF
0x00210420:  0xe5cd003e  strb r0,[sp,#0x3e] 
0x00210424:  0xe59d000c  ldr r0,[sp,#0xc] 
0x00210428:  0xe1a00820  mov r0,r0,lsr #16      ; p >> 16
0x0021042c:  0xe20000ff  and r0,r0,#0xff                ; &FF
0x00210430:  0xe5cd003f  strb r0,[sp,#0x3f] 
0x00210434:  0xe59d000c  ldr r0,[sp,#0xc] 
0x00210438:  0xe1a00420  mov r0,r0,lsr #8       ; p >> 8
0x0021043c:  0xe20000ff  and r0,r0,#0xff                ; &FF
0x00210440:  0xe5cd0040  strb r0,[sp,#0x40] 
0x00210444:  0xe59d000c  ldr r0,[sp,#0xc]               
0x00210448:  0xe20000ff  and r0,r0,#0xff                ; &FF
0x0021044c:  0xe5cd0041  strb r0,[sp,#0x41] 
    
    
Many thanks in advance for any answer or hint.

Best regards,
Frank



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to