SPARC64's crt1.o is wrongly compiled with -fPIC
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cross-toolchain-base-ports (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Ubuntu 22's libc6-dev-
$ sparc64-
$ qemu-sparc64 -L /usr/sparc64-
Hello world
$ sparc64-
$ qemu-sparc64 -L /usr/sparc64-
Illegal instruction (core dumped)
Here is the content of the correct crt1.o file (taken from Debian):
$ sparc64-
/usr/
Disassembly of section .text:
0000000000000000 <_start>:
0: bc 10 00 00 mov %g0, %fp
4: 9c 23 a0 30 sub %sp, 0x30, %sp
8: d2 5b a8 af ldx [ %sp + 0x8af ], %o1
c: 94 03 a8 b7 add %sp, 0x8b7, %o2
10: 11 00 00 00 sethi %hi(0), %o0
14: 17 00 00 00 sethi %hi(0), %o3
18: 19 00 00 00 sethi %hi(0), %o4
1c: 90 12 20 00 mov %o0, %o0
20: 96 12 e0 00 mov %o3, %o3
24: 98 13 20 00 mov %o4, %o4
28: 9a 10 00 01 mov %g1, %o5
2c: 40 00 00 00 call 2c <_start+0x2c>
30: 01 00 00 00 nop
34: 00 00 00 00 illtrap 0
This is a dump of Ubuntu's bad crt1.o file.
$ sparc64-
/usr/
Disassembly of section .text:
0000000000000000 <_start>:
0: 2f 00 00 00 sethi %hi(0), %l7
4: 40 00 00 00 call 4 <_start+0x4>
8: ae 15 e0 00 mov %l7, %l7 ! 0 <_start>
c: bc 10 00 00 mov %g0, %fp
10: 9c 23 a0 30 sub %sp, 0x30, %sp
14: d2 5b a8 af ldx [ %sp + 0x8af ], %o1
18: 94 03 a8 b7 add %sp, 0x8b7, %o2
1c: 11 00 00 00 sethi %hi(0), %o0
20: 90 1a 20 00 xor %o0, 0, %o0
24: d0 5d c0 08 ldx [ %l7 + %o0 ], %o0
28: 96 10 20 00 clr %o3
2c: 98 10 20 00 clr %o4
30: 9a 10 00 01 mov %g1, %o5
34: 40 00 00 00 call 34 <_start+0x34>
38: 01 00 00 00 nop
3c: 00 00 00 00 illtrap 0