1999-08-26 09:30:50 +00:00
|
|
|
|
/* Definitions for Intel 386 running SCO Unix System V 3.2 Version 5.
|
2003-11-07 02:43:04 +00:00
|
|
|
|
Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003
|
2002-02-01 18:16:02 +00:00
|
|
|
|
Free Software Foundation, Inc.
|
2003-11-07 02:43:04 +00:00
|
|
|
|
Contributed by Kean Johnston (jkj@sco.com)
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
2004-07-28 03:11:36 +00:00
|
|
|
|
This file is part of GCC.
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
2004-07-28 03:11:36 +00:00
|
|
|
|
GCC is free software; you can redistribute it and/or modify
|
1999-08-26 09:30:50 +00:00
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
|
any later version.
|
|
|
|
|
|
2004-07-28 03:11:36 +00:00
|
|
|
|
GCC is distributed in the hope that it will be useful,
|
1999-08-26 09:30:50 +00:00
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2004-07-28 03:11:36 +00:00
|
|
|
|
along with GCC; see the file COPYING. If not, write to
|
1999-08-26 09:30:50 +00:00
|
|
|
|
the Free Software Foundation, 59 Temple Place - Suite 330,
|
|
|
|
|
Boston, MA 02111-1307, USA. */
|
|
|
|
|
|
2003-11-07 02:43:04 +00:00
|
|
|
|
#undef TARGET_VERSION
|
1999-08-26 09:30:50 +00:00
|
|
|
|
#define TARGET_VERSION fprintf (stderr, " (i386, SCO OpenServer 5 Syntax)");
|
|
|
|
|
|
2002-02-01 18:16:02 +00:00
|
|
|
|
#undef ASM_QUAD
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
|
|
|
|
#undef GLOBAL_ASM_OP
|
2002-02-01 18:16:02 +00:00
|
|
|
|
#define GLOBAL_ASM_OP "\t.globl\t"
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
|
|
|
|
#undef BSS_SECTION_ASM_OP
|
2003-11-07 02:43:04 +00:00
|
|
|
|
#define BSS_SECTION_ASM_OP "\t.section\t.bss, \"aw\", @nobits"
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* NOTE: We really do want CTORS_SECTION_ASM_OP and DTORS_SECTION_ASM_OP.
|
|
|
|
|
* Here's the reason why. If we dont define them, and we dont define them
|
|
|
|
|
* to always emit to the same section, the default is to emit to "named"
|
|
|
|
|
* ctors and dtors sections. This would be great if we could use GNU ld,
|
|
|
|
|
* but we can't. The native linker could possibly be trained to coalesce
|
|
|
|
|
* named ctors sections, but that hasn't been done either. So if we don't
|
|
|
|
|
* define these, many C++ ctors and dtors dont get run, because they never
|
|
|
|
|
* wind up in the ctors/dtors arrays.
|
|
|
|
|
*/
|
|
|
|
|
#define CTORS_SECTION_ASM_OP "\t.section\t.ctors, \"aw\""
|
|
|
|
|
#define DTORS_SECTION_ASM_OP "\t.section\t.dtors, \"aw\""
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
2003-11-07 02:43:04 +00:00
|
|
|
|
#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
|
|
|
|
|
#undef X86_FILE_START_VERSION_DIRECTIVE
|
|
|
|
|
#define X86_FILE_START_VERSION_DIRECTIVE true
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
|
|
|
|
/* A C statement (sans semicolon) to output to the stdio stream
|
|
|
|
|
FILE the assembler definition of uninitialized global DECL named
|
|
|
|
|
NAME whose size is SIZE bytes and alignment is ALIGN bytes.
|
|
|
|
|
Try to use asm_output_aligned_bss to implement this macro. */
|
|
|
|
|
|
|
|
|
|
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
|
2003-11-07 02:43:04 +00:00
|
|
|
|
asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
|
|
|
|
#undef DBX_REGISTER_NUMBER
|
2003-11-07 02:43:04 +00:00
|
|
|
|
#define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
2003-11-07 02:43:04 +00:00
|
|
|
|
#define DWARF2_DEBUGGING_INFO 1
|
|
|
|
|
#define DBX_DEBUGGING_INFO 1
|
2003-07-11 03:40:53 +00:00
|
|
|
|
|
|
|
|
|
#undef PREFERRED_DEBUGGING_TYPE
|
2003-11-07 02:43:04 +00:00
|
|
|
|
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
|
|
|
|
|
|
|
|
|
|
#undef DWARF2_UNWIND_INFO
|
|
|
|
|
#define DWARF2_UNWIND_INFO 1
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
|
|
|
|
#undef NO_IMPLICIT_EXTERN_C
|
2003-11-07 02:43:04 +00:00
|
|
|
|
#define NO_IMPLICIT_EXTERN_C 1
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
|
|
|
|
#undef SWITCH_TAKES_ARG
|
|
|
|
|
#define SWITCH_TAKES_ARG(CHAR) \
|
|
|
|
|
(DEFAULT_SWITCH_TAKES_ARG(CHAR) \
|
|
|
|
|
|| (CHAR) == 'h' \
|
|
|
|
|
|| (CHAR) == 'R' \
|
|
|
|
|
|| (CHAR) == 'Y' \
|
|
|
|
|
|| (CHAR) == 'z')
|
|
|
|
|
|
|
|
|
|
#undef WORD_SWITCH_TAKES_ARG
|
|
|
|
|
#define WORD_SWITCH_TAKES_ARG(STR) \
|
|
|
|
|
(DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
|
|
|
|
|
&& strcmp (STR, "Tdata") && strcmp (STR, "Ttext") \
|
|
|
|
|
&& strcmp (STR, "Tbss"))
|
|
|
|
|
|
2002-02-01 18:16:02 +00:00
|
|
|
|
#undef TARGET_SUBTARGET_DEFAULT
|
|
|
|
|
#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS)
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Define sizes and types
|
|
|
|
|
*/
|
|
|
|
|
#undef SIZE_TYPE
|
|
|
|
|
#undef PTRDIFF_TYPE
|
|
|
|
|
#undef WCHAR_TYPE
|
|
|
|
|
#undef WCHAR_TYPE_SIZE
|
2003-11-07 02:43:04 +00:00
|
|
|
|
#undef WINT_TYPE
|
1999-08-26 09:30:50 +00:00
|
|
|
|
#undef LONG_DOUBLE_TYPE_SIZE
|
|
|
|
|
#define SIZE_TYPE "unsigned int"
|
|
|
|
|
#define PTRDIFF_TYPE "int"
|
|
|
|
|
#define WCHAR_TYPE "long int"
|
|
|
|
|
#define WCHAR_TYPE_SIZE BITS_PER_WORD
|
2003-11-07 02:43:04 +00:00
|
|
|
|
#define WINT_TYPE "long int"
|
|
|
|
|
#define LONG_DOUBLE_TYPE_SIZE 96
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* New for multilib support. Set the default switches for multilib,
|
|
|
|
|
* which is -melf.
|
|
|
|
|
*/
|
|
|
|
|
#define MULTILIB_DEFAULTS { "melf" }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Please note that these specs may look messy but they are required in
|
|
|
|
|
order to emulate the SCO Development system as closely as possible.
|
|
|
|
|
With SCO Open Server 5.0, you now get the linker and assembler free,
|
|
|
|
|
so that is what these specs are targeted for. These utilities are
|
|
|
|
|
very argument sensitive: a space in the wrong place breaks everything.
|
2003-11-07 02:43:04 +00:00
|
|
|
|
So please forgive this mess. It works.
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
|
|
|
|
Parameters which can be passed to gcc, and their SCO equivalents:
|
|
|
|
|
GCC Parameter SCO Equivalent
|
|
|
|
|
-ansi -a ansi
|
|
|
|
|
-posix -a posix
|
|
|
|
|
-Xpg4 -a xpg4
|
|
|
|
|
-Xpg4plus -a xpg4plus
|
|
|
|
|
-Xods30 -a ods30
|
|
|
|
|
|
|
|
|
|
As with SCO, the default is XPG4 plus mode. SCO also allows you to
|
|
|
|
|
specify a C dialect with -Xt, -Xa, -Xc, -Xk and -Xm. These are passed
|
|
|
|
|
on to the assembler and linker in the same way that the SCO compiler
|
|
|
|
|
does.
|
|
|
|
|
|
|
|
|
|
SCO also allows you to compile, link and generate either ELF or COFF
|
2003-11-07 02:43:04 +00:00
|
|
|
|
binaries. With gcc, we now only support ELF mode.
|
|
|
|
|
|
|
|
|
|
GCC also requires that the user has installed OSS646, the Execution
|
|
|
|
|
Environment Update, or is running release 5.0.7 or later. This has
|
|
|
|
|
many fixes to the ELF link editor and assembler, and a considerably
|
|
|
|
|
improved libc and RTLD.
|
|
|
|
|
|
|
|
|
|
In terms of tool usage, we want to use the standard link editor always,
|
|
|
|
|
and either the GNU assembler or the native assembler. With OSS646 the
|
|
|
|
|
native assembler has grown up quite a bit. Some of the specs below
|
|
|
|
|
assume that /usr/gnu is the prefix for the GNU tools, because thats
|
|
|
|
|
where the SCO provided ones go. This is especially important for
|
|
|
|
|
include and library search path ordering. We want to look in /usr/gnu
|
2004-07-28 03:11:36 +00:00
|
|
|
|
first because frequently people are linking against -lintl, and they
|
2003-11-07 02:43:04 +00:00
|
|
|
|
MEAN to link with gettext. What they get is the SCO intl library. Its
|
|
|
|
|
a REAL pity that GNU gettext chose that name; perhaps in a future
|
|
|
|
|
version they can be persuaded to change it to -lgnuintl and have a
|
|
|
|
|
link so that -lintl will work for other systems. The same goes for
|
|
|
|
|
header files. We want /usr/gnu/include searched for before the system
|
|
|
|
|
header files. Hence the -isystem /usr/gnu/include in the CPP_SPEC.
|
|
|
|
|
We get /usr/gnu/lib first by virtue of the MD_STARTFILE_PREFIX below.
|
1999-08-26 09:30:50 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2003-11-07 02:43:04 +00:00
|
|
|
|
#define MD_STARTFILE_PREFIX "/usr/gnu/lib/"
|
|
|
|
|
#define MD_STARTFILE_PREFIX_1 "/usr/ccs/lib/"
|
|
|
|
|
|
|
|
|
|
#if USE_GAS
|
|
|
|
|
# define MD_EXEC_PREFIX "/usr/gnu/bin/"
|
|
|
|
|
#else
|
|
|
|
|
# define MD_EXEC_PREFIX "/usr/ccs/bin/elf/"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Always use the system linker, please. */
|
|
|
|
|
#ifndef DEFAULT_LINKER
|
|
|
|
|
# define DEFAULT_LINKER "/usr/ccs/bin/elf/ld"
|
|
|
|
|
#endif
|
|
|
|
|
|
1999-08-26 09:30:50 +00:00
|
|
|
|
/* Set up assembler flags for PIC and ELF compilations */
|
|
|
|
|
#undef ASM_SPEC
|
|
|
|
|
|
|
|
|
|
#if USE_GAS
|
2003-11-07 02:43:04 +00:00
|
|
|
|
/* Leave ASM_SPEC undefined so we pick up the master copy from gcc.c */
|
1999-08-26 09:30:50 +00:00
|
|
|
|
#else
|
|
|
|
|
#define ASM_SPEC \
|
2003-11-07 02:43:04 +00:00
|
|
|
|
"%{Ym,*} %{Yd,*} %{Wa,*:%*} \
|
|
|
|
|
-E%{Xa:a}%{!Xa:%{Xc:c}%{!Xc:%{Xk:k}%{!Xk:%{Xt:t}%{!Xt:a}}}},%{ansi:ansi}%{!ansi:%{posix:posix}%{!posix:%{Xpg4:xpg4}%{!Xpg4:%{Xpg4plus:XPG4PLUS}%{!Xpg4plus:%{Xods30:ods30}%{!Xods30:XPG4PLUS}}}}},ELF %{Qn:} %{!Qy:-Qn}"
|
1999-08-26 09:30:50 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2003-11-07 02:43:04 +00:00
|
|
|
|
/*
|
|
|
|
|
* Use crti.o for shared objects, crt1.o for normal executables. Make sure
|
|
|
|
|
* to recognize both -G and -shared as a valid way of introducing shared
|
|
|
|
|
* library generation. This is important for backwards compatibility.
|
|
|
|
|
*/
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
|
|
|
|
#undef STARTFILE_SPEC
|
|
|
|
|
#define STARTFILE_SPEC \
|
2003-11-07 02:43:04 +00:00
|
|
|
|
"%{pg:%e-pg not supported on this platform} \
|
|
|
|
|
%{p:%{pp:%e-p and -pp specified - pick one}} \
|
|
|
|
|
%{!shared:\
|
1999-08-26 09:30:50 +00:00
|
|
|
|
%{!symbolic: \
|
2003-11-07 02:43:04 +00:00
|
|
|
|
%{!G: \
|
|
|
|
|
%{pp:pcrt1elf.o%s}%{p:mcrt1.o%s}%{!p:%{!pp:crt1.o%s}}}}} \
|
|
|
|
|
crti.o%s \
|
1999-08-26 09:30:50 +00:00
|
|
|
|
%{ansi:values-Xc.o%s} \
|
|
|
|
|
%{!ansi: \
|
2003-11-07 02:43:04 +00:00
|
|
|
|
%{traditional:values-Xt.o%s} \
|
|
|
|
|
%{!traditional: \
|
|
|
|
|
%{Xa:values-Xa.o%s} \
|
|
|
|
|
%{!Xa:%{Xc:values-Xc.o%s} \
|
|
|
|
|
%{!Xc:%{Xk:values-Xk.o%s} \
|
|
|
|
|
%{!Xk:%{Xt:values-Xt.o%s} \
|
|
|
|
|
%{!Xt:values-Xa.o%s}}}}}} \
|
|
|
|
|
crtbegin.o%s"
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
|
|
|
|
#undef ENDFILE_SPEC
|
|
|
|
|
#define ENDFILE_SPEC \
|
2003-11-07 02:43:04 +00:00
|
|
|
|
"crtend.o%s crtn.o%s"
|
|
|
|
|
|
|
|
|
|
#define TARGET_OS_CPP_BUILTINS() \
|
|
|
|
|
do \
|
|
|
|
|
{ \
|
|
|
|
|
builtin_define ("__unix"); \
|
|
|
|
|
builtin_define ("_SCO_DS"); \
|
|
|
|
|
builtin_define ("_SCO_DS_LL"); \
|
|
|
|
|
builtin_define ("_SCO_ELF"); \
|
|
|
|
|
builtin_define ("_M_I386"); \
|
|
|
|
|
builtin_define ("_M_XENIX"); \
|
|
|
|
|
builtin_define ("_M_UNIX"); \
|
|
|
|
|
builtin_assert ("system=svr3"); \
|
|
|
|
|
if (flag_iso) \
|
|
|
|
|
cpp_define (pfile, "_STRICT_ANSI"); \
|
|
|
|
|
if (flag_pic) \
|
|
|
|
|
{ \
|
|
|
|
|
builtin_define ("__PIC__"); \
|
|
|
|
|
builtin_define ("__pic__"); \
|
|
|
|
|
} \
|
|
|
|
|
} \
|
2003-07-11 03:40:53 +00:00
|
|
|
|
while (0)
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
|
|
|
|
#undef CPP_SPEC
|
2003-07-11 03:40:53 +00:00
|
|
|
|
#define CPP_SPEC "\
|
2003-11-07 02:43:04 +00:00
|
|
|
|
-isystem /usr/gnu/include \
|
1999-08-26 09:30:50 +00:00
|
|
|
|
%{!Xods30:-D_STRICT_NAMES} \
|
|
|
|
|
%{!ansi:%{!posix:%{!Xods30:-D_SCO_XPG_VERS=4}}} \
|
2003-07-11 03:40:53 +00:00
|
|
|
|
%{ansi:-isystem include/ansi%s -isystem /usr/include/ansi} \
|
1999-08-26 09:30:50 +00:00
|
|
|
|
%{!ansi: \
|
|
|
|
|
%{posix:-isystem include/posix%s -isystem /usr/include/posix \
|
|
|
|
|
-D_POSIX_C_SOURCE=2 -D_POSIX_SOURCE=1} \
|
|
|
|
|
%{!posix:%{Xpg4:-isystem include/xpg4%s -isystem /usr/include/xpg4 \
|
|
|
|
|
-D_XOPEN_SOURCE=1} \
|
|
|
|
|
%{!Xpg4:-D_M_I86 -D_M_I86SM -D_M_INTERNAT -D_M_SDATA -D_M_STEXT \
|
|
|
|
|
-D_M_BITFIELDS -D_M_SYS5 -D_M_SYSV -D_M_SYSIII \
|
|
|
|
|
-D_M_WORDSWAP -Dunix -DM_I386 -DM_UNIX -DM_XENIX \
|
|
|
|
|
%{Xods30:-isystem include/ods_30_compat%s \
|
|
|
|
|
-isystem /usr/include/ods_30_compat \
|
|
|
|
|
-D_SCO_ODS_30 -DM_I86 -DM_I86SM -DM_SDATA -DM_STEXT \
|
|
|
|
|
-DM_BITFIELDS -DM_SYS5 -DM_SYSV -DM_INTERNAT -DM_SYSIII \
|
|
|
|
|
-DM_WORDSWAP}}}} \
|
|
|
|
|
%{scointl:-DM_INTERNAT -D_M_INTERNAT} \
|
|
|
|
|
%{Xa:-D_SCO_C_DIALECT=1} \
|
|
|
|
|
%{!Xa:%{Xc:-D_SCO_C_DIALECT=3} \
|
|
|
|
|
%{!Xc:%{Xk:-D_SCO_C_DIALECT=4} \
|
|
|
|
|
%{!Xk:%{Xt:-D_SCO_C_DIALECT=2} \
|
2003-07-11 03:40:53 +00:00
|
|
|
|
%{!Xt:-D_SCO_C_DIALECT=1}}}}"
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
|
|
|
|
#undef LINK_SPEC
|
|
|
|
|
#define LINK_SPEC \
|
2003-11-07 02:43:04 +00:00
|
|
|
|
"%{!shared:%{!symbolic:%{!G:-E%{Xa:a}%{!Xa:%{Xc:c}%{!Xc:%{Xk:k}%{!Xk:%{Xt:t}%{!Xt:a}}}},%{ansi:ansi}%{!ansi:%{posix:posix}%{!posix:%{Xpg4:xpg4}%{!Xpg4:%{Xpg4plus:XPG4PLUS}%{!Xpg4plus:%{Xods30:ods30}%{!Xods30:XPG4PLUS}}}}},ELF}}} \
|
|
|
|
|
%{Wl,*:%*} %{YP,*} %{YL,*} %{YU,*} \
|
1999-08-26 09:30:50 +00:00
|
|
|
|
%{!YP,*:%{p:-YP,/usr/ccs/libp:/lib/libp:/usr/lib/libp:/usr/ccs/lib:/lib:/usr/lib} \
|
|
|
|
|
%{!p:-YP,/usr/ccs/lib:/lib:/usr/lib}} \
|
2003-11-07 02:43:04 +00:00
|
|
|
|
%{h*} %{static:-dn -Bstatic %{G:%e-G and -static are mutually exclusive}} \
|
|
|
|
|
%{shared:%{!G:-G}} %{G:%{!shared:-G}} %{shared:%{G:-G}} \
|
|
|
|
|
%{shared:-dy %{symbolic:-Bsymbolic -G} %{z*}} %{R*} %{Y*} \
|
|
|
|
|
%{Qn:} %{!Qy:-Qn} -z alt_resolve"
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
|
|
|
|
/* Library spec. If we are not building a shared library, provide the
|
|
|
|
|
standard libraries, as per the SCO compiler. */
|
|
|
|
|
|
|
|
|
|
#undef LIB_SPEC
|
|
|
|
|
#define LIB_SPEC \
|
2003-11-07 02:43:04 +00:00
|
|
|
|
"%{shared:%{!G:pic/libgcc.a%s}} \
|
|
|
|
|
%{G:%{!shared:pic/libgcc.a%s}} \
|
|
|
|
|
%{shared:%{G:pic/libgcc.a%s}} \
|
|
|
|
|
%{p:%{!pp:-lelfprof -lelf}} %{pp:%{!p:-lelfprof -lelf}} \
|
2004-07-28 03:11:36 +00:00
|
|
|
|
%{!shared:%{!symbolic:%{!G:-lcrypt -lgen -lc}}}"
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
|
|
|
|
#undef LIBGCC_SPEC
|
|
|
|
|
#define LIBGCC_SPEC \
|
2003-11-07 02:43:04 +00:00
|
|
|
|
"%{!shared:%{!G:-lgcc}}"
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
2003-11-07 02:43:04 +00:00
|
|
|
|
/* Here for legacy support only so we still accept -melf flag */
|
|
|
|
|
#define MASK_COFF 010000000000 /* Mask for COFF generation */
|
|
|
|
|
#define TARGET_ELF (1)
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
|
|
|
|
#undef SUBTARGET_SWITCHES
|
2002-02-01 18:16:02 +00:00
|
|
|
|
#define SUBTARGET_SWITCHES \
|
|
|
|
|
{ "elf", -MASK_COFF, N_("Generate ELF output") },
|
1999-08-26 09:30:50 +00:00
|
|
|
|
|
2002-02-01 18:16:02 +00:00
|
|
|
|
/* Handle special EH pointer encodings. Absolute, pc-relative, and
|
|
|
|
|
indirect are handled automatically. */
|
|
|
|
|
#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
|
|
|
|
|
do { \
|
|
|
|
|
if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_datarel) \
|
|
|
|
|
{ \
|
|
|
|
|
fputs (ASM_LONG, FILE); \
|
|
|
|
|
assemble_name (FILE, XSTR (ADDR, 0)); \
|
|
|
|
|
fputs (((ENCODING) & DW_EH_PE_indirect ? "@GOT" : "@GOTOFF"), FILE); \
|
|
|
|
|
goto DONE; \
|
|
|
|
|
} \
|
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
|
|
/* Used by crtstuff.c to initialize the base of data-relative relocations.
|
|
|
|
|
These are GOT relative on x86, so return the pic register. */
|
|
|
|
|
#ifdef __PIC__
|
|
|
|
|
#define CRT_GET_RFIB_DATA(BASE) \
|
|
|
|
|
{ \
|
|
|
|
|
register void *ebx_ __asm__("ebx"); \
|
|
|
|
|
BASE = ebx_; \
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
#define CRT_GET_RFIB_DATA(BASE) \
|
|
|
|
|
__asm__ ("call\t.LPR%=\n" \
|
|
|
|
|
".LPR%=:\n\t" \
|
|
|
|
|
"popl\t%0\n\t" \
|
|
|
|
|
/* Due to a GAS bug, this cannot use EAX. That encodes \
|
|
|
|
|
smaller than the traditional EBX, which results in the \
|
|
|
|
|
offset being off by one. */ \
|
|
|
|
|
"addl\t$_GLOBAL_OFFSET_TABLE_+[.-.LPR%=],%0" \
|
|
|
|
|
: "=d"(BASE))
|
|
|
|
|
#endif
|
|
|
|
|
|