OSDN Git Service

* config/ia64/ia64.c (ia64_function_arg_pass_by_reference): New.
[pf3gnuchains/gcc-fork.git] / gcc / config / ia64 / linux.h
1 /* Definitions for ia64-linux target.  */
2
3 /* This macro is a C statement to print on `stderr' a string describing the
4    particular machine description choice.  */
5
6 #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
7
8 /* This is for -profile to use -lc_p instead of -lc.  */
9 #undef CC1_SPEC
10 #define CC1_SPEC "%{profile:-p} %{G*}"
11
12 /* ??? Maybe this should be in sysv4.h?  */
13 #define CPP_PREDEFINES "\
14   -D__gnu_linux__ -D__linux -D__linux__ -D_LONGLONG \
15   -Dlinux -Dunix -Asystem=linux"
16
17 /* Need to override linux.h STARTFILE_SPEC, since it has crtbeginT.o in.  */
18 #undef STARTFILE_SPEC
19 #define STARTFILE_SPEC \
20   "%{!shared: \
21      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
22                        %{!p:%{profile:gcrt1.o%s} \
23                          %{!profile:crt1.o%s}}}} \
24    crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
25
26 /* Similar to standard Linux, but adding -ffast-math support.  */
27 #undef  ENDFILE_SPEC
28 #define ENDFILE_SPEC \
29   "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
30    %{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
31
32 /* Define this for shared library support because it isn't in the main
33    linux.h file.  */
34
35 #undef LINK_SPEC
36 #define LINK_SPEC "\
37   %{shared:-shared} \
38   %{!shared: \
39     %{!static: \
40       %{rdynamic:-export-dynamic} \
41       %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \
42       %{static:-static}}"
43
44
45 #define JMP_BUF_SIZE  76
46
47 /* Override linux.h LINK_EH_SPEC definition.
48    Signalize that because we have fde-glibc, we don't need all C shared libs
49    linked against -lgcc_s.  */
50 #undef LINK_EH_SPEC
51 #define LINK_EH_SPEC ""
52
53 /* Do code reading to identify a signal frame, and set the frame
54    state data appropriately.  See unwind-dw2.c for the structs.  */
55
56 #ifdef IN_LIBGCC2
57 #include <signal.h>
58 #include <sys/ucontext.h>
59
60 #define IA64_GATE_AREA_START 0xa000000000000100LL
61 #define IA64_GATE_AREA_END   0xa000000000010000LL
62
63 #define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS)               \
64   if ((CONTEXT)->rp >= IA64_GATE_AREA_START                             \
65       && (CONTEXT)->rp < IA64_GATE_AREA_END)                            \
66     {                                                                   \
67       struct sigframe {                                                 \
68         char scratch[16];                                               \
69         unsigned long sig_number;                                       \
70         struct siginfo *info;                                           \
71         struct sigcontext *sc;                                          \
72       } *frame_ = (struct sigframe *)(CONTEXT)->psp;                    \
73       struct sigcontext *sc_ = frame_->sc;                              \
74                                                                         \
75       /* Restore scratch registers in case the unwinder needs to        \
76          refer to a value stored in one of them.  */                    \
77       {                                                                 \
78         int i_;                                                         \
79                                                                         \
80         for (i_ = 2; i_ < 4; i_++)                                      \
81           (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_];                \
82         for (i_ = 8; i_ < 12; i_++)                                     \
83           (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_];                \
84         for (i_ = 14; i_ < 32; i_++)                                    \
85           (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_];                \
86       }                                                                 \
87                                                                         \
88       (CONTEXT)->pfs_loc = &(sc_->sc_ar_pfs);                           \
89       (CONTEXT)->lc_loc = &(sc_->sc_ar_lc);                             \
90       (CONTEXT)->unat_loc = &(sc_->sc_ar_unat);                         \
91       (CONTEXT)->br_loc[0] = &(sc_->sc_br[0]);                          \
92       (CONTEXT)->bsp = sc_->sc_ar_bsp;                                  \
93       (CONTEXT)->pr = sc_->sc_pr;                                       \
94       (CONTEXT)->psp = sc_->sc_gr[12];                                  \
95       (CONTEXT)->gp = sc_->sc_gr[1];                                    \
96       /* Signal frame doesn't have an associated reg. stack frame       \
97          other than what we adjust for below.     */                    \
98       (FS) -> no_reg_stack_frame = 1;                                   \
99                                                                         \
100       /* Don't touch the branch registers o.t. b0.  The kernel doesn't  \
101          pass the preserved branch registers in the sigcontext but      \
102          leaves them intact, so there's no need to do anything          \
103          with them here.  */                                            \
104                                                                         \
105       {                                                                 \
106         unsigned long sof = sc_->sc_cfm & 0x7f;                         \
107         (CONTEXT)->bsp = (unsigned long)                                \
108           ia64_rse_skip_regs ((unsigned long *)(sc_->sc_ar_bsp), -sof); \
109       }                                                                 \
110                                                                         \
111       (FS)->curr.reg[UNW_REG_RP].where = UNW_WHERE_SPREL;               \
112       (FS)->curr.reg[UNW_REG_RP].val                                    \
113         = (unsigned long)&(sc_->sc_ip) - (CONTEXT)->psp;                \
114       (FS)->curr.reg[UNW_REG_RP].when = -1;                             \
115                                                                         \
116       goto SUCCESS;                                                     \
117     }
118 #endif /* IN_LIBGCC2 */