diff options
author | Richard Henderson <rth@redhat.com> | 2002-01-26 20:18:12 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-01-26 20:18:12 -0800 |
commit | cea3bd3e5a0a40eb90809bf90063da4911ba23b0 (patch) | |
tree | e5878dd8630022a33d8797b199100a5b12fc5c7f /gcc/config | |
parent | 1f9131b7db56276783f0276f2083c208dbf05709 (diff) | |
download | gcc-cea3bd3e5a0a40eb90809bf90063da4911ba23b0.zip gcc-cea3bd3e5a0a40eb90809bf90063da4911ba23b0.tar.gz gcc-cea3bd3e5a0a40eb90809bf90063da4911ba23b0.tar.bz2 |
Makefile.in (CRTSTUFF_CFLAGS): New.
* Makefile.in (CRTSTUFF_CFLAGS): New.
(crtbegin.o, crtend.o, crtbeginS.o, crtendS.o, crtbeginT.o): Use it.
* config.gcc (alpha-linux, alpha-freebsd, alpha-netbsd): Use plain
crtstuff.c instead of alpha assembly version.
* crtstuff.c (CRT_CALL_STATIC_FUNCTION): Rewrite to assume the
entire dummy function sequence. Use FORCE_CODE_SECTION_ALIGN
not FORCE_{INIT,FINI}_SECTION_ALIGN.
(__do_global_dtors_aux): Mark used.
(frame_dummy, __do_global_ctors_aux): Mark used.
(fini_dummy, init_dummy): Remove.
* config/alpha/crtbegin.asm: Remove file.
* config/alpha/crtend.asm: Remove file.
* config/alpha/t-crtbe: Remove file.
* config/alpha/elf.h (CRT_CALL_STATIC_FUNCTION): New.
(LINK_EH_SPEC): New.
* config/cris/cris.h (CRT_CALL_STATIC_FUNCTION): Rewrite old
FORCE_INIT_SECTION_ALIGN hack. Register __fini_start before
calling constructors.
* config/cris/linux.h (CRT_CALL_STATIC_FUNCTION): Undef.
* config/i386/i386.h (CRT_CALL_STATIC_FUNCTION): New.
* config/i386/linux.h (CRT_CALL_STATIC_FUNCTION): Replace old
CRT_END_INIT_DUMMY hack.
* config/i386/sol2.h (FORCE_CODE_SECTION_ALIGN): Replace
FORCE_{INIT,FINI}_SECTION_ALIGN.
* config/mcore/mcore-elf.h (FORCE_CODE_SECTION_ALIGN): Replace
FORCE_{INIT,FINI}_SECTION_ALIGN.
* config/s390/s390.h (CRT_CALL_STATIC_FUNCTION): Update for new
invocation sequence.
* config/sh/sh.h (CRT_CALL_STATIC_FUNCTION): Likewise.
* doc/tm.texi (CRT_CALL_STATIC_FUNCTION): Update.
(FORCE_CODE_SECTION_ALIGN): New.
From-SVN: r49261
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/alpha/crtbegin.asm | 228 | ||||
-rw-r--r-- | gcc/config/alpha/crtend.asm | 113 | ||||
-rw-r--r-- | gcc/config/alpha/elf.h | 24 | ||||
-rw-r--r-- | gcc/config/alpha/t-crtbe | 14 | ||||
-rw-r--r-- | gcc/config/cris/cris.h | 22 | ||||
-rw-r--r-- | gcc/config/cris/linux.h | 4 | ||||
-rw-r--r-- | gcc/config/i386/i386.h | 8 | ||||
-rw-r--r-- | gcc/config/i386/linux.h | 31 | ||||
-rw-r--r-- | gcc/config/i386/sol2.h | 6 | ||||
-rw-r--r-- | gcc/config/mcore/mcore-elf.h | 6 | ||||
-rw-r--r-- | gcc/config/s390/s390.h | 14 | ||||
-rw-r--r-- | gcc/config/sh/sh.h | 16 |
12 files changed, 78 insertions, 408 deletions
diff --git a/gcc/config/alpha/crtbegin.asm b/gcc/config/alpha/crtbegin.asm deleted file mode 100644 index 96725b0..0000000 --- a/gcc/config/alpha/crtbegin.asm +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Copyright (C) 1996, 1998, 2000 Free Software Foundation, Inc. - * Contributed by Richard Henderson (rth@tamu.edu) - * - * This file 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. - * - * In addition to the permissions in the GNU General Public License, the - * Free Software Foundation gives you unlimited permission to link the - * compiled version of this file with other programs, and to distribute - * those programs without any restriction coming from the use of this - * file. (The General Public License restrictions do apply in other - * respects; for example, they cover modification of the file, and - * distribution when not linked into another program.) - * - * This file 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 this program; see the file COPYING. If not, write to - * the Free Software Foundation, 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * As a special exception, if you link this library with files - * compiled with GCC to produce an executable, this does not cause - * the resulting executable to be covered by the GNU General Public License. - * This exception does not however invalidate any other reasons why - * the executable file might be covered by the GNU General Public License. - */ - -#include "auto-host.h" - - -/* - * Heads of the constructor/destructor lists. - */ - -/* The __*TOR_LIST__ symbols are not global because when this file is used - in a shared library, we do not want the symbol to fall over to the - application's lists. */ - -.section .ctors,"aw" - .align 3 -__CTOR_LIST__: - .quad -1 - -.section .dtors,"aw" - .align 3 -__DTOR_LIST__: - .quad -1 - -.section .jcr,"aw" - .align 3 -__JCR_LIST__: - -.section .eh_frame,"aw" -__EH_FRAME_BEGIN__: - -/* - * Fragment of the ELF _fini routine that invokes our dtor cleanup. - */ - -.section .fini,"ax" - - /* Since the bits of the _fini function are spread across many - object files, each potentially with its own GP, we must - assume we need to load ours. Further, our .fini section - can easily be more than 4MB away from our .text bits so we - can't use bsr. */ - - br $29,1f -1: ldgp $29,0($29) - jsr $26,__do_global_dtors_aux - - /* Must match the alignment we got from crti.o else we get - zero-filled holes in our _fini function and then SIGILL. */ - .align 3 - -/* - * Fragment of the ELF _init routine that sets up the frame info. - */ - -.section .init,"ax" - br $29,1f -1: ldgp $29,0($29) - jsr $26,__do_frame_setup - .align 3 - -/* - * Invoke our destructors in order. - */ - -.section .sdata - -/* Support recursive calls to exit. */ - .type dtor_ptr,@object - .size dtor_ptr,4 -dtor_ptr: - .gprel32 __DTOR_LIST__ + 8 - -/* A globally unique widget for c++ local destructors to hang off. - - This has a unique value in every dso; in the main program its - value is zero. The object should be protected. This means the - instance in any dso or the main program is not used in any other - dso. The dynamic linker takes care of this. */ - - .global __dso_handle - .type __dso_handle,@object - .size __dso_handle,8 -#ifdef SHARED -.section .data - .align 3 -__dso_handle: - .quad __dso_handle -#else -.section .bss - .align 3 -__dso_handle: - .zero 8 -#endif -#ifdef HAVE_GAS_HIDDEN - .hidden __dso_handle -#endif - -.text - - .align 3 - .ent __do_global_dtors_aux - -__do_global_dtors_aux: - ldgp $29,0($27) - lda $30,-16($30) - .frame $30,16,$26,0 - stq $9,8($30) - stq $26,0($30) - .mask 0x4000200,-16 - .prologue 1 - -#ifdef SHARED - /* Do c++ local destructors. */ - lda $1,__cxa_finalize - beq $1,0f - lda $16,__dso_handle - jsr $26,__cxa_finalize - ldgp $29,0($26) -#endif - -0: lda $9,dtor_ptr - br 2f -1: stl $1,0($9) - jsr $26,($27) - ldgp $29,0($26) -2: ldl $1,0($9) - addq $1,$29,$2 - ldq $27,0($2) - addl $1,8,$1 - bne $27,1b - - /* Remove our frame info. */ - lda $1,__deregister_frame_info - beq $1,3f - lda $16,__EH_FRAME_BEGIN__ - jsr $26,__deregister_frame_info - ldgp $29,0($26) - -3: ldq $26,0($30) - ldq $9,8($30) - lda $30,16($30) - ret - - .end __do_global_dtors_aux - -/* - * Install our frame info; register java classes, if any. - */ - -.section .bss - .type frame_object,@object - .size frame_object, 48 - .align 3 -frame_object: - .zero 48 - -.text - - .align 3 - .ent __do_frame_setup - -__do_frame_setup: - ldgp $29,0($27) - lda $30,-16($30) - .frame $30,16,$26,0 - stq $26,0($30) - .mask 0x4000000,-16 - .prologue 1 - - lda $1,__register_frame_info - beq $1,0f - lda $16,__EH_FRAME_BEGIN__ - lda $17,frame_object - jsr $26,__register_frame_info - ldgp $29,0($26) - -0: lda $1,_Jv_RegisterClasses - lda $16,__JCR_LIST__ - beq $1,0f - ldq $2,8($16) - beq $2,0f - jsr $26,_Jv_RegisterClasses - ldgp $29,0($26) - -0: ldq $26,0($30) - lda $30,16($30) - ret - - .end __do_frame_setup - -.weak __register_frame_info -.weak __deregister_frame_info -#ifdef SHARED -.weak __cxa_finalize -#endif -.weak _Jv_RegisterClasses diff --git a/gcc/config/alpha/crtend.asm b/gcc/config/alpha/crtend.asm deleted file mode 100644 index 1ffd808..0000000 --- a/gcc/config/alpha/crtend.asm +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (C) 1996, 2000 Free Software Foundation, Inc. - * Contributed by Richard Henderson (rth@tamu.edu) - * - * This file 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. - * - * In addition to the permissions in the GNU General Public License, the - * Free Software Foundation gives you unlimited permission to link the - * compiled version of this file with other programs, and to distribute - * those programs without any restriction coming from the use of this - * file. (The General Public License restrictions do apply in other - * respects; for example, they cover modification of the file, and - * distribution when not linked into another program.) - * - * This file 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 this program; see the file COPYING. If not, write to - * the Free Software Foundation, 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * As a special exception, if you link this library with files - * compiled with GCC to produce an executable, this does not cause - * the resulting executable to be covered by the GNU General Public License. - * This exception does not however invalidate any other reasons why - * the executable file might be covered by the GNU General Public License. - */ - -/* - * Tails of the constructor/destructor lists. - */ - -/* The __*TOR_END__ symbols are not global because when this file is used - in a shared library, we do not want the symbol to fall over to the - application's lists. */ - -.section .ctors,"aw" - .align 3 -__CTOR_END__: - .quad 0 - -.section .dtors,"aw" - .align 3 -__DTOR_END__: - .quad 0 - -.section .jcr,"aw" - .align 3 -__JCR_END__: - .quad 0 - -.section .eh_frame,"aw" -__FRAME_END__: - .quad 0 - -/* - * Fragment of the ELF _init routine that invokes our ctor startup - */ - -.section .init,"ax" - - /* Since the bits of the _init function are spread across many - object files, each potentially with its own GP, we must - assume we need to load ours. Further, our .init section - can easily be more than 4MB away from our .text bits so we - can't use bsr. */ - - br $29,1f -1: ldgp $29,0($29) - jsr $26,__do_global_ctors_aux - - /* Must match the alignment we got from crti.o else we get - zero-filled holes in our _init function and thense SIGILL. */ - .align 3 - -/* - * Invoke our constructors in order. - */ - -.text - - .align 3 - .ent __do_global_ctors_aux - -__do_global_ctors_aux: - ldgp $29,0($27) - lda $30,-16($30) - .frame $30,16,$26,0 - stq $9,8($30) - stq $26,0($30) - .mask 0x4000200,-16 - .prologue 1 - - lda $9,__CTOR_END__-8 - br 1f -0: jsr $26,($27) -1: ldq $27,0($9) - subq $9,8,$9 - not $27,$0 - bne $0,0b - - ldq $26,0($30) - ldq $9,8($30) - lda $30,16($30) - ret - - .end __do_global_ctors_aux diff --git a/gcc/config/alpha/elf.h b/gcc/config/alpha/elf.h index 7e9b4d8..b4ed0d0 100644 --- a/gcc/config/alpha/elf.h +++ b/gcc/config/alpha/elf.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for DEC Alpha w/ELF. - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Richard Henderson (rth@tamu.edu). @@ -642,3 +642,25 @@ do { \ alpha_this_gpdisp_sequence_number = 0) extern int alpha_this_literal_sequence_number; extern int alpha_this_gpdisp_sequence_number; + +/* Since the bits of the _init and _fini function is spread across + many object files, each potentially with its own GP, we must assume + we need to load our GP. Further, the .init/.fini section can + easily be more than 4MB away from the function to call so we can't + use bsr. */ +#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ + asm (SECTION_OP "\n" \ +" br $29,1f\n" \ +"1: ldgp $29,0($29)\n" \ +" unop\n" \ +" jsr $26," USER_LABEL_PREFIX #FUNC "\n" \ +" .align 3\n" \ +" .previous"); + +/* If we have the capability create headers for efficient EH lookup. + As of Jan 2002, only glibc 2.2.4 can actually make use of this, but + I imagine that other systems will catch up. In the meantime, it + doesn't harm to make sure that the data exists to be used later. */ +#if defined(HAVE_LD_EH_FRAME_HDR) +#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " +#endif diff --git a/gcc/config/alpha/t-crtbe b/gcc/config/alpha/t-crtbe deleted file mode 100644 index 384237b..0000000 --- a/gcc/config/alpha/t-crtbe +++ /dev/null @@ -1,14 +0,0 @@ -# Effectively disable the crtbegin/end rules using crtstuff.c -T = disable - -EXTRA_PARTS += crtbegin.o crtend.o crtbeginS.o crtendS.o - -# Assemble startup files. -crtbegin.o: $(srcdir)/config/alpha/crtbegin.asm $(GCC_PASSES) - $(GCC_FOR_TARGET) -c -o crtbegin.o -x assembler-with-cpp -I. $(srcdir)/config/alpha/crtbegin.asm -crtend.o: $(srcdir)/config/alpha/crtend.asm $(GCC_PASSES) - $(GCC_FOR_TARGET) -c -o crtend.o -x assembler-with-cpp -I. $(srcdir)/config/alpha/crtend.asm -crtbeginS.o: $(srcdir)/config/alpha/crtbegin.asm $(GCC_PASSES) - $(GCC_FOR_TARGET) -DSHARED -c -o crtbeginS.o -x assembler-with-cpp -I. $(srcdir)/config/alpha/crtbegin.asm -crtendS.o: $(srcdir)/config/alpha/crtend.asm $(GCC_PASSES) - $(GCC_FOR_TARGET) -DSHARED -c -o crtendS.o -x assembler-with-cpp -I. $(srcdir)/config/alpha/crtend.asm diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h index 5999bfb..f92a3b3 100644 --- a/gcc/config/cris/cris.h +++ b/gcc/config/cris/cris.h @@ -1451,14 +1451,20 @@ struct cum_args {int regs;}; /* We pull a little trick to register the _fini function with atexit, after (presumably) registering the eh frame info, since we don't handle _fini (a.k.a. ___fini_start) in crt0 or have a crti for "pure" ELF. */ -#ifdef CRT_BEGIN -#define FORCE_INIT_SECTION_ALIGN \ - do \ - { \ - extern void __fini__start (void); \ - atexit (__fini__start); \ - } \ - while (0) +#ifdef CRT_END +# define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ +static void __attribute__((__used__)) \ +call_ ## FUNC (void) \ +{ \ + asm (SECTION_OP); \ + if (__builtin_strcmp (#FUNC, "__do_global_ctors_aux") == 0) \ + { \ + extern void __fini__start (void); \ + atexit (__fini__start); \ + } \ + FUNC (); \ + asm (TEXT_SECTION_ASM_OP); \ +} #endif /* Node: PIC */ diff --git a/gcc/config/cris/linux.h b/gcc/config/cris/linux.h index 54a1808..5949937 100644 --- a/gcc/config/cris/linux.h +++ b/gcc/config/cris/linux.h @@ -102,8 +102,8 @@ Boston, MA 02111-1307, USA. */ /* Node: Sections */ /* GNU/Linux has crti and crtn and does not need the - FORCE_INIT_SECTION_ALIGN trick in cris.h. */ -#undef FORCE_INIT_SECTION_ALIGN + CRT_CALL_STATIC_FUNCTION trick in cris.h. */ +#undef CRT_CALL_STATIC_FUNCTION /* * Local variables: diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 4f2b903..25705e6 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -2911,6 +2911,14 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER]; #define ASM_SIMPLIFY_DWARF_ADDR(X) \ i386_simplify_dwarf_addr (X) + +/* Switch to init or fini section via SECTION_OP, emit a call to FUNC, + and switch back. For x86 we do this only to save a few bytes that + would otherwise be unused in the text section. */ +#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ + asm (SECTION_OP "\n\t" \ + "call " USER_LABEL_PREFIX #FUNC "\n" \ + TEXT_SECTION_ASM_OP); /* Print operand X (an rtx) in assembler syntax to file FILE. CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified. diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h index 63006b3..de634d3 100644 --- a/gcc/config/i386/linux.h +++ b/gcc/config/i386/linux.h @@ -1,5 +1,6 @@ /* Definitions for Intel 386 running Linux-based GNU systems with ELF format. - Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002 + Free Software Foundation, Inc. Contributed by Eric Youngdale. Modified for stabs-in-ELF by H.J. Lu. @@ -167,20 +168,20 @@ Boston, MA 02111-1307, USA. */ #if defined(__PIC__) && defined (USE_GNULIBC_1) /* This is a kludge. The i386 GNU/Linux dynamic linker needs ___brk_addr, - __environ and atexit (). We have to make sure they are in the .dynsym - section. We accomplish it by making a dummy call here. This - code is never reached. */ - -#define CRT_END_INIT_DUMMY \ - do \ - { \ - extern void *___brk_addr; \ - extern char **__environ; \ - \ - ___brk_addr = __environ; \ - atexit (0); \ - } \ - while (0) + __environ and atexit. We have to make sure they are in the .dynsym + section. We do this by forcing the assembler to create undefined + references to these symbols in the object file. */ +#undef CRT_CALL_STATIC_FUNCTION +#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ + asm (SECTION_OP "\n\t" \ + "call " USER_LABEL_PREFIX #FUNC "\n" \ + TEXT_SECTION_ASM_OP "\n\t" \ + ".extern ___brk_addr\n\t" \ + ".type ___brk_addr,@object\n\t" \ + ".extern __environ\n\t" \ + ".type __environ,@object\n\t" \ + ".extern atexit\n\t" \ + ".type atexit,@function"); #endif /* Handle special EH pointer encodings. Absolute, pc-relative, and diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h index ff1585e..fb9d745 100644 --- a/gcc/config/i386/sol2.h +++ b/gcc/config/i386/sol2.h @@ -1,5 +1,5 @@ /* Target definitions for GNU compiler for Intel 80386 running Solaris 2 - Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Fred Fish (fnf@cygnus.com). @@ -56,9 +56,7 @@ Boston, MA 02111-1307, USA. */ two 0x00000090 ints, which generates a segmentation violation when executed. This macro forces the assembler to do the padding, since it knows what it is doing. */ - -#define FORCE_INIT_SECTION_ALIGN asm (ALIGN_ASM_OP ## "16") -#define FORCE_FINI_SECTION_ALIGN FORCE_INIT_SECTION_ALIGN +#define FORCE_CODE_SECTION_ALIGN asm(ALIGN_ASM_OP "16"); /* Select a format to encode pointers in exception handling data. CODE is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is diff --git a/gcc/config/mcore/mcore-elf.h b/gcc/config/mcore/mcore-elf.h index 45cb3e8..8cb8d1b 100644 --- a/gcc/config/mcore/mcore-elf.h +++ b/gcc/config/mcore/mcore-elf.h @@ -1,5 +1,5 @@ /* Definitions of MCore target. - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Cygnus Solutions. This file is part of GNU CC. @@ -158,11 +158,9 @@ exports_section () \ #undef ENDFILE_SPEC #define ENDFILE_SPEC "%{!mno-lsim:-lsim} crtend.o%s crtn.o%s" - /* The subroutine calls in the .init and .fini sections create literal pools which must be jumped around... */ -#define FORCE_INIT_SECTION_ALIGN asm ("br 1f ; .literals ; 1:") -#define FORCE_FINI_SECTION_ALIGN asm ("br 1f ; .literals ; 1:") +#define FORCE_CODE_SECTION_ALIGN asm ("br 1f ; .literals ; 1:"); #undef CTORS_SECTION_ASM_OP #define CTORS_SECTION_ASM_OP "\t.section\t.ctors,\"aw\"" diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h index 57e39aa..99e1ef9 100644 --- a/gcc/config/s390/s390.h +++ b/gcc/config/s390/s390.h @@ -1299,15 +1299,13 @@ extern struct rtx_def *s390_compare_op0, *s390_compare_op1; /* S/390 constant pool breaks the devices in crtstuff.c to control section in where code resides. We have to write it as asm code. */ #ifndef __s390x__ -#define CRT_CALL_STATIC_FUNCTION(func) \ - if (0) \ - func (); /* ... to avoid warnings. */ \ - else \ - asm \ - ("bras\t%%r2,1f\n\ -0: .long\t" #func " - 0b\n\ +#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ + asm (SECTION_OP "\n\ + bras\t%%r2,1f\n\ +0: .long\t" USER_LABEL_PREFIX #FUNC " - 0b\n\ 1: l\t%%r3,0(%%r2)\n\ - bas\t%%r14,0(%%r3,%%r2)" : : : "2", "3", "cc", "memory"); + bas\t%%r14,0(%%r3,%%r2)\n\ + .previous"); #endif /* Constant Pool for all symbols operands which are changed with diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h index 98939de..0985a37 100644 --- a/gcc/config/sh/sh.h +++ b/gcc/config/sh/sh.h @@ -2301,21 +2301,15 @@ extern struct rtx_def *fpscr_rtx; /* SH constant pool breaks the devices in crtstuff.c to control section in where code resides. We have to write it as asm code. */ -#define CRT_CALL_STATIC_FUNCTION(func) \ - if (0) \ - /* This avoids warnings about the static function being unused. */ \ - func (); \ - else \ - /* We should be passing FUNC to the asm statement as an asm input \ - operand, but this breaks with -fPIC. FIXME. */ \ - asm \ - ("mov.l 1f,r1\n\ +#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ + asm (SECTION_OP "\n\ + mov.l 1f,r1\n\ mova 2f,r0\n\ braf r1\n\ lds r0,pr\n\ 0: .p2align 2\n\ -1: .long " USER_LABEL_PREFIX #func " - 0b\n\ -2:") +1: .long " USER_LABEL_PREFIX #FUNC " - 0b\n\ +2:\n" TEXT_SECTION_ASM_OP); #define ALLOCATE_INITIAL_VALUE(hard_reg) \ (REGNO (hard_reg) == PR_REG \ |