3 # This is Solaris x86 specific GCC run-time environment patch, which
4 # makes it possible to reliably deploy .init snippets. Trouble is that
5 # Solaris linker erroneously pads .init segment with zeros [instead of
6 # nops], which is bound to SEGV early upon program start-up. This bug
7 # was recognized by GCC team [it is mentioned in source code], but
8 # workaround apparently and obviously erroneously slipped away in some
9 # newer GCC release. This patch compensates for this mishap by dropping
10 # modified values-X*.o into GCC installation tree. Object modules in
11 # question are normally provided by Sun and linked prior crtbegin.o.
12 # Modified versions are additionally crafted with custom .init segment,
13 # which does some magic:-)
14 # <appro@fy.chalmers.se>
17 if [[ "x$1" = x
*gcc
]]; then
20 gcc_dir
=`$
{gcc
} "$@" -print
-libgcc
-file
-name`
21 gcc_dir
=$
{gcc_dir
%/*} #*/
23 $
{gcc
} "$@" -c
-o $gcc_dir
/values
-Xa
.o
-DXa $
0
24 $
{gcc
} "$@" -c
-o $gcc_dir
/values
-Xc
.o
-DXc $
0
25 $
{gcc
} "$@" -c
-o $gcc_dir
/values
-Xt
.o
-DXt $
0
32 const enum version _lib_version
= ansi_1
;
34 const enum version _lib_version
= strict_ansi
;
36 const enum version _lib_version
= c_issue_4
;
38 #error "compile by issuing 'ksh -f values.c [gcc] [-m64]'"
41 #if defined(__x86_64__)
45 " leaq 1f(%rip),%rax\n"
46 "1: cmpl $0,2f-1b(%rax)\n"
49 " .skip 9\n" /* pad up to 0x1b bytes */
58 " cmpl $0,2f-1b(%eax)\n"
61 " .skip 10\n" /* pad up to 0x1b bytes */