1 /* Definitions for ia64-linux target. */
3 /* This macro is a C statement to print on `stderr' a string describing the
4 particular machine description choice. */
6 #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
8 /* This is for -profile to use -lc_p instead of -lc. */
10 #define CC1_SPEC "%{profile:-p} %{G*}"
12 /* ??? Maybe this should be in sysv4.h? */
13 #define CPP_PREDEFINES "\
14 -D__ia64 -D__ia64__ -D__linux -D__linux__ -D_LONGLONG -Dlinux -Dunix \
15 -D__LP64__ -D__ELF__ -Asystem=linux -Acpu=ia64 -Amachine=ia64"
17 /* ??? ia64 gas doesn't accept standard svr4 assembler options? */
19 #define ASM_SPEC "-x %{mconstant-gp} %{mauto-pic}"
21 /* Need to override linux.h STARTFILE_SPEC, since it has crtbeginT.o in. */
23 #define STARTFILE_SPEC \
25 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
26 %{!p:%{profile:gcrt1.o%s} \
27 %{!profile:crt1.o%s}}}} \
28 crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
30 /* Similar to standard Linux, but adding -ffast-math support. */
32 #define ENDFILE_SPEC \
33 "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
34 %{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
36 /* Define this for shared library support because it isn't in the main
44 %{rdynamic:-export-dynamic} \
45 %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \
49 #define DONT_USE_BUILTIN_SETJMP
50 #define JMP_BUF_SIZE 76
52 /* Output any profiling code before the prologue. */
54 #undef PROFILE_BEFORE_PROLOGUE
55 #define PROFILE_BEFORE_PROLOGUE 1
57 /* Override linux.h LINK_EH_SPEC definition.
58 Signalize that because we have fde-glibc, we don't need all C shared libs
59 linked against -lgcc_s. */
61 #define LINK_EH_SPEC ""
63 /* Do code reading to identify a signal frame, and set the frame
64 state data appropriately. See unwind-dw2.c for the structs. */
68 #include <sys/ucontext.h>
70 #define IA64_GATE_AREA_START 0xa000000000000100LL
71 #define IA64_GATE_AREA_END 0xa000000000010000LL
73 #define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
74 if ((CONTEXT)->rp >= IA64_GATE_AREA_START \
75 && (CONTEXT)->rp < IA64_GATE_AREA_END) \
79 unsigned long sig_number; \
80 struct siginfo *info; \
81 struct sigcontext *sc; \
82 } *frame_ = (struct sigframe *)(CONTEXT)->psp; \
83 struct sigcontext *sc_ = frame_->sc; \
85 /* Restore scratch registers in case the unwinder needs to \
86 refer to a value stored in one of them. */ \
90 for (i_ = 2; i_ < 4; i_++) \
91 (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \
92 for (i_ = 8; i_ < 12; i_++) \
93 (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \
94 for (i_ = 14; i_ < 32; i_++) \
95 (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \
98 (CONTEXT)->pfs_loc = &(sc_->sc_ar_pfs); \
99 (CONTEXT)->lc_loc = &(sc_->sc_ar_lc); \
100 (CONTEXT)->unat_loc = &(sc_->sc_ar_unat); \
101 (CONTEXT)->pr = sc_->sc_pr; \
102 (CONTEXT)->psp = sc_->sc_gr[12]; \
104 /* Don't touch the branch registers. The kernel doesn't \
105 pass the preserved branch registers in the sigcontext but \
106 leaves them intact, so there's no need to do anything \
110 unsigned long sof = sc_->sc_cfm & 0x7f; \
111 (CONTEXT)->bsp = (unsigned long) \
112 ia64_rse_skip_regs ((unsigned long *)(sc_->sc_ar_bsp), -sof); \
115 (FS)->curr.reg[UNW_REG_RP].where = UNW_WHERE_SPREL; \
116 (FS)->curr.reg[UNW_REG_RP].val \
117 = (unsigned long)&(sc_->sc_ip) - (CONTEXT)->psp; \
118 (FS)->curr.reg[UNW_REG_RP].when = -1; \
122 #endif /* IN_LIBGCC2 */