Commit 9739c90c by Jakub Jelinek Committed by Jakub Jelinek

linux.h (NO_PROFILE_COUNTERS): Define to 1.

	* config/i386/linux.h (NO_PROFILE_COUNTERS): Define to 1.
	* config/i386/freebsd.h (NO_PROFILE_COUNTERS): Likewise.
	* config/i386/netbsd-elf.h (NO_PROFILE_COUNTERS): Likewise.
	* config/xtensa/xtensa.h (NO_PROFILE_COUTNERS): Likewise.
	* config/darwin.h (NO_PROFILE_COUNTERS): Likewise.
	* final.c (NO_PROFILE_COUNTERS): Define to 0 if not defined.
	(profile_function): Allow NO_PROFILE_COUNTERS to be non-constant.
	* config/rs6000/rs6000.c (output_profile_hook): Likewise.

	* configure.in (powerpc*-*, s390*-*): Set tls_as_opt.
	Pass it to $gcc_cv_as.
	* configure: Rebuilt.

	* config/rs6000/rs6000.c (rs6000_abi_name): Remove initializer.
	(print_operand): Allow TARGET_AIX to be non-constant.
	(rs6000_aix_emit_builtin_unwind_init, rs6000_emit_eh_toc_restore):
	Define unconditionally.
	(rs6000_elf_declare_function_name): New function.
	* config/rs6000/rs6000.md (eh_return): Allow TARGET_AIX to be
	non-constant.
	* config/rs6000/linux64.h [!RS6000_BI_ARCH] (TARGET_64BIT): Define
	to 1.
	(DEFAULT_ARCH64_P, RS6000_BI_ARCH_P): Define.
	[IN_LIBGCC2] (TARGET_64BIT): Define based on whether __powerpc64__
	is defined.
	(TARGET_AIX): Define to 1 if TARGET_64BIT.
	(PROCESSOR_DEFAULT): Remove.
	(TARGET_RELOCATABLE, RS6000_ABI_NAME, INVALID_64BIT,
	INVALID_32BIT, SUBSUBTARGET_OVERRIDE_OPTIONS): Define.
	[RS6000_BI_ARCH] (OVERRIDE_OPTIONS, ASM_FILE_START): Define.
	(ASM_DEFAULT_SPEC, ASM_SPEC, LINK_OS_LINUX_SPEC): Define for both
	-m32 and -m64.
	(MULTILIB_DEFAULTS): Define.
	(SUBSUBTARGET_EXTRA_SPECS): Define.
	(ASM_SPEC32, ASM_SPEC64, ASM_SPEC_COMMON): Define.
	(TARGET_TOC): Define only if !RS6000_BI_ARCH.
	(TARGET_NO_TOC): Remove.
	[!RS6000_BI_ARCH] (TARGET_RELOCATABLE, TARGET_EABI,
	TARGET_PROTOTYPE): Define to 0.
	(NO_PROFILE_COUNTERS): Define to TARGET_64BIT.
	(PROFILE_HOOK): Only call output_profile_hook if TARGET_64BIT.
	(ADJUST_FIELD_ALIGN, ROUND_TYPE_ALIGN): Adjust to work properly
	if !TARGET_64BIT.
	(USER_LABEL_PREFIX): Remove.
	(JUMP_TABLES_IN_TEXT_SECTION): Define to TARGET_64BIT.
	(SETUP_FRAME_ADDRESSES): Only call rs6000_aix_emit_builtin_unwind_init
	if TARGET_64BIT.
	(TARGET_OS_CPP_BUILTINS): Handle both -m32 and -m64.
	(LINK_OS_LINUX_SPEC32, LINK_OS_LINUX_SPEC64): Define.
	(STARTFILE_LINUX_SPEC, ENDFILE_LINUX_SPEC): Remove.
	(TOC_SECTION_ASM_OP): Define depending on TARGET_64BIT.
	(MINIMAL_TOC_SECTION_ASM_OP): Likewise.
	(SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE): Define depending on
	TARGET_64BIT.
	(RS6000_CALL_GLUE): Likewise.
	(SAVE_FP_PREFIX, SAVE_FP_SUFFIX, RESTORE_FP_PREFIX,
	RESTORE_FP_SUFFIX): Likewise.
	(ASM_DECLARE_FUNCTION_NAME): Remove.
	(ASM_DECLARE_FUNCTION_SIZE, ASM_OUTPUT_SOURCE_LINE,
	DBX_OUTPUT_BRAC, DBX_OUTPUT_NFUN): Only output dot before function
	name if TARGET_64BIT.
	(ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Handle both TARGET_64BIT and
	!TARGET_64BIT.
	(ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP): Remove undefs.
	(ASM_PREFERRED_EH_DATA_FORMAT): Take TARGET_64BIT into account.
	(DRAFT_V4_STRUCT_RET): Define.
	(SIGNAL_FRAMESIZE): New enum value.
	(MD_FALLBACK_FRAME_STATE_FOR): Define.
	* config/rs6000/default64.h: New file.
	* config/rs6000/sysv4.h (SUBTARGET_SWITCHES): Add -m32 and -m64
	options.
	(SUBTARGET_OVERRIDE_OPTIONS): If rs6000_abi_name is NULL, set it
	to RS6000_ABI_NAME.  Only disallow mixing of -fPIC with -mcall-aixdesc
	if !TARGET_64BIT.
	[!RS6000_BI_ARCH] (SUBSUBTARGET_OVERRIDE_OPTIONS): Define.
	(ASM_DECLARE_FUNCTION_NAME): Use rs6000_elf_declare_function_name
	function.
	(TARGET_OS_SYSV_CPP_BUILTINS): Define.
	(TARGET_OS_CPP_BUILTINS): Use it.
	(CPP_SYSV_SPEC): Remove.
	(CPP_SPEC): Remove cpp_sysv.
	(SUBTARGET_EXTRA_SPECS): Remove cpp_sysv.
	Add SUBSUBTARGET_EXTRA_SPECS.
	(SUBSUBTARGET_EXTRA_SPECS): Define.
	* config/rs6000/biarch64.h: New file.
	* config/rs6000/rs6000-protos.h (rs6000_elf_declare_function_name):
	New prototype.
	* config/rs6000/x-linux64: New file.
	* config/rs6000/t-linux64: Build -m64, -m32 and -m32 -msoft-float
	multilibs.
	* config/rs6000/eabi-ci.asm: Protect with #ifndef __powerpc64__.
	* config/rs6000/eabi-cn.asm: Likewise.
	* config/rs6000/tramp.asm: Likewise.
	* config/rs6000/sol-ci.asm: Likewise.
	* config/rs6000/sol-cn.asm: Likewise.
	* config/rs6000/linux.h (TARGET_64BIT): Define to 0.
	(TARGET_OS_CPP_BUILTINS): Use TARGET_OS_SYSV_CPP_BUILTINS.
	* config/rs6000/ppc-asm.h: Move __powerpc64__ section before
	_CALL_AIXDESC section.
	* config.gcc (powerpc64-*-linux*): Configure a bi-arch compiler,
	defaulting to -m64 unless --with-cpu= is one of the 32-bit CPUs
	or default32.

Co-Authored-By: Alan Modra <amodra@bigpond.net.au>

From-SVN: r67442
parent 150b72ed
2003-06-04 Jakub Jelinek <jakub@redhat.com>
Alan Modra <amodra@bigpond.net.au>
* config/i386/linux.h (NO_PROFILE_COUNTERS): Define to 1.
* config/i386/freebsd.h (NO_PROFILE_COUNTERS): Likewise.
* config/i386/netbsd-elf.h (NO_PROFILE_COUNTERS): Likewise.
* config/xtensa/xtensa.h (NO_PROFILE_COUTNERS): Likewise.
* config/darwin.h (NO_PROFILE_COUNTERS): Likewise.
* final.c (NO_PROFILE_COUNTERS): Define to 0 if not defined.
(profile_function): Allow NO_PROFILE_COUNTERS to be non-constant.
* config/rs6000/rs6000.c (output_profile_hook): Likewise.
* configure.in (powerpc*-*, s390*-*): Set tls_as_opt.
Pass it to $gcc_cv_as.
* configure: Rebuilt.
* config/rs6000/rs6000.c (rs6000_abi_name): Remove initializer.
(print_operand): Allow TARGET_AIX to be non-constant.
(rs6000_aix_emit_builtin_unwind_init, rs6000_emit_eh_toc_restore):
Define unconditionally.
(rs6000_elf_declare_function_name): New function.
* config/rs6000/rs6000.md (eh_return): Allow TARGET_AIX to be
non-constant.
* config/rs6000/linux64.h [!RS6000_BI_ARCH] (TARGET_64BIT): Define
to 1.
(DEFAULT_ARCH64_P, RS6000_BI_ARCH_P): Define.
[IN_LIBGCC2] (TARGET_64BIT): Define based on whether __powerpc64__
is defined.
(TARGET_AIX): Define to 1 if TARGET_64BIT.
(PROCESSOR_DEFAULT): Remove.
(TARGET_RELOCATABLE, RS6000_ABI_NAME, INVALID_64BIT,
INVALID_32BIT, SUBSUBTARGET_OVERRIDE_OPTIONS): Define.
[RS6000_BI_ARCH] (OVERRIDE_OPTIONS, ASM_FILE_START): Define.
(ASM_DEFAULT_SPEC, ASM_SPEC, LINK_OS_LINUX_SPEC): Define for both
-m32 and -m64.
(MULTILIB_DEFAULTS): Define.
(SUBSUBTARGET_EXTRA_SPECS): Define.
(ASM_SPEC32, ASM_SPEC64, ASM_SPEC_COMMON): Define.
(TARGET_TOC): Define only if !RS6000_BI_ARCH.
(TARGET_NO_TOC): Remove.
[!RS6000_BI_ARCH] (TARGET_RELOCATABLE, TARGET_EABI,
TARGET_PROTOTYPE): Define to 0.
(NO_PROFILE_COUNTERS): Define to TARGET_64BIT.
(PROFILE_HOOK): Only call output_profile_hook if TARGET_64BIT.
(ADJUST_FIELD_ALIGN, ROUND_TYPE_ALIGN): Adjust to work properly
if !TARGET_64BIT.
(USER_LABEL_PREFIX): Remove.
(JUMP_TABLES_IN_TEXT_SECTION): Define to TARGET_64BIT.
(SETUP_FRAME_ADDRESSES): Only call rs6000_aix_emit_builtin_unwind_init
if TARGET_64BIT.
(TARGET_OS_CPP_BUILTINS): Handle both -m32 and -m64.
(LINK_OS_LINUX_SPEC32, LINK_OS_LINUX_SPEC64): Define.
(STARTFILE_LINUX_SPEC, ENDFILE_LINUX_SPEC): Remove.
(TOC_SECTION_ASM_OP): Define depending on TARGET_64BIT.
(MINIMAL_TOC_SECTION_ASM_OP): Likewise.
(SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE): Define depending on
TARGET_64BIT.
(RS6000_CALL_GLUE): Likewise.
(SAVE_FP_PREFIX, SAVE_FP_SUFFIX, RESTORE_FP_PREFIX,
RESTORE_FP_SUFFIX): Likewise.
(ASM_DECLARE_FUNCTION_NAME): Remove.
(ASM_DECLARE_FUNCTION_SIZE, ASM_OUTPUT_SOURCE_LINE,
DBX_OUTPUT_BRAC, DBX_OUTPUT_NFUN): Only output dot before function
name if TARGET_64BIT.
(ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Handle both TARGET_64BIT and
!TARGET_64BIT.
(ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP): Remove undefs.
(ASM_PREFERRED_EH_DATA_FORMAT): Take TARGET_64BIT into account.
(DRAFT_V4_STRUCT_RET): Define.
(SIGNAL_FRAMESIZE): New enum value.
(MD_FALLBACK_FRAME_STATE_FOR): Define.
* config/rs6000/default64.h: New file.
* config/rs6000/sysv4.h (SUBTARGET_SWITCHES): Add -m32 and -m64
options.
(SUBTARGET_OVERRIDE_OPTIONS): If rs6000_abi_name is NULL, set it
to RS6000_ABI_NAME. Only disallow mixing of -fPIC with -mcall-aixdesc
if !TARGET_64BIT.
[!RS6000_BI_ARCH] (SUBSUBTARGET_OVERRIDE_OPTIONS): Define.
(ASM_DECLARE_FUNCTION_NAME): Use rs6000_elf_declare_function_name
function.
(TARGET_OS_SYSV_CPP_BUILTINS): Define.
(TARGET_OS_CPP_BUILTINS): Use it.
(CPP_SYSV_SPEC): Remove.
(CPP_SPEC): Remove cpp_sysv.
(SUBTARGET_EXTRA_SPECS): Remove cpp_sysv.
Add SUBSUBTARGET_EXTRA_SPECS.
(SUBSUBTARGET_EXTRA_SPECS): Define.
* config/rs6000/biarch64.h: New file.
* config/rs6000/rs6000-protos.h (rs6000_elf_declare_function_name):
New prototype.
* config/rs6000/x-linux64: New file.
* config/rs6000/t-linux64: Build -m64, -m32 and -m32 -msoft-float
multilibs.
* config/rs6000/eabi-ci.asm: Protect with #ifndef __powerpc64__.
* config/rs6000/eabi-cn.asm: Likewise.
* config/rs6000/tramp.asm: Likewise.
* config/rs6000/sol-ci.asm: Likewise.
* config/rs6000/sol-cn.asm: Likewise.
* config/rs6000/linux.h (TARGET_64BIT): Define to 0.
(TARGET_OS_CPP_BUILTINS): Use TARGET_OS_SYSV_CPP_BUILTINS.
* config/rs6000/ppc-asm.h: Move __powerpc64__ section before
_CALL_AIXDESC section.
* config.gcc (powerpc64-*-linux*): Configure a bi-arch compiler,
defaulting to -m64 unless --with-cpu= is one of the 32-bit CPUs
or default32.
2003-06-04 Daniel Jacobowitz <drow@mvista.com>
* config.gcc: Revert accidentally committed ARM changes.
......
......@@ -1581,8 +1581,12 @@ powerpc-*-openbsd*)
extra_headers=
;;
powerpc64-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux64.h"
tmake_file="rs6000/t-fprules t-slibgcc-elf-ver t-linux rs6000/t-linux64"
tm_file="rs6000/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h"
case x$with_cpu in
x|xpowerpc64|xdefault64) tm_file="${tm_file} rs6000/default64.h";;
esac
tm_file="${tm_file} rs6000/linux64.h"
tmake_file="rs6000/t-fprules t-slibgcc-elf-ver t-linux rs6000/t-ppccomm rs6000/t-linux64"
;;
powerpc64-*-gnu*)
tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux64.h rs6000/gnu.h"
......@@ -1713,14 +1717,14 @@ rs6000-ibm-aix4.[12]* | powerpc-ibm-aix4.[12]*)
extra_headers=
;;
rs6000-ibm-aix4.[3456789]* | powerpc-ibm-aix4.[3456789]*)
tm_file="${tm_file} rs6000/aix.h rs6000/aix43.h rs6000/xcoff.h"
tm_file="rs6000/biarch64.h ${tm_file} rs6000/aix.h rs6000/aix43.h rs6000/xcoff.h"
tmake_file=rs6000/t-aix43
use_collect2=yes
thread_file='aix'
extra_headers=
;;
rs6000-ibm-aix5.1.* | powerpc-ibm-aix5.1.*)
tm_file="${tm_file} rs6000/aix.h rs6000/aix51.h rs6000/xcoff.h"
tm_file="rs6000/biarch64.h ${tm_file} rs6000/aix.h rs6000/aix51.h rs6000/xcoff.h"
tmake_file=rs6000/t-aix43
use_collect2=yes
thread_file='aix'
......@@ -2306,7 +2310,7 @@ powerpc*-*-* | rs6000-*-*)
tm_file="$tm_file rs6000/altivec-defs.h"
fi
case "x$with_cpu" in
x)
x | xdefault32 | xdefault64)
;;
xcommon | xpowerpc | xpowerpc64 \
......
......@@ -310,7 +310,7 @@ do { text_section (); \
/* Our profiling scheme doesn't LP labels and counter words. */
#define NO_PROFILE_COUNTERS
#define NO_PROFILE_COUNTERS 1
#undef INIT_SECTION_ASM_OP
#define INIT_SECTION_ASM_OP
......
......@@ -43,7 +43,7 @@ Boston, MA 02111-1307, USA. */
(TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
#undef NO_PROFILE_COUNTERS
#define NO_PROFILE_COUNTERS
#define NO_PROFILE_COUNTERS 1
/* Tell final.c that we don't need a label passed to mcount. */
......
......@@ -51,7 +51,7 @@ Boston, MA 02111-1307, USA. */
To the best of my knowledge, no Linux libc has required the label
argument to mcount. */
#define NO_PROFILE_COUNTERS
#define NO_PROFILE_COUNTERS 1
#undef MCOUNT_NAME
#define MCOUNT_NAME "mcount"
......
......@@ -76,7 +76,7 @@ Boston, MA 02111-1307, USA. */
/* Output assembler code to FILE to call the profiler. */
#undef NO_PROFILE_COUNTERS
#define NO_PROFILE_COUNTERS
#define NO_PROFILE_COUNTERS 1
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
......
/* Definitions of target machine for GNU compiler, for 32/64 bit powerpc.
Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
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.
GNU CC is distributed in the hope that it will be useful,
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
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Specify this in a cover file to provide bi-architecture (32/64) support. */
#define RS6000_BI_ARCH 1
/* Definitions of target machine for GNU compiler,
for 64 bit powerpc linux defaulting to -m64.
Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
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.
GNU CC is distributed in the hope that it will be useful,
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
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#undef TARGET_DEFAULT
#define TARGET_DEFAULT \
(MASK_POWERPC | MASK_POWERPC64 | MASK_64BIT | MASK_NEW_MNEMONICS)
......@@ -41,6 +41,7 @@ Boston, MA 02111-1307, USA.
#include <ppc-asm.h>
#ifndef __powerpc64__
.section ".got","aw"
.globl __GOT_START__
.type __GOT_START__,@object
......@@ -122,3 +123,4 @@ FUNC_START(__fini)
stwu 1,-16(1)
mflr 0
stw 0,20(1)
#endif
......@@ -39,6 +39,7 @@ Boston, MA 02111-1307, USA.
.file "crtn.s"
.ident "GNU C crtn.s"
#ifndef __powerpc64__
.section ".got","aw"
.globl __GOT_END__
.type __GOT_END__,@object
......@@ -113,3 +114,4 @@ __EH_FRAME_END__:
mtlr 0
addi 1,1,16
blr
#endif
......@@ -32,6 +32,7 @@
builtin_define_std ("powerpc"); \
builtin_assert ("cpu=powerpc"); \
builtin_assert ("machine=powerpc"); \
TARGET_OS_SYSV_CPP_BUILTINS (); \
} \
while (0)
......@@ -78,6 +79,13 @@
#undef DRAFT_V4_STRUCT_RET
#define DRAFT_V4_STRUCT_RET 1
/* We are 32-bit all the time, so optimize a little. */
#undef TARGET_64BIT
#define TARGET_64BIT 0
/* We don't need to generate entries in .fixup. */
#undef RELOCATABLE_NEEDS_FIXUP
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
......
......@@ -95,21 +95,15 @@
* the real function with one or two leading periods respectively.
*/
#ifdef _RELOCATABLE
#define DESC_SECTION ".got2"
#else
#define DESC_SECTION ".got1"
#endif
#if defined(_CALL_AIXDESC)
#if defined (__powerpc64__)
#define FUNC_NAME(name) GLUE(.,name)
#define JUMP_TARGET(name) FUNC_NAME(name)
#define FUNC_START(name) \
.section DESC_SECTION,"aw"; \
.section ".opd","aw"; \
name: \
.long GLUE(.,name); \
.long _GLOBAL_OFFSET_TABLE_; \
.long 0; \
.quad GLUE(.,name); \
.quad .TOC.@tocbase; \
.quad 0; \
.previous; \
.type GLUE(.,name),@function; \
.globl name; \
......@@ -120,15 +114,22 @@ GLUE(.,name):
GLUE(.L,name): \
.size GLUE(.,name),GLUE(.L,name)-GLUE(.,name)
#elif defined (__powerpc64__)
#elif defined(_CALL_AIXDESC)
#ifdef _RELOCATABLE
#define DESC_SECTION ".got2"
#else
#define DESC_SECTION ".got1"
#endif
#define FUNC_NAME(name) GLUE(.,name)
#define JUMP_TARGET(name) FUNC_NAME(name)
#define FUNC_START(name) \
.section ".opd","aw"; \
.section DESC_SECTION,"aw"; \
name: \
.quad GLUE(.,name); \
.quad .TOC.@tocbase; \
.quad 0; \
.long GLUE(.,name); \
.long _GLOBAL_OFFSET_TABLE_; \
.long 0; \
.previous; \
.type GLUE(.,name),@function; \
.globl name; \
......@@ -140,6 +141,7 @@ GLUE(.L,name): \
.size GLUE(.,name),GLUE(.L,name)-GLUE(.,name)
#else
#define FUNC_NAME(name) GLUE(__USER_LABEL_PREFIX__,name)
#if defined __PIC__ || defined __pic__
#define JUMP_TARGET(name) FUNC_NAME(name@plt)
......@@ -155,4 +157,3 @@ FUNC_NAME(name):
GLUE(.L,name): \
.size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
#endif
......@@ -156,6 +156,8 @@ extern rtx rs6000_function_value (tree, tree);
extern rtx rs6000_libcall_value (enum machine_mode);
extern struct rtx_def *rs6000_va_arg PARAMS ((tree, tree));
extern int function_ok_for_sibcall PARAMS ((tree));
extern void rs6000_elf_declare_function_name
PARAMS ((FILE *, const char *, tree));
#ifdef ARGS_SIZE_RTX
/* expr.h defines ARGS_SIZE_RTX and `enum direction' */
extern enum direction function_arg_padding PARAMS ((enum machine_mode, tree));
......
......@@ -124,7 +124,7 @@ int rs6000_pic_labelno;
#ifdef USING_ELFOS_H
/* Which abi to adhere to */
const char *rs6000_abi_name = RS6000_ABI_NAME;
const char *rs6000_abi_name;
/* Semantics of the small data area */
enum rs6000_sdata_type rs6000_sdata = SDATA_DATA;
......@@ -8661,11 +8661,10 @@ print_operand (file, x, code)
break;
}
}
#if TARGET_AIX
RS6000_OUTPUT_BASENAME (file, XSTR (x, 0));
#else
assemble_name (file, XSTR (x, 0));
#endif
if (TARGET_AIX)
RS6000_OUTPUT_BASENAME (file, XSTR (x, 0));
else
assemble_name (file, XSTR (x, 0));
return;
case 'Z':
......@@ -10566,7 +10565,6 @@ create_TOC_reference (symbol)
gen_rtx_SYMBOL_REF (Pmode, toc_label_name))));
}
#if TARGET_AIX
/* __throw will restore its own return address to be the same as the
return address of the function that the throw is being made to.
This is unfortunate, because we want to check the original
......@@ -10694,7 +10692,6 @@ rs6000_emit_eh_toc_restore (stacksize)
emit_note (NULL, NOTE_INSN_LOOP_END);
emit_label (loop_exit);
}
#endif /* TARGET_AIX */
/* This ties together stack memory (MEM with an alias set of
rs6000_sr_alias_set) and the change to the stack pointer. */
......@@ -12885,20 +12882,24 @@ output_profile_hook (labelno)
if (DEFAULT_ABI == ABI_AIX)
{
#ifdef NO_PROFILE_COUNTERS
emit_library_call (init_one_libfunc (RS6000_MCOUNT), 0, VOIDmode, 0);
#else
char buf[30];
const char *label_name;
rtx fun;
#ifndef NO_PROFILE_COUNTERS
# define NO_PROFILE_COUNTERS 0
#endif
if (NO_PROFILE_COUNTERS)
emit_library_call (init_one_libfunc (RS6000_MCOUNT), 0, VOIDmode, 0);
else
{
char buf[30];
const char *label_name;
rtx fun;
ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno);
label_name = (*targetm.strip_name_encoding) (ggc_strdup (buf));
fun = gen_rtx_SYMBOL_REF (Pmode, label_name);
ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno);
label_name = (*targetm.strip_name_encoding) (ggc_strdup (buf));
fun = gen_rtx_SYMBOL_REF (Pmode, label_name);
emit_library_call (init_one_libfunc (RS6000_MCOUNT), 0, VOIDmode, 1,
fun, Pmode);
#endif
emit_library_call (init_one_libfunc (RS6000_MCOUNT), 0, VOIDmode, 1,
fun, Pmode);
}
}
else if (DEFAULT_ABI == ABI_DARWIN)
{
......@@ -13934,6 +13935,79 @@ rs6000_elf_asm_out_destructor (symbol, priority)
else
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
}
void
rs6000_elf_declare_function_name (file, name, decl)
FILE *file;
const char *name;
tree decl;
{
if (TARGET_64BIT)
{
fputs ("\t.section\t\".opd\",\"aw\"\n\t.align 3\n", file);
ASM_OUTPUT_LABEL (file, name);
fputs (DOUBLE_INT_ASM_OP, file);
putc ('.', file);
assemble_name (file, name);
fputs (",.TOC.@tocbase,0\n\t.previous\n\t.size\t", file);
assemble_name (file, name);
fputs (",24\n\t.type\t.", file);
assemble_name (file, name);
fputs (",@function\n", file);
if (TREE_PUBLIC (decl) && ! DECL_WEAK (decl))
{
fputs ("\t.globl\t.", file);
assemble_name (file, name);
putc ('\n', file);
}
ASM_DECLARE_RESULT (file, DECL_RESULT (decl));
putc ('.', file);
ASM_OUTPUT_LABEL (file, name);
return;
}
if (TARGET_RELOCATABLE
&& (get_pool_size () != 0 || current_function_profile)
&& uses_TOC())
{
char buf[256];
(*targetm.asm_out.internal_label) (file, "LCL", rs6000_pic_labelno);
ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1);
fprintf (file, "\t.long ");
assemble_name (file, buf);
putc ('-', file);
ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno);
assemble_name (file, buf);
putc ('\n', file);
}
ASM_OUTPUT_TYPE_DIRECTIVE (file, name, "function");
ASM_DECLARE_RESULT (file, DECL_RESULT (decl));
if (DEFAULT_ABI == ABI_AIX)
{
const char *desc_name, *orig_name;
orig_name = (*targetm.strip_name_encoding) (name);
desc_name = orig_name;
while (*desc_name == '.')
desc_name++;
if (TREE_PUBLIC (decl))
fprintf (file, "\t.globl %s\n", desc_name);
fprintf (file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);
fprintf (file, "%s:\n", desc_name);
fprintf (file, "\t.long %s\n", orig_name);
fputs ("\t.long _GLOBAL_OFFSET_TABLE_\n", file);
if (DEFAULT_ABI == ABI_AIX)
fputs ("\t.long 0\n", file);
fprintf (file, "\t.previous\n");
}
ASM_OUTPUT_LABEL (file, name);
}
#endif
#if TARGET_XCOFF
......
......@@ -14581,9 +14581,8 @@
""
"
{
#if TARGET_AIX
rs6000_emit_eh_toc_restore (EH_RETURN_STACKADJ_RTX);
#endif
if (TARGET_AIX)
rs6000_emit_eh_toc_restore (EH_RETURN_STACKADJ_RTX);
if (TARGET_32BIT)
emit_insn (gen_eh_set_lr_si (operands[0]));
else
......
......@@ -39,6 +39,7 @@
.file "scrti.s"
.ident "GNU C scrti.s"
#ifndef __powerpc64__
# Start of .text
.section ".text"
.globl _ex_text0
......@@ -102,3 +103,4 @@ _fini: stwu %r1,-16(%r1)
.space 4
.weak environ
.set environ,_environ
#endif
......@@ -39,6 +39,7 @@
.file "scrtn.s"
.ident "GNU C scrtn.s"
#ifndef __powerpc64__
# Default versions of exception handling register/deregister
.weak _ex_register
.weak _ex_deregister
......@@ -80,3 +81,4 @@ _ex_range1:
mtlr %r0
addi %r1,%r1,16
blr
#endif
......@@ -149,6 +149,10 @@ extern const char *rs6000_tls_size_string; /* For -mtls-size= */
N_("Set the PPC_EMB bit in the ELF flags header") }, \
{ "windiss", 0, N_("Use the WindISS simulator") }, \
{ "shlib", 0, N_("no description yet") }, \
{ "64", MASK_64BIT | MASK_POWERPC64 | MASK_POWERPC, \
N_("Generate 64-bit code") }, \
{ "32", - (MASK_64BIT | MASK_POWERPC64), \
N_("Generate 32-bit code") }, \
EXTRA_SUBTARGET_SWITCHES \
{ "newlib", 0, N_("no description yet") },
......@@ -172,6 +176,9 @@ do { \
if (!g_switch_set) \
g_switch_value = SDATA_DEFAULT_SIZE; \
\
if (rs6000_abi_name == NULL) \
rs6000_abi_name = RS6000_ABI_NAME; \
\
if (!strcmp (rs6000_abi_name, "sysv")) \
rs6000_current_abi = ABI_V4; \
else if (!strcmp (rs6000_abi_name, "sysv-noeabi")) \
......@@ -274,7 +281,7 @@ do { \
rs6000_abi_name); \
} \
\
if (flag_pic > 1 && rs6000_current_abi == ABI_AIX) \
if (!TARGET_64BIT && flag_pic > 1 && rs6000_current_abi == ABI_AIX) \
{ \
flag_pic = 0; \
error ("-fPIC and -mcall-%s are incompatible", \
......@@ -293,9 +300,16 @@ do { \
\
else if (TARGET_RELOCATABLE) \
flag_pic = 2; \
\
} while (0)
#ifndef RS6000_BI_ARCH
# define SUBSUBTARGET_OVERRIDE_OPTIONS \
do { \
if ((TARGET_DEFAULT ^ target_flags) & MASK_64BIT) \
error ("-m%s not supported in this configuration", \
(target_flags & MASK_64BIT) ? "64" : "32"); \
} while (0)
#endif
/* Override rs6000.h definition. */
#undef TARGET_DEFAULT
......@@ -590,51 +604,7 @@ extern int rs6000_pic_labelno;
/* Override elfos.h definition. */
#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
do { \
const char *const init_ptr = (TARGET_64BIT) ? ".quad" : ".long"; \
\
if (TARGET_RELOCATABLE \
&& (get_pool_size () != 0 || current_function_profile) \
&& uses_TOC()) \
{ \
char buf[256]; \
\
(*targetm.asm_out.internal_label) (FILE, "LCL", rs6000_pic_labelno); \
\
ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1); \
fprintf (FILE, "\t%s ", init_ptr); \
assemble_name (FILE, buf); \
putc ('-', FILE); \
ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); \
assemble_name (FILE, buf); \
putc ('\n', FILE); \
} \
\
ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \
ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
\
if (DEFAULT_ABI == ABI_AIX) \
{ \
const char *desc_name, *orig_name; \
\
orig_name = (*targetm.strip_name_encoding) (NAME); \
desc_name = orig_name; \
while (*desc_name == '.') \
desc_name++; \
\
if (TREE_PUBLIC (DECL)) \
fprintf (FILE, "\t.globl %s\n", desc_name); \
\
fprintf (FILE, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
fprintf (FILE, "%s:\n", desc_name); \
fprintf (FILE, "\t%s %s\n", init_ptr, orig_name); \
fprintf (FILE, "\t%s _GLOBAL_OFFSET_TABLE_\n", init_ptr); \
if (DEFAULT_ABI == ABI_AIX) \
fprintf (FILE, "\t%s 0\n", init_ptr); \
fprintf (FILE, "\t.previous\n"); \
} \
ASM_OUTPUT_LABEL (FILE, NAME); \
} while (0)
rs6000_elf_declare_function_name ((FILE), (NAME), (DECL))
/* The USER_LABEL_PREFIX stuff is affected by the -fleading-underscore
flag. The LOCAL_LABEL_PREFIX variable is used by dbxelf.h. */
......@@ -789,6 +759,25 @@ extern int fixuplabelno;
#define TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)");
#endif
#define TARGET_OS_SYSV_CPP_BUILTINS() \
do \
{ \
if (flag_pic == 1) \
{ \
builtin_define ("__pic__=1"); \
builtin_define ("__PIC__=1"); \
} \
else if (flag_pic == 2) \
{ \
builtin_define ("__pic__=2"); \
builtin_define ("__PIC__=2"); \
} \
if (target_flags_explicit \
& MASK_RELOCATABLE) \
builtin_define ("_RELOCATABLE"); \
} \
while (0)
#ifndef TARGET_OS_CPP_BUILTINS
#define TARGET_OS_CPP_BUILTINS() \
do \
......@@ -800,6 +789,7 @@ extern int fixuplabelno;
builtin_assert ("system=svr4"); \
builtin_assert ("cpu=powerpc"); \
builtin_assert ("machine=powerpc"); \
TARGET_OS_SYSV_CPP_BUILTINS (); \
} \
while (0)
#endif
......@@ -945,14 +935,9 @@ extern int fixuplabelno;
#define LINK_OS_DEFAULT_SPEC ""
#define CPP_SYSV_SPEC \
"%{mrelocatable*: -D_RELOCATABLE} \
%{fpic|fpie: -D__PIC__=1 -D__pic__=1} \
%{!fpic: %{fPIC|fPIE: -D__PIC__=2 -D__pic__=2}}"
/* Override rs6000.h definition. */
#undef CPP_SPEC
#define CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_sysv) \
#define CPP_SPEC "%{posix: -D_POSIX_SOURCE} \
%{mads : %(cpp_os_ads) ; \
myellowknife : %(cpp_os_yellowknife) ; \
mmvme : %(cpp_os_mvme) ; \
......@@ -1219,7 +1204,6 @@ ncrtn.o%s"
/* Override rs6000.h definition. */
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
{ "cpp_sysv", CPP_SYSV_SPEC }, \
{ "crtsavres_default", CRTSAVRES_DEFAULT_SPEC }, \
{ "lib_ads", LIB_ADS_SPEC }, \
{ "lib_yellowknife", LIB_YELLOWKNIFE_SPEC }, \
......@@ -1288,7 +1272,10 @@ ncrtn.o%s"
{ "cpp_os_linux", CPP_OS_LINUX_SPEC }, \
{ "cpp_os_netbsd", CPP_OS_NETBSD_SPEC }, \
{ "cpp_os_windiss", CPP_OS_WINDISS_SPEC }, \
{ "cpp_os_default", CPP_OS_DEFAULT_SPEC },
{ "cpp_os_default", CPP_OS_DEFAULT_SPEC }, \
SUBSUBTARGET_EXTRA_SPECS
#define SUBSUBTARGET_EXTRA_SPECS
/* Define this macro as a C expression for the initializer of an
array of string to tell the driver program which options are
......
# Override t-linux. We don't want -fPIC.
CRTSTUFF_T_CFLAGS_S =
TARGET_LIBGCC2_CFLAGS =
# These functions are needed for soft-float on powerpc64-linux.
LIB2FUNCS_EXTRA = tramp.S $(srcdir)/config/rs6000/ppc64-fp.c
EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o \
crtsavres.o
# Modify the shared lib version file
SHLIB_MKMAP_OPTS = -v dotsyms=1
# These functions are needed for soft-float on powerpc64-linux.
LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/ppc64-fp.c
MULTILIB_OPTIONS = m64/m32 msoft-float
MULTILIB_DIRNAMES = 64 32 nof
MULTILIB_EXTRA_OPTS = fPIC mstrict-align
MULTILIB_EXCEPTIONS = m64/msoft-float
MULTILIB_EXCLUSIONS = m64/!m32/msoft-float
MULTILIB_OSDIRNAMES = ../lib64 ../lib nof
MULTILIB_MATCHES = $(MULTILIB_MATCHES_FLOAT)
# ld provides these functions as needed.
crtsavres.S:
echo >crtsavres.S
TARGET_LIBGCC2_CFLAGS = -mno-minimal-toc -fPIC
$(T)crtsavres.o: crtsavres.S
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtsavres.S -o $(T)crtsavres.o
# We want fine grained libraries, so use the new code to build the
# floating point emulation libraries.
# fp-bit is only to be used by 32-bit multilibs
FPBIT = fp-bit32.c
DPBIT = dp-bit32.c
# Modify the shared lib version file
SHLIB_MKMAP_OPTS = -v dotsyms=1
dp-bit32.c: $(srcdir)/config/fp-bit.c
( echo '#ifndef __powerpc64__'; \
cat $(srcdir)/config/fp-bit.c; \
echo '#endif' ) > dp-bit32.c
fp-bit32.c: $(srcdir)/config/fp-bit.c
( echo '#ifndef __powerpc64__'; \
echo '#define FLOAT'; \
cat $(srcdir)/config/fp-bit.c; \
echo '#endif' ) > fp-bit32.c
......@@ -39,6 +39,7 @@
.section ".text"
#include "ppc-asm.h"
#ifndef __powerpc64__
.type trampoline_initial,@object
.align 2
trampoline_initial:
......@@ -107,3 +108,4 @@ FUNC_START(__trampoline_setup)
bl JUMP_TARGET(abort)
FUNC_END(__trampoline_setup)
#endif
# parts of gcc need more than a 64k TOC.
X_CFLAGS = -mminimal-toc
......@@ -942,7 +942,7 @@ typedef struct xtensa_args {
_mcount uses a window size of 8 to make sure that it doesn't clobber
any incoming argument values. */
#define NO_PROFILE_COUNTERS
#define NO_PROFILE_COUNTERS 1
#define FUNCTION_PROFILER(FILE, LABELNO) \
do { \
......
......@@ -8127,6 +8127,7 @@ gcc_cv_as_tls=no
conftest_s=
tls_first_major=
tls_first_minor=
tls_as_opt=
case "$target" in
alpha*-*-*)
conftest_s='
......@@ -8224,6 +8225,7 @@ x3: .space 4
addi 9,9,x2@tprel@l'
tls_first_major=2
tls_first_minor=14
tls_as_opt=-a32
;;
powerpc64-*-*)
conftest_s='
......@@ -8257,6 +8259,7 @@ x3: .space 8
nop'
tls_first_major=2
tls_first_minor=14
tls_as_opt=-a64
;;
s390-*-*)
conftest_s='
......@@ -8275,6 +8278,7 @@ foo: .long 25
bas %r14,0(%r1,%r13):tls_ldcall:foo'
tls_first_major=2
tls_first_minor=14
tls_as_opt=-m31
;;
s390x-*-*)
conftest_s='
......@@ -8292,6 +8296,7 @@ foo: .long 25
brasl %r14,__tls_get_offset@PLT:tls_ldcall:foo'
tls_first_major=2
tls_first_minor=14
tls_as_opt="-m64 -Aesame"
;;
esac
if test -z "$tls_first_major"; then
......@@ -8309,7 +8314,7 @@ fi
elif test x$gcc_cv_as != x; then
echo "$conftest_s" > conftest.s
if $gcc_cv_as --fatal-warnings -o conftest.o conftest.s > /dev/null 2>&1
if $gcc_cv_as $tls_as_opt --fatal-warnings -o conftest.o conftest.s > /dev/null 2>&1
then
gcc_cv_as_tls=yes
fi
......
......@@ -2052,6 +2052,7 @@ gcc_cv_as_tls=no
conftest_s=
tls_first_major=
tls_first_minor=
tls_as_opt=
case "$target" in
changequote(,)dnl
alpha*-*-*)
......@@ -2151,6 +2152,7 @@ x3: .space 4
addi 9,9,x2@tprel@l'
tls_first_major=2
tls_first_minor=14
tls_as_opt=-a32
;;
powerpc64-*-*)
conftest_s='
......@@ -2184,6 +2186,7 @@ x3: .space 8
nop'
tls_first_major=2
tls_first_minor=14
tls_as_opt=-a64
;;
s390-*-*)
conftest_s='
......@@ -2202,6 +2205,7 @@ foo: .long 25
bas %r14,0(%r1,%r13):tls_ldcall:foo'
tls_first_major=2
tls_first_minor=14
tls_as_opt=-m31
;;
s390x-*-*)
conftest_s='
......@@ -2219,6 +2223,7 @@ foo: .long 25
brasl %r14,__tls_get_offset@PLT:tls_ldcall:foo'
tls_first_major=2
tls_first_minor=14
tls_as_opt="-m64 -Aesame"
;;
esac
if test -z "$tls_first_major"; then
......@@ -2229,7 +2234,7 @@ elif test $in_tree_gas = yes ; then
])
elif test x$gcc_cv_as != x; then
echo "$conftest_s" > conftest.s
if $gcc_cv_as --fatal-warnings -o conftest.o conftest.s > /dev/null 2>&1
if $gcc_cv_as $tls_as_opt --fatal-warnings -o conftest.o conftest.s > /dev/null 2>&1
then
gcc_cv_as_tls=yes
fi
......
......@@ -1426,7 +1426,7 @@ profile_function (file)
FILE *file ATTRIBUTE_UNUSED;
{
#ifndef NO_PROFILE_COUNTERS
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
# define NO_PROFILE_COUNTERS 0
#endif
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
......@@ -1437,12 +1437,14 @@ profile_function (file)
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
#ifndef NO_PROFILE_COUNTERS
data_section ();
ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT));
(*targetm.asm_out.internal_label) (file, "LP", current_function_funcdef_no);
assemble_integer (const0_rtx, LONG_TYPE_SIZE / BITS_PER_UNIT, align, 1);
#endif
if (! NO_PROFILE_COUNTERS)
{
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
data_section ();
ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT));
(*targetm.asm_out.internal_label) (file, "LP", current_function_funcdef_no);
assemble_integer (const0_rtx, LONG_TYPE_SIZE / BITS_PER_UNIT, align, 1);
}
function_section (current_function_decl);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment