mirror of
git://git.musl-libc.org/musl
synced 2024-12-17 04:05:05 +00:00
611eabd489
Applications ended up with copy relocations for this array, which resulted in libc's references to this array pointing to the application's copy. The dynamic linker, however, can require this array before the application is relocated, and therefore before the application's copy of this array is initialized. This resulted in garbage being loaded into FPSCR before executing main, which violated the ABI. We fix this by putting the array in crt1 and making the libc copy private. This prevents libc's reference to the array from pointing to an uninitialized copy in the application.
13 lines
258 B
C
13 lines
258 B
C
__asm__("\
|
|
.global _start \n\
|
|
_start: \n\
|
|
mov r15, r4 \n\
|
|
mov #-16, r0 \n\
|
|
and r0, r15 \n\
|
|
bsr __cstart \n\
|
|
nop \n\
|
|
");
|
|
|
|
/* used by gcc for switching the FPU between single and double precision */
|
|
const unsigned long __fpscr_values[2] = { 0, 0x80000 };
|