177218Sphk/* Definitions for PA_RISC with ELF format 277218Sphk Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. 377218Sphk 477218SphkThis file is part of GCC. 577218Sphk 677218SphkGCC is free software; you can redistribute it and/or modify 777218Sphkit under the terms of the GNU General Public License as published by 877218Sphkthe Free Software Foundation; either version 2, or (at your option) 977218Sphkany later version. 1077218Sphk 1177218SphkGCC is distributed in the hope that it will be useful, 1291454Sbrooksbut WITHOUT ANY WARRANTY; without even the implied warranty of 1391454SbrooksMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1477218SphkGNU General Public License for more details. 1577218Sphk 1677218SphkYou should have received a copy of the GNU General Public License 1777218Sphkalong with GCC; see the file COPYING. If not, write to 1877218Sphkthe Free Software Foundation, 51 Franklin Street, Fifth Floor, 1977218SphkBoston, MA 02110-1301, USA. */ 2077218Sphk 2177218Sphk 2277218Sphk#undef TARGET_OS_CPP_BUILTINS 2377218Sphk#define TARGET_OS_CPP_BUILTINS() \ 2477218Sphk do \ 2577218Sphk { \ 2677218Sphk LINUX_TARGET_OS_CPP_BUILTINS(); \ 2777218Sphk builtin_assert ("machine=bigendian"); \ 2877218Sphk if (flag_pic) \ 2977218Sphk { \ 3077218Sphk builtin_define ("__PIC__"); \ 3177218Sphk builtin_define ("__pic__"); \ 3277218Sphk } \ 3377218Sphk } \ 3477218Sphk while (0) 3577218Sphk 3677218Sphk#undef CPP_SPEC 3777218Sphk#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}" 3877218Sphk 3977218Sphk#undef LIB_SPEC 4077218Sphk#define LIB_SPEC \ 4177218Sphk "%{pthread:-lpthread} \ 4277218Sphk %{shared:-lgcc -lc} \ 4377218Sphk %{!shared:%{mieee-fp:-lieee} %{shared-libgcc:-lgcc} %{profile:-lc_p}%{!profile:-lc}}" 4477218Sphk 4577218Sphk#undef ASM_SPEC 4677218Sphk#define ASM_SPEC \ 4777218Sphk "%{v:-V} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}" 4877218Sphk 4977218Sphk/* Define this for shared library support because it isn't in the main 5077218Sphk linux.h file. */ 5177218Sphk 5277218Sphk#undef LINK_SPEC 5377218Sphk#define LINK_SPEC "\ 5477218Sphk %{shared:-shared} \ 5577218Sphk %{!shared: \ 5677218Sphk %{!static: \ 5777218Sphk %{rdynamic:-export-dynamic} \ 5877218Sphk %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \ 5977218Sphk %{static:-static}}" 6077218Sphk 6177218Sphk/* glibc's profiling functions don't need gcc to allocate counters. */ 6277218Sphk#define NO_DEFERRED_PROFILE_COUNTERS 1 6377218Sphk 6477218Sphk/* Define the strings used for the special svr4 .type and .size directives. 6577218Sphk These strings generally do not vary from one system running svr4 to 6677218Sphk another, but if a given system (e.g. m88k running svr) needs to use 6777218Sphk different pseudo-op names for these, they may be overridden in the 6877218Sphk file which includes this one. */ 6977218Sphk 7077218Sphk#undef STRING_ASM_OP 7177218Sphk#define STRING_ASM_OP ".stringz" 7277218Sphk 7377218Sphk#define TEXT_SECTION_ASM_OP "\t.text" 7477218Sphk#define DATA_SECTION_ASM_OP "\t.data" 7577218Sphk#define BSS_SECTION_ASM_OP "\t.section\t.bss" 7677218Sphk 77138593Ssam#define TARGET_ASM_FILE_START pa_linux_file_start 7877218Sphk 79138593Ssam/* We want local labels to start with period if made with asm_fprintf. */ 80116957Ssam#undef LOCAL_LABEL_PREFIX 81120178Ssam#define LOCAL_LABEL_PREFIX "." 82116957Ssam 8377218Sphk/* Define these to generate the Linux/ELF/SysV style of internal 8477218Sphk labels all the time - i.e. to be compatible with 8577218Sphk ASM_GENERATE_INTERNAL_LABEL in <elfos.h>. Compare these with the 8677218Sphk ones in pa.h and note the lack of dollar signs in these. FIXME: 8777218Sphk shouldn't we fix pa.h to use ASM_GENERATE_INTERNAL_LABEL instead? */ 88146873Sjhb 8977218Sphk#undef ASM_OUTPUT_ADDR_VEC_ELT 9077218Sphk#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ 9177218Sphk if (TARGET_BIG_SWITCH) \ 9277218Sphk fprintf (FILE, "\t.word .L%d\n", VALUE); \ 9377218Sphk else \ 9477218Sphk fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE) 9577218Sphk 9677218Sphk#undef ASM_OUTPUT_ADDR_DIFF_ELT 9777218Sphk#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ 9877218Sphk if (TARGET_BIG_SWITCH) \ 9977218Sphk fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL); \ 10077218Sphk else \ 101138593Ssam fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE) 102138593Ssam 103138593Ssam/* Use the default. */ 104138593Ssam#undef ASM_OUTPUT_LABEL 105138593Ssam 106138593Ssam/* NOTE: (*targetm.asm_out.internal_label)() is defined for us by elfos.h, and 107138593Ssam does what we want (i.e. uses colons). It must be compatible with 108138593Ssam ASM_GENERATE_INTERNAL_LABEL(), so do not define it here. */ 10977218Sphk 11077218Sphk/* Use the default. */ 11177218Sphk#undef ASM_OUTPUT_INTERNAL_LABEL 11277218Sphk 113151883Sbrooks/* Use the default. */ 11477218Sphk#undef TARGET_ASM_GLOBALIZE_LABEL 11577218Sphk/* Globalizing directive for a label. */ 116121827Sbrooks#define GLOBAL_ASM_OP ".globl " 11788748Sambrisko 11888748Sambrisko/* FIXME: Hacked from the <elfos.h> one so that we avoid multiple 11988748Sambrisko labels in a function declaration (since pa.c seems determined to do 12088748Sambrisko it differently) */ 12177218Sphk 12277218Sphk#undef ASM_DECLARE_FUNCTION_NAME 12377218Sphk#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ 124151883Sbrooks do \ 125151883Sbrooks { \ 12677218Sphk ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \ 12777218Sphk ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \ 12877218Sphk } \ 12977218Sphk while (0) 130138593Ssam 13177218Sphk/* As well as globalizing the label, we need to encode the label 13277218Sphk to ensure a plabel is generated in an indirect call. */ 13377218Sphk 13477218Sphk#undef ASM_OUTPUT_EXTERNAL_LIBCALL 13577218Sphk#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \ 13677218Sphk do \ 13777218Sphk { \ 13877218Sphk if (!FUNCTION_NAME_P (XSTR (FUN, 0))) \ 13977218Sphk hppa_encode_label (FUN); \ 14077218Sphk (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0)); \ 14177218Sphk } \ 14277218Sphk while (0) 143138593Ssam 144138593Ssam/* Linux always uses gas. */ 145138593Ssam#undef TARGET_GAS 146138593Ssam#define TARGET_GAS 1 147138593Ssam