superh: fix dynamic linking of __fpscr_values
authorBobby Bingham <koorogi@koorogi.info>
Sun, 16 Mar 2014 21:17:28 +0000 (16:17 -0500)
committerBobby Bingham <koorogi@koorogi.info>
Sun, 16 Mar 2014 21:17:28 +0000 (16:17 -0500)
commit611eabd489ce4eab3a70c410f363774bbcbbd3e9
treed98e2665a754e93077c537d9263e927a44b7aee7
parent2b47a7aff24bbfbe7ba89fc6d542acc9f5493ae2
superh: fix dynamic linking of __fpscr_values

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.
arch/sh/crt_arch.h
arch/sh/src/__fpsrc_values.c