This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
arm-wince-pe: C++ gas code generation problem
- From: Craig Vanderborgh <craigv at voxware dot com>
- To: binutils at sources dot redhat dot com
- Date: Tue, 21 Jan 2003 12:33:27 -0700
- Subject: arm-wince-pe: C++ gas code generation problem
Hello binutils,
I am having a code generation problem with GNU as 2.13.90 on arm-wince-pe.
Oddly the problem only seems to affect C++ DLL's. My build of GNU as v2.11.2
seems to produce correct (i.e. functional code) with all other compiler
passes (except as) from my gcc-3.2/binutils-2.13.90 build. That is, in
what is shown below, the only difference for the build that works is that
GNU as-2.11.90 is substituted for GNU as-2.13.90 when testdll.ii is assembled.
I have enclosed the source of the small test case, the assembler output
from binutils-2.11.2 and 2.13.90, and the differences, respectively.
I am looking for some ideas on where to look for the code generation problem
so that I can correct my 2.13.90 sources. I would appreciate any guidance
the experts might be able to give us.
tia,
craig vanderborgh
voxware incorporated
--- TEST CASE SOURCE ---
#include <windows.h>
typedef int size_t;
#include <stdio.h>
#undef UNDER_CE
class A {
public:
A();
int n1;
int f1();
};
A::A()
{
n1 = 23;
}
int
A::f1()
{
return n1;
}
extern "C" {
#if defined(UNDER_CE)
__declspec(dllexport)
#endif
void DLL_hello()
{
FILE *fp = fopen("/temp/foo", "wb");
fprintf(fp, "Hello World, from JNI on GNUWINCE (C++)!\n");
A *pa = new A;
fprintf(fp, "Constructor DONE\n");
int n1;
n1 = pa->f1();
fprintf(fp, "n1 %d\n", n1);
delete pa;
fprintf(fp, "TEST SUCCESSFUL\n");
fclose(fp);
}
#if defined(UNDER_CE)
__declspec(dllexport)
#endif
void _DLL_hello() { DLL_hello(); }
}
--- ASSEMBLER OUTPUT (objdump -D) FROM AS 2.11.2 ---
testdll.o: file format pe-arm-little
Disassembly of section .rdata:
00000000 <LC0>:
0: 6d65742f cfstrdvs mvd7, [r5, -#188]!
4: 6f662f70 swivs 0x00662f70
8: 0000006f andeq r0, r0, pc, rrx
0000000c <LC1>:
c: 00006277 andeq r6, r0, r7, ror r2
00000010 <LC2>:
10: 6c6c6548 cfstr64vs mvdx6, [ip], -#288
14: 6f57206f swivs 0x0057206f
18: 2c646c72 stccsl 12, cr6, [r4], -#456
1c: 6f726620 swivs 0x00726620
20: 4e4a206d cdpmi 0, 4, cr2, cr10, cr13, {3}
24: 6e6f2049 cdpvs 0, 6, cr2, cr15, cr9, {2}
28: 554e4720 strplb r4, [lr, -#1824]
2c: 434e4957 cmpmi lr, #1425408 ; 0x15c000
30: 43282045 teqmi r8, #69 ; 0x45
34: 21292b2b teqcs r9, fp, lsr #22
38: 0000000a andeq r0, r0, sl
0000003c <LC3>:
3c: 736e6f43 cmnvc lr, #268 ; 0x10c
40: 63757274 cmnvs r5, #1073741831 ; 0x40000007
44: 20726f74 rsbcss r6, r2, r4, ror pc
48: 454e4f44 strmib r4, [lr, -#3908]
4c: 0000000a andeq r0, r0, sl
00000050 <LC4>:
50: 2520316e strcs r3, [r0, -#366]!
54: 00000a64 andeq r0, r0, r4, ror #20
00000058 <LC5>:
58: 54534554 ldrplb r4, [r3], -#1364
5c: 43555320 cmpmi r5, #-2147483648 ; 0x80000000
60: 53534543 cmppl r3, #281018368 ; 0x10c00000
64: 0a4c5546 beq 1315584 <__DLL_hello+0x1315450>
68: 00000000 andeq r0, r0, r0
--- ASSEMBLER OUTPUT (objdump -D) FROM AS 2.13.90 ---
testdll.o: file format pe-arm-little
Disassembly of section .rdata:
00000000 <LC0>:
0: 6d65742f cfstrdvs mvd7, [r5, -#188]!
4: 6f662f70 swivs 0x00662f70
8: 0000006f andeq r0, r0, pc, rrx
0000000c <LC1>:
c: 00006277 andeq r6, r0, r7, ror r2
00000010 <LC2>:
10: 6c6c6548 cfstr64vs mvdx6, [ip], -#288
14: 6f57206f swivs 0x0057206f
18: 2c646c72 stccsl 12, cr6, [r4], -#456
1c: 6f726620 swivs 0x00726620
20: 4e4a206d cdpmi 0, 4, cr2, cr10, cr13, {3}
24: 6e6f2049 cdpvs 0, 6, cr2, cr15, cr9, {2}
28: 554e4720 strplb r4, [lr, -#1824]
2c: 434e4957 cmpmi lr, #1425408 ; 0x15c000
30: 43282045 teqmi r8, #69 ; 0x45
34: 21292b2b teqcs r9, fp, lsr #22
38: 0000000a andeq r0, r0, sl
0000003c <LC3>:
3c: 736e6f43 cmnvc lr, #268 ; 0x10c
40: 63757274 cmnvs r5, #1073741831 ; 0x40000007
44: 20726f74 rsbcss r6, r2, r4, ror pc
48: 454e4f44 strmib r4, [lr, -#3908]
4c: 0000000a andeq r0, r0, sl
00000050 <LC4>:
50: 2520316e strcs r3, [r0, -#366]!
54: 00000a64 andeq r0, r0, r4, ror #20
00000058 <LC5>:
58: 54534554 ldrplb r4, [r3], -#1364
5c: 43555320 cmpmi r5, #-2147483648 ; 0x80000000
60: 53534543 cmppl r3, #281018368 ; 0x10c00000
64: 0a4c5546 beq 1315584 <Letext+0x131543c>
68: 00000000 andeq r0, r0, r0
--- DIFFS (diff 2.11.2 2.13.90) ---
42c42
< 64: 0a4c5546 beq 1315584 <__DLL_hello+0x1315450>
---
> 64: 0a4c5546 beq 1315584 <Letext+0x131543c>