This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
arm-wince-pe-ld: "bl" addresses off by 8
- From: Craig Vanderborgh <craigv at voxware dot com>
- To: binutils at sources dot redhat dot com
- Date: Wed, 18 Dec 2002 13:54:34 -0700
- Subject: arm-wince-pe-ld: "bl" addresses off by 8
Hello binutils:
I am hard at work trying to get linking for arm-wince-pe to work properly
for wince 3.0. I have a functioning "ld.exe" (i.e. one that creates
.exe's that run in wince 3.0) provided by an external source. My own compile
of the sources produces an ld.exe that links non-functioning binaries, but
seems to work fine otherwise. Both ld's are based on 2.11.2, and I'm going
to try to migrate to the latest binutils as soon as I figure out what's wrong
with my build.
A very careful examination of the discrepancies in output from the two
cases has revealed that there is just one difference: The output from my
new ld.exe has "bl" instruction addresses that are 8 lower than the ones
produced by the older ld.exe.
For example:
OLD ld.exe output:
00011000 <.text>:
11000: 00000000 andeq r0, r0, r0
11004: e92d4800 stmdb sp!, {fp, lr}
11008: e59fb008 ldr fp, [pc, #8] ; 0x11018
1100c: e1a0e00f mov lr, pc
11010: e1a0f00b mov pc, fp
11014: e8bd8800 ldmia sp!, {fp, pc}
11018: 000115e0 andeq r1, r1, r0, ror #11
1101c: e1a0c00d mov ip, sp
11020: e92dd810 stmdb sp!, {r4, fp, ip, lr, pc}
11024: e24cb004 sub fp, ip, #4 ; 0x4
11028: e24dd00c sub sp, sp, #12 ; 0xc
1102c: e50b0014 str r0, [fp, -#20]
11030: e24b301c sub r3, fp, #28 ; 0x1c
11034: e28f102c add r1, pc, #44 ; 0x2c
11038: e8910006 ldmia r1, {r1, r2}
1103c: e8830006 stmia r3, {r1, r2}
11040: e24b301c sub r3, fp, #28 ; 0x1c
11044: e51b0014 ldr r0, [fp, -#20]
11048: e59f1020 ldr r1, [pc, #20] ; 0x11070
1104c: e893000c ldmia r3, {r2, r3}
!! 11050: eb0006a2 bl 0x12ae0
MY ld.exe output:
hello.exe.rkld: file format pei-arm-little
Disassembly of section .text:
00011000 <.text>:
11000: 00000000 andeq r0, r0, r0
11004: e92d4800 stmdb sp!, {fp, lr}
11008: e59fb008 ldr fp, [pc, #8] ; 0x11018
1100c: e1a0e00f mov lr, pc
11010: e1a0f00b mov pc, fp
11014: e8bd8800 ldmia sp!, {fp, pc}
11018: 000115e0 andeq r1, r1, r0, ror #11
1101c: e1a0c00d mov ip, sp
11020: e92dd810 stmdb sp!, {r4, fp, ip, lr, pc}
11024: e24cb004 sub fp, ip, #4 ; 0x4
11028: e24dd00c sub sp, sp, #12 ; 0xc
1102c: e50b0014 str r0, [fp, -#20]
11030: e24b301c sub r3, fp, #28 ; 0x1c
11034: e28f102c add r1, pc, #44 ; 0x2c
11038: e8910006 ldmia r1, {r1, r2}
1103c: e8830006 stmia r3, {r1, r2}
11040: e24b301c sub r3, fp, #28 ; 0x1c
11044: e51b0014 ldr r0, [fp, -#20]
11048: e59f1020 ldr r1, [pc, #20] ; 0x11070
1104c: e893000c ldmia r3, {r2, r3}
!! 11050: eb0006a0 bl 0x12ad8
Literally the only differences in the output .exe's are in the lines that
are marked with "!!". My "bl" addresses are 8 less than the ones produced
by the older (functioning) ld. I believe that this is the cause of my problem
(non-runnable .exe's on wince).
QUESTION:
I'm trying to figure out what I have to change in the (bfd?) sources to correct
this but I am a little lost at the moment. Could someone PLEASE give me a pointer??
Regards,
craig vanderborgh
voxware incorporated
00011000 <.text>:
11000: 00000000 andeq r0, r0, r0
11004: e92d4800 stmdb sp!, {fp, lr}
11008: e59fb008 ldr fp, [pc, #8] ; 0x11018
1100c: e1a0e00f mov lr, pc
11010: e1a0f00b mov pc, fp
11014: e8bd8800 ldmia sp!, {fp, pc}
11018: 000115e0 andeq r1, r1, r0, ror #11
1101c: e1a0c00d mov ip, sp
11020: e92dd810 stmdb sp!, {r4, fp, ip, lr, pc}
11024: e24cb004 sub fp, ip, #4 ; 0x4
11028: e24dd00c sub sp, sp, #12 ; 0xc
1102c: e50b0014 str r0, [fp, -#20]
11030: e24b301c sub r3, fp, #28 ; 0x1c
11034: e28f102c add r1, pc, #44 ; 0x2c
11038: e8910006 ldmia r1, {r1, r2}
1103c: e8830006 stmia r3, {r1, r2}
11040: e24b301c sub r3, fp, #28 ; 0x1c
11044: e51b0014 ldr r0, [fp, -#20]
11048: e59f1020 ldr r1, [pc, #20] ; 0x11070
1104c: e893000c ldmia r3, {r2, r3}
!! 11050: eb0006a0 bl 0x12ad8
Literally the only differences in the output .exe's are that my bl addresses
are 8 less than the ones produced by Rainer's ld. I believe that this
is the cause of my problem (non-runnable .exe's on wince) I'm trying to figure
out what I have to change in the (bfd?) sources to correct this but I am a little
lost at the moment. Could you possibly give me a pointer??
Regards, and best wishes for the holidays,
craig vanderborgh
voxware incorporated