2019-01-01 13:31:55 +01:00
|
|
|
/* Copyright (C) 2001-2019 Free Software Foundation, Inc.
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
Contributed by Jakub Jelinek <jakub@redhat.com>.
|
|
|
|
|
c-pch.c, [...]: Replace "GNU CC" with "GCC".
* c-pch.c, dummy-conditions.c, genautomata.c, genconditions.c,
langhooks.c, tree-inline.c, unwind-dw2-fde-darwin.c,
unwind-dw2-fde-glibc.c, unwind-libunwind.c, vmsdbgout.c: Replace
"GNU CC" with "GCC".
From-SVN: r64297
2003-03-13 04:48:31 +01:00
|
|
|
This file is part of GCC.
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
|
c-pch.c, [...]: Replace "GNU CC" with "GCC".
* c-pch.c, dummy-conditions.c, genautomata.c, genconditions.c,
langhooks.c, tree-inline.c, unwind-dw2-fde-darwin.c,
unwind-dw2-fde-glibc.c, unwind-libunwind.c, vmsdbgout.c: Replace
"GNU CC" with "GCC".
From-SVN: r64297
2003-03-13 04:48:31 +01:00
|
|
|
GCC is free software; you can redistribute it and/or modify
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
it under the terms of the GNU General Public License as published by
|
2009-04-09 17:00:19 +02:00
|
|
|
the Free Software Foundation; either version 3, or (at your option)
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
any later version.
|
|
|
|
|
c-pch.c, [...]: Replace "GNU CC" with "GCC".
* c-pch.c, dummy-conditions.c, genautomata.c, genconditions.c,
langhooks.c, tree-inline.c, unwind-dw2-fde-darwin.c,
unwind-dw2-fde-glibc.c, unwind-libunwind.c, vmsdbgout.c: Replace
"GNU CC" with "GCC".
From-SVN: r64297
2003-03-13 04:48:31 +01:00
|
|
|
GCC is distributed in the hope that it will be useful,
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
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.
|
|
|
|
|
2009-04-09 17:00:19 +02:00
|
|
|
Under Section 7 of GPL version 3, you are granted additional
|
|
|
|
permissions described in the GCC Runtime Library Exception, version
|
|
|
|
3.1, as published by the Free Software Foundation.
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
|
2009-04-09 17:00:19 +02:00
|
|
|
You should have received a copy of the GNU General Public License and
|
|
|
|
a copy of the GCC Runtime Library Exception along with this program;
|
|
|
|
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
|
|
|
|
/* Locate the FDE entry for a given address, using PT_GNU_EH_FRAME ELF
|
|
|
|
segment and dl_iterate_phdr to avoid register/deregister calls at
|
|
|
|
DSO load/unload. */
|
|
|
|
|
2002-02-04 23:21:12 +01:00
|
|
|
#ifndef _GNU_SOURCE
|
|
|
|
#define _GNU_SOURCE 1
|
|
|
|
#endif
|
|
|
|
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
#include "tconfig.h"
|
2002-12-16 19:23:00 +01:00
|
|
|
#include "tsystem.h"
|
2012-10-06 01:35:55 +02:00
|
|
|
#if !defined(inhibit_libc) && !defined(__OpenBSD__)
|
2010-09-07 23:14:41 +02:00
|
|
|
#include <elf.h> /* Get DT_CONFIG. */
|
2002-01-25 12:22:52 +01:00
|
|
|
#endif
|
2002-12-16 19:23:00 +01:00
|
|
|
#include "coretypes.h"
|
|
|
|
#include "tm.h"
|
Move libgcc_tm_file to toplevel libgcc
gcc:
* configure.ac (libgcc_tm_file_list, libgcc_tm_include_list):
Remove.
* configure: Regenerate.
* Makefile.in (libgcc_tm_file_list, libgcc_tm_include_list): Remove.
(TM_H): Remove libgcc_tm.h, $(libgcc_tm_file_list).
(libgcc_tm.h, cs-libgcc_tm.h): Remove.
(clean): Remove libgcc_tm.h
* mkconfig.sh: Don't include libgcc_tm.h in tm.h.
* config.gcc (libgcc_tm_file): Remove.
(arm*-*-linux*): Remove libgcc_tm_file for arm*-*-linux-*eabi.
(arm*-*-uclinux*): Remove libgcc_tm_file for arm*-*-uclinux*eabi.
(arm*-*-eabi*, arm*-*-symbianelf*): Remove libgcc_tm_file.
(avr-*-rtems*): Likewise.
(avr-*-*): Likewise.
(frv-*-elf): Likewise.
(frv-*-*linux*): Likewise.
(h8300-*-rtems*): Likewise.
(h8300-*-elf*): Likewise.
(i[34567]86-*-darwin*): Likewise.
(x86_64-*-darwin*): Likewise.
(rx-*-elf*): Likewise.
(tic6x-*-elf): Likewise.
(tic6x-*-uclinux): Likewise.
(i[34567]86-*-linux*, x86_64-*-linux*): Likewise.
libgcc:
* configure.ac (tm_file_): New variable.
Determine from tm_file.
(tm_file, tm_defines): Substitute.
* configure: Regenerate.
* mkheader.sh: New file.
* Makefile.in (clean): Remove libgcc_tm.h.
($(objects)): Depend on libgcc_tm.h.
(libgcc_tm_defines, libgcc_tm_file): New variables.
(libgcc_tm.h, libgcc_tm.stamp): New targets.
($(libgcc-objects), $(libgcc-s-objects), $(libgcc-eh-objects))
($(libgcov-objects), $(libunwind-objects), $(libunwind-s-objects))
($(extra-parts)): Depend on libgcc_tm.h.
* config.host (tm_defines, tm_file): New variable.
(arm*-*-linux*): Set tm_file for arm*-*-linux-*eabi.
(arm*-*-uclinux*): Set tm_file for arm*-*-uclinux*eabi.
(arm*-*-eabi*, arm*-*-symbianelf*): Set tm_file.
(avr-*-rtems*): Likewise.
(avr-*-*): Likewise.
(frv-*-elf): Likewise.
(frv-*-*linux*): Likewise.
(h8300-*-rtems*): Likewise.
(h8300-*-elf*): Likewise.
(i[34567]86-*-darwin*): Likewise.
(x86_64-*-darwin*): Likewise.
(rx-*-elf): Likewise.
(tic6x-*-uclinux): Likewise.
(tic6x-*-elf): Likewise.
(i[34567]86-*-linux*, x86_64-*-linux*): Likewise.
* config/alpha/gthr-posix.c: Include libgcc_tm.h.
* config/i386/cygming-crtbegin.c: Likewise.
* config/i386/cygming-crtend.c: Likewise.
* config/ia64/fde-vms.c: Likewise.
* config/ia64/unwind-ia64.c: Likewise.
* config/libbid/bid_gcc_intrinsics.h: Likewise.
* config/rs6000/darwin-fallback.c: Likewise.
* config/stormy16/lib2funcs.c: Likewise.
* config/xtensa/unwind-dw2-xtensa.c: Likewise.
* crtstuff.c: Likewise.
* dfp-bit.h: Likewise.
* emutls.c: Likewise.
* fixed-bit.c: Likewise.
* fp-bit.c: Likewise.
* generic-morestack-thread.c: Likewise.
* generic-morestack.c: Likewise.
* libgcc2.c: Likewise.
* libgcov.c: Likewise.
* unwind-dw2-fde-dip.c: Likewise.
* unwind-dw2-fde.c: Likewise.
* unwind-dw2.c: Likewise.
* unwind-sjlj.c: Likewise.
Co-Authored-By: Paolo Bonzini <bonzini@gnu.org>
From-SVN: r180775
2011-11-02 16:26:35 +01:00
|
|
|
#include "libgcc_tm.h"
|
2009-07-09 21:41:25 +02:00
|
|
|
#include "dwarf2.h"
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
#include "unwind.h"
|
|
|
|
#define NO_BASE_OF_ENCODED_VALUE
|
|
|
|
#include "unwind-pe.h"
|
|
|
|
#include "unwind-dw2-fde.h"
|
2004-09-04 02:15:42 +02:00
|
|
|
#include "unwind-compat.h"
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
#include "gthr.h"
|
|
|
|
|
2002-01-25 12:22:52 +01:00
|
|
|
#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
&& (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
|
|
|
|
|| (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
|
2009-09-22 18:28:26 +02:00
|
|
|
# define USE_PT_GNU_EH_FRAME
|
|
|
|
#endif
|
|
|
|
|
2012-04-25 00:41:33 +02:00
|
|
|
#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
|
|
|
&& defined(__BIONIC__)
|
|
|
|
# define USE_PT_GNU_EH_FRAME
|
|
|
|
#endif
|
|
|
|
|
2015-04-22 16:20:01 +02:00
|
|
|
#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
|
|
|
&& defined(TARGET_DL_ITERATE_PHDR) \
|
|
|
|
&& defined(__linux__)
|
|
|
|
# define USE_PT_GNU_EH_FRAME
|
|
|
|
#endif
|
|
|
|
|
2009-09-22 18:28:26 +02:00
|
|
|
#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
2014-05-21 13:08:58 +02:00
|
|
|
&& defined(TARGET_DL_ITERATE_PHDR) \
|
|
|
|
&& (defined(__DragonFly__) || defined(__FreeBSD__))
|
2009-09-22 18:28:26 +02:00
|
|
|
# define ElfW __ElfN
|
|
|
|
# define USE_PT_GNU_EH_FRAME
|
|
|
|
#endif
|
|
|
|
|
2012-10-06 01:35:55 +02:00
|
|
|
#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
2016-12-19 10:21:09 +01:00
|
|
|
&& (defined(__OpenBSD__) || defined(__NetBSD__))
|
2012-10-06 01:35:55 +02:00
|
|
|
# define ElfW(type) Elf_##type
|
|
|
|
# define USE_PT_GNU_EH_FRAME
|
|
|
|
#endif
|
|
|
|
|
2010-12-23 13:08:21 +01:00
|
|
|
#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
|
|
|
&& defined(TARGET_DL_ITERATE_PHDR) \
|
|
|
|
&& defined(__sun__) && defined(__svr4__)
|
|
|
|
# define USE_PT_GNU_EH_FRAME
|
|
|
|
#endif
|
|
|
|
|
2009-09-22 18:28:26 +02:00
|
|
|
#if defined(USE_PT_GNU_EH_FRAME)
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
|
2010-09-07 23:14:41 +02:00
|
|
|
#include <link.h>
|
|
|
|
|
Implement FR-V FDPIC ABI support for frv-uclinux and frv-linux.
2004-02-05 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_emit_movsi): Use GOT relocations for
symbols in sections named by the user.
2004-01-30 Alexandre Oliva <aoliva@redhat.com>
* config/frv/linux.h (TARGET_OS_CPP_BUILTINS): New.
2004-01-27 Alexandre Oliva <aoliva@redhat.com>
* config.gcc (frv-*-*linux*): Handle like *-*-linux*.
* config/frv/t-linux (EXTRA_MULTILIB_PARTS): Remove, obviated by
the above.
2004-01-20 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.md (symGOT2reg_hilo, symGOTOFF2reg_hilo): Add
one more pseudo to further improve code generation.
2004-01-19 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.md (movdi_ldd): Introduce explicit indirection
inside UNSPEC.
2004-01-16 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_legitimate_address_p): Added
allow_double_reg_p argument. Adjust all callers. Use it to
decide whether to enable double-register indirect addressing.
(frv_funcdesc_alias_set): Remove.
(frv_expand_fdpic_call): Force non-SYMBOL_REF operand into
register. Emit movdi_ldd.
(ldd_address_operand): New.
* config/frv/frv-protos.h (frv_legitimate_address_p): Adjust.
* config/frv/frv.h (GO_IF_LEGITIMATE_ADDRESS): Likewise.
(PREDICATE_CODES): Add ldd_address_operand.
* config/frv/frv.md (movdi_ldd): New.
(symGOT2reg_hilo, symGOTOFF2reg_hilo): Use separate pseudo for
intermediate computations if possible.
(symGOTOFF2reg_i): Fix harmless typo.
2003-12-18 Alexandre Oliva <aoliva@redhat.com>
* unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Cast
relocated p_vaddr to vaddr type.
* config/frv/frv-protos.h (frv_expand_fdpic_call): Return void.
* config/frv/frv.c (frv_get_funcdesc_alias_set): New.
(frv_expand_fdpic_call): Propagate incoming MEM's expr to funcdesc
MEM, or use a funcdesc alias set. Use regular move instead of
ldd.
(dbl_memory_one_insn_operand): Recognize function descriptors by
type or by alias set, and don't split them.
* config/frv/frv.md (call, call_value): Never use call_internal
for fdpic.
(call_internal, call_value_internal): Never match for FDPIC.
(call_fdpicdi, call_fdpicsi, call_value_fdpicdi,
call_value_fdpicsi): Require FDPIC.
(ldd): Removed.
2003-12-17 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.h (CRT_GET_RFIB_DATA): Define for __FRV_FDPIC__.
* unwind-dw2-fde-glibc.c: Don't include elf-fdpic.h any more.
(_Unwind_IteratePhdrCallback): Adjust type of load_base for FRV
FDPIC. Compute data base address.
* config/frv/linux.h (SUBTARGET_DRIVER_SELF_SPECS): Enable -mfdpic
before the other self-specs are processed.
* config/frv/t-linux (CRTSTUFF_T_CFLAGS, TARGET_LIBGCC2_CFLAGS):
Build with -fPIC.
2003-12-15 Alexandre Oliva <aoliva@redhat.com>
* unwind-dw2-fde-glibc.c: Don't include bits/elf-fdpic.h if
inhibit_libc is defined.
2003-12-12 Alexandre Oliva <aoliva@redhat.com>
* unwind-dw2-fde-glibc.c: Include bits/elf-fdpic.h for
__FRV_FDPIC__.
(__RELOC_POINTER): Define.
(_Unwind_IteratePhdrCallback): Use it.
* config/frv/frv.h (Twrite): Define.
(TRANSFER_FROM_TRAMPOLINE): Use it.
* config/frv/linux.h (INVOKE__main): Undefine.
(Twrite): Override.
2003-12-05 Richard Sandiford <rsandifo@redhat.com>
* doc/invoke.texi (-mlong-calls, -mlinked-fp): Document FRV options.
(-mlibrary-pic): Emphasize that this option generates EABI code.
(-mcpu): Add fr550.
(-mpack): Remove.
2003-11-30 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (int_2word_operand): Reject LABELs, SYMBOL_REFs
and CONSTs in FDPIC mode.
* gcc/config.gcc (with_cpu): Default to fr400 on frv-*-*linux*.
2003-11-29 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.c (move_source_operand): Don't accept symbolic
constants.
* config/frv/frv.md (*movhi_internal, *movsi_internal): Use an 'n'
rather than 'i' constraint for the 2-instruction alternative.
(*movsi_2word): New, incorporating existing int_2word_operand splitter.
2003-11-29 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.h (EXTRA_CONSTRAINT_FOR_Q): Renamed from
EXTRA_CONSTRAINT_FOR_Y.
(EXTRA_CONSTRAINT): Remove handling of 'Y'.
* config/frv/frv.md (*movsi_internal): Remove 'Q' constraint.
(addsi3): Change 'Y' constraint to 'Q'.
2003-11-27 Richard Sandiford <rsandifo@redhat.com>
* reload.c (CONST_POOL_OK_P): New macro.
(find_reloads): Use it to decide whether a constant can be forced
into memory.
* config/frv/frv.h (LEGITIMATE_PIC_OPERAND_P): Return true if the
constant satisfies got12_operand.
(frv_cannot_force_const_mem): Always return true for TARGET_FDPIC.
(frv_legitimate_address_p): Check for valid unspec offsets using
got12_operand rather than frv_legitimate_fdpic_operand_p.
(frv_legitimate_fdpic_operand_p): Delete.
(frv_emit_movsi): Abort if we try to use the FDPIC register during
or after reload.
(frv_legitimate_constant_p): Return LEGITIMATE_PIC_OPERAND_P if
TARGET_FDPIC.
* config/frv/frv.md (*movdf_double): Add alternatives for CONST_DOUBLE.
2003-11-19 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-protos.h (fdpic_operand, fdpic_got12_operand)
(frv_fdpic_fptr_operand): Don't declare here.
* config/frv/frv.h (EXTRA_CONSTRAINT_FOR_Y): Call got12_operand
rather than fdpic_got12_operand.
(PREDICATE_CODES): Remove symbolic_operand entry. Add entries for
got12_operand and const_unspec_operand.
* config/frv/frv.c (got12_operand): Renamed from fdpic_got12_operand.
(gpr_or_int12_operand, dbl_memory_one_insn_operand): Update calls.
(symbolic_operand): Remove.
(const_unspec_operand): New predicate.
* config/frv/frv.md (*movsi_got): Use got12_operand.
(*movsi_high_got, *movsi_lo_sum_got): Use const_unspec_operand.
2003-11-18 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-protos.h (frv_output_addr_const_extra): Remove.
* config/frv/frv.h (OUTPUT_ADDR_CONST_EXTRA): Remove definition.
* config/frv/frv.c (frv_unspec): New structure.
(frv_small_data_reloc_p, frv_const_unspec_p): New functions.
(frv_print_operand_memory_reference): Use frv_const_unspec_p to
validate CONST indices. Use frv_output_const_unspec to print them.
(frv_print_operand): Update call to unspec_got_name. Use
frv_output_const_unspec to print constant unspecs.
(frv_legitimate_fdpic_operand_p): Return true if frv_const_unspec_p.
Reject UNSPECs otherwise.
(unspec_got_name): Take the relocation number as argument, not an
rtx containing it.
(frv_output_addr_const_extra): Remove, replacing with...
(frv_output_const_unspec): ...this new function.
(frv_find_base_term): Use frv_const_unspec_p & frv_small_data_reloc_p.
(gpr_or_int12_operand): Use fdpic_got12_operand.
(dbl_memory_one_insn_operand): Likewise.
(fdpic_got12_operand): Use frv_const_unspec_p.
(frv_emit_movsi): Use frv_const_unspec_p to check for CONSTs that
are already legitimate. Use frv_small_data_reloc_p when deciding
whether to use HIGH/LO_SUM for R_FRV_GOTOFF12 and R_FRV_GPREL12.
2003-11-18 Alexandre Oliva <aoliva@redhat.com>
* config/frv/t-linux (SHLIB_MAPFILES): Override so as to export...
* config/frv/libgcc-frv.ver: ... frv-specific symbols. New file.
* config/frv/frv-abi.h (CREATE_DOUBLE_SHIFT): Use branch to local
label, for real this time.
* config/frv/frv.c (frv_local_funcdesc_p): Update to new
representation of visibility.
(fdpic_got12_operand, symbolic_operand): Mark unused arguments as
such.
2003-11-17 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.h (MASK_LINKED_FP, TARGET_LINKED_FP): New macros.
(TARGET_SWITCHES): Add -mlinked-fp and -mno-linked-fp.
* config/frv/frv.c (frv_override_options): Set MASK_LINKED_FP unless
it was explicitly disabled.
(frv_stack_info): There is no need to save the link register in every
frame unless TARGET_LINKED_FP is true.
(frv_frame_pointer_required): If !TARGET_LINKED_FP, only require a
frame pointer if the stack pointer might change value.
(frv_return_addr_rtx): Check and process "count" argument.
2003-11-14 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-protos.h (frv_legitimize_address): Remove.
(frv_find_base_term): Declare.
* config/frv/frv.h (LEGITIMIZE_ADDRESS): Do nothing.
(FIND_BASE_TERM): Define.
(PREDICATE_CODES): Remove pic_register_operand, pic_symbolic_operand,
small_data_register_operand, small_data_symbolic_operand. Add
symbolic_operand.
* config/frv/frv.c (const_small_data_p, plus_small_data_p): Delete.
(frv_print_operand_memory_reference, output_move_single): Remove
special handling for unlegitimized sdata addresses.
(frv_legitimate_address_p): Don't allow sums of SDA_BASE_REG
and symbolic addresses.
(frv_legitimize_address, frv_legitimize_fdpic_address): Delete.
(frv_find_base_term): New function.
(int_2word_operand): Check specifically for symbolic address constants.
(pic_register_operand, pic_symbolic_operand): Delete.
(small_data_register_operand, small_data_symbolic_operand): Delete.
(dbl_memory_one_insn_operand): Don't call plus_small_data_p.
Allow UNSPEC_GOT constants if !TARGET_FDPIC.
(move_source_operand): Only accept CONSTs if they're a two-insn
symbolic constant.
(fdpic_got12_operand): Don't require TARGET_FDPIC.
(frv_emit_movsi): Legitimize sdata and -mlibrary-pic addresses
using gen_symGOTOFF2reg*.
(frv_ifcvt_rewrite_mem): Remove (plus gr16 ...) special cases.
(frv_rtx_costs): Give all MEM addresses a cost of 0. Give MEMs
themselves a cost of 3 insns.
* config/mips/mips.md (*movsi_got): Allow for !TARGET_FDPIC too.
Change predicate to symbolic_operand.
(*movsi_high_got, *movsi_lo_sum_got): Likewise.
(*movsi_lda_sdata): Delete.
(*movsi_pic, movsi_high_pic, movsi_lo_sum_pic): Delete.
2003-11-05 Alexandre Oliva <aoliva@redhat.com>
* config.gcc: Add t-slibgcc-elf-ver and support --with-cpu for
frv-*-*linux*.
* config/frv/frv-abi.h (CREATE_DOUBLE_SHIFT): Use branch to local
label.
* config/frv/frv.h (DRIVER_SELF_SPECS): Add blank before
-multilib-library-pic.
(LINK_SPEC): Add -z text for -mfdpic.
* config/frv/frvbegin.c (__ROFIXUP_LIST__): Don't define on FDPIC.
* config/frv/frvend.c (__ROFIXUP_END__): Likewise.
* config/frv/linux.h (STARTFILE_SPEC, ENDFILE_SPEC, LINK_SPEC):
Override.
(OPTION_DEFAULT_SPECS, HAS_INIT_SECTION, INIT_SECTION_ASM_OP,
FINI_SECTION_ASM_OP, CRT_CALL_STATIC_FUNCTION): Define.
* config/frv/t-linux (EXTRA_MULTILIB_PARTS): Use
crtstuff-generated files.
2003-10-31 Alexandre Oliva <aoliva@redhat.com>
* config.gcc: Add frv-*-*linux*.
* config/frv/linux.h, config/frv/t-linux: New.
2003-10-06 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.h (LINK_SPEC): Pass -melf32frvfd to the linker
when -mfdpic even if a linker script is explicitly listed.
2003-10-02 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_override_options): Clear asm_out
unaligned_op for SImode on FDPIC.
(frv_emit_movsi): Use compute_reloc_for_constant to compute the
argument passed to decl_readonly_section.
(frv_assemble_integer): Revert 2003-09-30's change, but make the
whole block run with FDPIC even with -fno-PIC.
2003-10-02 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_cannot_force_const_mem): Don't force
symbol or label plus offset to memory.
(frv_emit_movsi): Emit GPREL only if -mgprel-ro. Emit 32-bit
GOTOFF and GPREL for LABEL_REF.
* config/frv/frv.h (DRIVER_SELF_SPECS): Add -mgprel-ro with
-mfdpic unless -mno-gprel-ro, -fpic or -fpie.
(MASK_GPREL_RO, TARGET_GPREL_RO): New.
(TARGET_SWITCHES): Added gprel-ro and no-gprel-ro.
* doc/invoke.texi: Document them.
2003-09-30 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv-protos.h (frv_gen_GPsym2reg): Declare.
(frv_splittable_got_operand): Removed.
* config/frv/frv.c (frv_cannot_force_const_mem): Reject HIGH and
LO_SUM. Add comments.
(frv_override_options): Moved enabling of FDPIC to
DRIVER_SELF_SPECS. Don't enable MASK_DWORD.
(frv_local_funcdesc_p): Remove unnecessary heck for flag_pie.
(frv_legitimize_fdpic_address): Don't duplicate logic in
frv_emit_movsi.
(frv_gen_GPsym2reg): New.
(unspec_got_name): Added gprel.
(frv_expand_fdpic_call): Add support for inlining PLTs.
(fdpic_fptr_operand): Renamed from frv_fdpic_fptr_operand.
(gpr_or_int12_operand): Added GPREL12.
(pic_symbolic_operand): Match even if !flag_pic for FDPIC.
(small_data_symbolic_operand): Fail if FDPIC.
(fdpic_splittable_got_operand): Removed.
(fdpic_got12_operand): Added GPREL12.
(frv_emit_movsi): Reorganize to avoid duplication. Emit GPREL
when appropriate. Fix sdata GOTOFF.
(frv_legitimate_constant_p): Require legitimate PIC operand for
FDPIC with pic, but only a legitimate fdpic operand for non-pic.
(frv_assemble_integer): Move FDPIC funcdesc handling out of
flag_pic case.
(frv_asm_out_constructor, frv_asm_out_destructor): Abort if
frv_assemble_integer fails.
* config/frv/frv.h (DRIVER_SELF_SPECS): New.
(SUBTARGET_DRIVER_SELF_SPECS): New.
(ASM_SPEC): Don't pass -mno-fdpic.
(LINK_SPEC): Pass -melf32frvfd for FDPIC.
(MASK_INLINE_PLT, TARGET_INLINE_PLT): New.
(TARGET_SWITCHES): Add -minline-plt, -mno-inline-plt and
-multilib-library-pic.
(PREDICATE_CODES): Added fdpic_operand, fdpic_fptr_operand,
condexec_si_media_operator, condexec_sf_add_operator and
condexec_sf_conv_operator. Removed condexec_sf_binary_operator
and condexec_sf_unary_operator.
* config/frv/frv.md (R_FRV_GPREL12, R_FRV_GPRELHI, R_FRV_GPRELLO):
New.
(movsi_got, movsi_high_got, movsi_lo_sum_got): Move before
movsi_internal. Give them internal names. movsi_got has type
int.
(fdpic got splitters): Remove.
(symGPREL2reg, symGPREL2reg_hilo): New.
* config/frv/t-frv (MULTILIB_MATCHES): Don't map -fpic and -fPIC
to -mlibrary-pic. Map -multilib-library-pic to it.
* doc/invoke.texi: -mfdpic, -minline-plt, -multilib-library-pic:
Document.
2003-09-28 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_function_symbol_referenced_p): Declare.
(TARGET_CANNOT_FORCE_CONST_MEM): Define to...
(frv_cannot_force_const_mem): New function.
(const_small_data_p, plus_small_data_p): Update comments on sdata
on FDPIC.
(frv_override_options): Set flag_pie for FDPIC too.
(frv_conditional_register_usage): Mark gr16 and gr17 as non-fixed,
call-saved registers on FDPIC.
(frv_stack_info): Don't preserve the PIC register on FDPIC, and
don't force LR to be preserved.
(frv_expand_prologue): Likewise.
(frv_asm_output_mi_thunk): Use 12-bit funcdesc gotoff for -fpic.
(frv_frame_pointer_required): Don't force it just because the
FDPIC register is used.
(frv_legitimate_address_p) <CONST>: Accept a legitimate FDPIC
operand only if !condexec_p.
(frv_legitimize_address): Return the FDPIC-legitimized address.
Don't match small data here on FDPIC.
(frv_legitimate_fdpic_operand_p): Don't accept unadorned function
symbols. Use TRUE/FALSE instead of 1/0.
(frv_local_funcdesc_p): New.
(frv_legitimize_fdpic_address): Rewrite to use GOTOFF and 12-bit
immediates when possible.
(pic_symbolic_operand): Accept SYMBOL_REFs and CONSTs in FDPIC.
(dbl_memory_one_insn_operand): Accept addresses that add a REG and
an UNSPEC_GOT.
(frv_emit_movsi): Handle FDPIC before small data. Use GOTOFF and
12-bit immediates when possible.
(frv_legitimate_constant_p): In FDPIC, reject SImode operands that
are not legitimate pic operands.
(frv_in_small_data_p): Re-enable for FDPIC.
* config/frv/frv.h (SDA_BASE_REG): Remove comment about FDPIC.
(FRV_GLOBAL_P): Removed.
* config/frv/frv.md: Add modes to CONSTs.
(movsi_got): New.
(movsi_lo_sum_got): Use separate matches instead of match_dup.
(movsi_high_pic, movsi_lo_sum_pic): Match on non-FDPIC only.
(fdpic splittable operations): Match on flag_pic != 1.
2003-09-22 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_asm_out_constructor,
frv_asm_out_destructor): Pass to frv_assemble_integer the size in
bytes, not bits.
2003-09-19 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_assemble_integer): Reject complex
expressions referencing function SYMBOL_REFs.
* config/frv/frv.c (frv_function_symbol_referenced_p): New.
(move_source_operand): Reject CONSTs that reference function
SYMBOL_REFs on FDPIC.
(frv_emit_movsi): If we get such a CONST, break it up.
* config/frv/frv.h (CPP_SPEC): Define __FRV_FDPIC__ for -mfdpic.
(TRANSFER_FROM_TRAMPOLINE): Use different definitions for FDPIC.
* config/frv/frv.c (frv_print_operand) <I>: Recognize PLUS without
MEM.
(frv_assemble_integer): Don't use funcdesc for LABEL_REFs.
(frv_trampoline_size): Increase for FDPIC.
* config/frv/frv.h (TRAMPOLINE_ALIGNMENT): Bump to 64 for FDPIC.
(TRANSFER_FROM_TRAMPOLINE): Handle FDPIC trampolines.
* config/frv/frv.c (frv_legitimize_fdpic_address, frv_emit_movsi):
Disable use of GOTOFF for now.
(const_small_data_p, plus_small_data_p, frv_in_small_data_p):
Disable use of small data in FDPIC for now.
(frv_asm_output_mi_thunk): Implement for FDPIC.
* config/frv/frv.h (SDA_BASE_REG): Set to -1 with FDPIC.
* config/frv/frv.c (frv_asm_out_constructor): Use
frv_assemble_integer for FDPIC pointers.
(frv_asm_out_destructor): Likewise.
* config/frv/frv.md (ldd): Fix order of operands. Use
address_operand for input.
2003-09-18 DJ Delorie <dj@redhat.com>
* config/frv/frv.c (frv_legitimate_fdpic_operand_p): Remove UNSPEC_PIC.
(unspec_got_name): Correct typo.
(frv_emit_movsi): Pre-expand splittable GOTs.
(frv_expand_fdpic_call): Rename gen_lddi to gen_ldd.
* config/frv/frv.md (lddi): Fix syntax error, rename to ldd.
(symGOT2reg_hilo, symGOTOFF2reg_hilo): New.
* config/frv/t-frv: Add -mfdpic multilibs.
* config/frv/frv.h (ASM_SPEC): Pass -mfdpic/-mno-fdpic.
(TARGET_SWITCHES): Add -mno-fdpic, fix documentation.
* config/frv/frv.c (frv_override_options): -mfdpic assumes
flag_pic, default to 32-bit pics, require DWORD ops.
(frv_override_options): Add W and Z constraints.
(frv_expand_prologue): No pic prologue for -mfdpic.
(frv_asm_output_mi_thunk): Support -mfdpic (soon).
(frv_print_operand_memory_reference): Handle GOT constants.
(frv_legitimate_address_p): Allow GOT constants.
(frv_legitimize_address): Handle GOT addresses too.
(frv_legitimate_fdpic_operand_p): New.
(frv_legitimize_fdpic_address): New.
(unspec_got_name): New.
(frv_output_addr_const_extra): New.
(frv_expand_fdpic_call): New.
(frv_fdpic_fptr_operand): New.
(gpr_or_int12_operand): Handle GOT operands.
(int_2word_operand): Handle GOT operands.
(fdpic_operand): New.
(fdpic_splittable_got_operand): New.
(fdpic_got12_operand): New.
(frv_emit_movsi): Handle GOT operands.
(frv_assemble_integer): -mfdpic doesn't use rofixups.
(frv_print_operand): Support 'g' code for GOT operands.
* config/frv/frv-protos.h: Add prototypes as needed.
* config/frv/frv.md (R_FRV_GOT12, R_FRV_GOTHI, R_FRV_GOTLO,
R_FRV_FUNCDESC, R_FRV_FUNCDESC_GOT12, R_FRV_FUNCDESC_GOTHI,
R_FRV_FUNCDESC_GOTLO, R_FRV_FUNCDESC_VALUE,
R_FRV_FUNCDESC_GOTOFF12, R_FRV_FUNCDESC_GOTOFFHI,
R_FRV_FUNCDESC_GOTOFFLO, R_FRV_GOTOFF12, R_FRV_GOTOFFHI,
R_FRV_GOTOFFLO): New.
(movsi_high_got, movsi_lo_sum_got): New.
(*movsi_pic): Don't use this splitter for -mfdpic.
(addsi3): Allow GOT references also.
(call, call_value): Handle -mfdpic separately.
(call_fdpicdi, call_fdpicsi, lddi, call_value_fdpicdi,
call_value_fdpicsi): New.
(symGOT2reg, symGOT2reg_i, got splitters, symGOTOFF2reg,
symGOTOFF2reg_i): New.
* config/frv/frv.h (MASK_FDPIC): New.
(TARGET_FDPIC): New.
(TARGET_SWITCHES): Add -mfdpic.
(FDPIC_FPTR_REGNO): New.
(FDPIC_REGNO): New.
(OUR_FDPIC_REG): New.
(enum reg_class): Add FDPIC_REGS, FDPIC_FPTR_REGS, and
FDPIC_CALL_REGS.
(REG_CLASS_NAMES): Likewise.
(REG_CLASS_CONTENTS): Likewise.
(EXTRA_CONSTRAINT_FOR_Y): New, for 12-bit GOTs.
(EXTRA_CONSTRAINT): Add it here.
(FRV_GLOBAL_P): New.
(OUTPUT_ADDR_CONST_EXTRA): New.
From-SVN: r78373
2004-02-24 17:58:39 +01:00
|
|
|
#ifndef __RELOC_POINTER
|
|
|
|
# define __RELOC_POINTER(ptr, base) ((ptr) + (base))
|
|
|
|
#endif
|
|
|
|
|
2003-10-31 Andreas Jaeger <aj@suse.de>,
Zack Weinberg <zack@codesourcery.com>
* crtstuff.c (__register_frame_info, __register_frame_info_bases)
(__deregister_frame_info, __deregister_frame_info_bases):
Constify void * argument.
* unwind-dw2-fde.h (struct fde_vector):
Constify 'orig_data' and 'array' fields.
(__register_frame_info, __register_frame_info_bases)
(__deregister_frame_info, __deregister_frame_info_bases):
Constify void * argument.
(get_cie, next_fde, _Unwind_Find_FDE): Constify arguments,
return values, and casts of type fde *, struct dwarf_fde *,
and struct dwarf_cie *.
* unwind-dw2-fde.c (__register_frame_info, __register_frame_info_bases)
(__deregister_frame_info, __deregister_frame_info_bases):
Constify void * argument.
(get_cie_encoding, ): Constify struct dwarf_cie * argument.
(get_fde_encoding, fde_unencoded_compare, fde_single_encoding_compare)
(fde_mixed_encoding_compare, fde_compare_t, start_fde_sort, fde_insert)
fde_split, SWAP, frame_downheap, frame_heapsort)
(classify_object_over_fdes, add_fdes, linear_search_fdes,
binary_search_unencoded_fdes, binary_search_single_encoding_fdes,
binary_search_mixed_encoding_fdes, search_object, _Unwind_Find_FDE):
Constify arguments, local variables, return values, and casts
of type fde *, fde **, struct dwarf_fde *, and struct dwarf_cie *.
Use const pointer types in sizeof expressions, for clarity.
* unwind-dw2-fde-glibc.c
(_Unwind_find_registered_FDE, _Unwind_find_FDE): Constify return value.
(struct unw_eh_callback_data): Constify 'ret' field.
Co-Authored-By: Zack Weinberg <zack@codesourcery.com>
From-SVN: r73155
2003-10-31 21:46:26 +01:00
|
|
|
static const fde * _Unwind_Find_registered_FDE (void *pc, struct dwarf_eh_bases *bases);
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
|
|
|
|
#define _Unwind_Find_FDE _Unwind_Find_registered_FDE
|
|
|
|
#include "unwind-dw2-fde.c"
|
|
|
|
#undef _Unwind_Find_FDE
|
|
|
|
|
|
|
|
#ifndef PT_GNU_EH_FRAME
|
|
|
|
#define PT_GNU_EH_FRAME (PT_LOOS + 0x474e550)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct unw_eh_callback_data
|
|
|
|
{
|
|
|
|
_Unwind_Ptr pc;
|
|
|
|
void *tbase;
|
|
|
|
void *dbase;
|
|
|
|
void *func;
|
2003-10-31 Andreas Jaeger <aj@suse.de>,
Zack Weinberg <zack@codesourcery.com>
* crtstuff.c (__register_frame_info, __register_frame_info_bases)
(__deregister_frame_info, __deregister_frame_info_bases):
Constify void * argument.
* unwind-dw2-fde.h (struct fde_vector):
Constify 'orig_data' and 'array' fields.
(__register_frame_info, __register_frame_info_bases)
(__deregister_frame_info, __deregister_frame_info_bases):
Constify void * argument.
(get_cie, next_fde, _Unwind_Find_FDE): Constify arguments,
return values, and casts of type fde *, struct dwarf_fde *,
and struct dwarf_cie *.
* unwind-dw2-fde.c (__register_frame_info, __register_frame_info_bases)
(__deregister_frame_info, __deregister_frame_info_bases):
Constify void * argument.
(get_cie_encoding, ): Constify struct dwarf_cie * argument.
(get_fde_encoding, fde_unencoded_compare, fde_single_encoding_compare)
(fde_mixed_encoding_compare, fde_compare_t, start_fde_sort, fde_insert)
fde_split, SWAP, frame_downheap, frame_heapsort)
(classify_object_over_fdes, add_fdes, linear_search_fdes,
binary_search_unencoded_fdes, binary_search_single_encoding_fdes,
binary_search_mixed_encoding_fdes, search_object, _Unwind_Find_FDE):
Constify arguments, local variables, return values, and casts
of type fde *, fde **, struct dwarf_fde *, and struct dwarf_cie *.
Use const pointer types in sizeof expressions, for clarity.
* unwind-dw2-fde-glibc.c
(_Unwind_find_registered_FDE, _Unwind_find_FDE): Constify return value.
(struct unw_eh_callback_data): Constify 'ret' field.
Co-Authored-By: Zack Weinberg <zack@codesourcery.com>
From-SVN: r73155
2003-10-31 21:46:26 +01:00
|
|
|
const fde *ret;
|
2005-03-04 20:54:16 +01:00
|
|
|
int check_cache;
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct unw_eh_frame_hdr
|
|
|
|
{
|
|
|
|
unsigned char version;
|
|
|
|
unsigned char eh_frame_ptr_enc;
|
|
|
|
unsigned char fde_count_enc;
|
|
|
|
unsigned char table_enc;
|
|
|
|
};
|
|
|
|
|
2005-03-04 20:54:16 +01:00
|
|
|
#define FRAME_HDR_CACHE_SIZE 8
|
|
|
|
|
|
|
|
static struct frame_hdr_cache_element
|
|
|
|
{
|
|
|
|
_Unwind_Ptr pc_low;
|
|
|
|
_Unwind_Ptr pc_high;
|
2016-11-16 08:01:56 +01:00
|
|
|
#if defined __FRV_FDPIC__ || defined __BFIN_FDPIC__
|
|
|
|
struct elf32_fdpic_loadaddr load_base;
|
|
|
|
#else
|
2005-03-04 20:54:16 +01:00
|
|
|
_Unwind_Ptr load_base;
|
2016-11-16 08:01:56 +01:00
|
|
|
#endif
|
2005-03-04 20:54:16 +01:00
|
|
|
const ElfW(Phdr) *p_eh_frame_hdr;
|
|
|
|
const ElfW(Phdr) *p_dynamic;
|
|
|
|
struct frame_hdr_cache_element *link;
|
|
|
|
} frame_hdr_cache[FRAME_HDR_CACHE_SIZE];
|
|
|
|
|
|
|
|
static struct frame_hdr_cache_element *frame_hdr_cache_head;
|
|
|
|
|
2002-11-07 07:00:07 +01:00
|
|
|
/* Like base_of_encoded_value, but take the base from a struct
|
|
|
|
unw_eh_callback_data instead of an _Unwind_Context. */
|
2002-06-01 00:15:42 +02:00
|
|
|
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
static _Unwind_Ptr
|
|
|
|
base_from_cb_data (unsigned char encoding, struct unw_eh_callback_data *data)
|
|
|
|
{
|
|
|
|
if (encoding == DW_EH_PE_omit)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
switch (encoding & 0x70)
|
|
|
|
{
|
|
|
|
case DW_EH_PE_absptr:
|
|
|
|
case DW_EH_PE_pcrel:
|
|
|
|
case DW_EH_PE_aligned:
|
|
|
|
return 0;
|
2002-06-01 00:15:42 +02:00
|
|
|
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
case DW_EH_PE_textrel:
|
|
|
|
return (_Unwind_Ptr) data->tbase;
|
|
|
|
case DW_EH_PE_datarel:
|
|
|
|
return (_Unwind_Ptr) data->dbase;
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
default:
|
|
|
|
gcc_unreachable ();
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
_Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
|
|
|
|
{
|
|
|
|
struct unw_eh_callback_data *data = (struct unw_eh_callback_data *) ptr;
|
|
|
|
const ElfW(Phdr) *phdr, *p_eh_frame_hdr, *p_dynamic;
|
|
|
|
long n, match;
|
2016-11-16 08:01:56 +01:00
|
|
|
#if defined __FRV_FDPIC__ || defined __BFIN_FDPIC__
|
Implement FR-V FDPIC ABI support for frv-uclinux and frv-linux.
2004-02-05 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_emit_movsi): Use GOT relocations for
symbols in sections named by the user.
2004-01-30 Alexandre Oliva <aoliva@redhat.com>
* config/frv/linux.h (TARGET_OS_CPP_BUILTINS): New.
2004-01-27 Alexandre Oliva <aoliva@redhat.com>
* config.gcc (frv-*-*linux*): Handle like *-*-linux*.
* config/frv/t-linux (EXTRA_MULTILIB_PARTS): Remove, obviated by
the above.
2004-01-20 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.md (symGOT2reg_hilo, symGOTOFF2reg_hilo): Add
one more pseudo to further improve code generation.
2004-01-19 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.md (movdi_ldd): Introduce explicit indirection
inside UNSPEC.
2004-01-16 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_legitimate_address_p): Added
allow_double_reg_p argument. Adjust all callers. Use it to
decide whether to enable double-register indirect addressing.
(frv_funcdesc_alias_set): Remove.
(frv_expand_fdpic_call): Force non-SYMBOL_REF operand into
register. Emit movdi_ldd.
(ldd_address_operand): New.
* config/frv/frv-protos.h (frv_legitimate_address_p): Adjust.
* config/frv/frv.h (GO_IF_LEGITIMATE_ADDRESS): Likewise.
(PREDICATE_CODES): Add ldd_address_operand.
* config/frv/frv.md (movdi_ldd): New.
(symGOT2reg_hilo, symGOTOFF2reg_hilo): Use separate pseudo for
intermediate computations if possible.
(symGOTOFF2reg_i): Fix harmless typo.
2003-12-18 Alexandre Oliva <aoliva@redhat.com>
* unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Cast
relocated p_vaddr to vaddr type.
* config/frv/frv-protos.h (frv_expand_fdpic_call): Return void.
* config/frv/frv.c (frv_get_funcdesc_alias_set): New.
(frv_expand_fdpic_call): Propagate incoming MEM's expr to funcdesc
MEM, or use a funcdesc alias set. Use regular move instead of
ldd.
(dbl_memory_one_insn_operand): Recognize function descriptors by
type or by alias set, and don't split them.
* config/frv/frv.md (call, call_value): Never use call_internal
for fdpic.
(call_internal, call_value_internal): Never match for FDPIC.
(call_fdpicdi, call_fdpicsi, call_value_fdpicdi,
call_value_fdpicsi): Require FDPIC.
(ldd): Removed.
2003-12-17 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.h (CRT_GET_RFIB_DATA): Define for __FRV_FDPIC__.
* unwind-dw2-fde-glibc.c: Don't include elf-fdpic.h any more.
(_Unwind_IteratePhdrCallback): Adjust type of load_base for FRV
FDPIC. Compute data base address.
* config/frv/linux.h (SUBTARGET_DRIVER_SELF_SPECS): Enable -mfdpic
before the other self-specs are processed.
* config/frv/t-linux (CRTSTUFF_T_CFLAGS, TARGET_LIBGCC2_CFLAGS):
Build with -fPIC.
2003-12-15 Alexandre Oliva <aoliva@redhat.com>
* unwind-dw2-fde-glibc.c: Don't include bits/elf-fdpic.h if
inhibit_libc is defined.
2003-12-12 Alexandre Oliva <aoliva@redhat.com>
* unwind-dw2-fde-glibc.c: Include bits/elf-fdpic.h for
__FRV_FDPIC__.
(__RELOC_POINTER): Define.
(_Unwind_IteratePhdrCallback): Use it.
* config/frv/frv.h (Twrite): Define.
(TRANSFER_FROM_TRAMPOLINE): Use it.
* config/frv/linux.h (INVOKE__main): Undefine.
(Twrite): Override.
2003-12-05 Richard Sandiford <rsandifo@redhat.com>
* doc/invoke.texi (-mlong-calls, -mlinked-fp): Document FRV options.
(-mlibrary-pic): Emphasize that this option generates EABI code.
(-mcpu): Add fr550.
(-mpack): Remove.
2003-11-30 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (int_2word_operand): Reject LABELs, SYMBOL_REFs
and CONSTs in FDPIC mode.
* gcc/config.gcc (with_cpu): Default to fr400 on frv-*-*linux*.
2003-11-29 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.c (move_source_operand): Don't accept symbolic
constants.
* config/frv/frv.md (*movhi_internal, *movsi_internal): Use an 'n'
rather than 'i' constraint for the 2-instruction alternative.
(*movsi_2word): New, incorporating existing int_2word_operand splitter.
2003-11-29 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.h (EXTRA_CONSTRAINT_FOR_Q): Renamed from
EXTRA_CONSTRAINT_FOR_Y.
(EXTRA_CONSTRAINT): Remove handling of 'Y'.
* config/frv/frv.md (*movsi_internal): Remove 'Q' constraint.
(addsi3): Change 'Y' constraint to 'Q'.
2003-11-27 Richard Sandiford <rsandifo@redhat.com>
* reload.c (CONST_POOL_OK_P): New macro.
(find_reloads): Use it to decide whether a constant can be forced
into memory.
* config/frv/frv.h (LEGITIMATE_PIC_OPERAND_P): Return true if the
constant satisfies got12_operand.
(frv_cannot_force_const_mem): Always return true for TARGET_FDPIC.
(frv_legitimate_address_p): Check for valid unspec offsets using
got12_operand rather than frv_legitimate_fdpic_operand_p.
(frv_legitimate_fdpic_operand_p): Delete.
(frv_emit_movsi): Abort if we try to use the FDPIC register during
or after reload.
(frv_legitimate_constant_p): Return LEGITIMATE_PIC_OPERAND_P if
TARGET_FDPIC.
* config/frv/frv.md (*movdf_double): Add alternatives for CONST_DOUBLE.
2003-11-19 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-protos.h (fdpic_operand, fdpic_got12_operand)
(frv_fdpic_fptr_operand): Don't declare here.
* config/frv/frv.h (EXTRA_CONSTRAINT_FOR_Y): Call got12_operand
rather than fdpic_got12_operand.
(PREDICATE_CODES): Remove symbolic_operand entry. Add entries for
got12_operand and const_unspec_operand.
* config/frv/frv.c (got12_operand): Renamed from fdpic_got12_operand.
(gpr_or_int12_operand, dbl_memory_one_insn_operand): Update calls.
(symbolic_operand): Remove.
(const_unspec_operand): New predicate.
* config/frv/frv.md (*movsi_got): Use got12_operand.
(*movsi_high_got, *movsi_lo_sum_got): Use const_unspec_operand.
2003-11-18 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-protos.h (frv_output_addr_const_extra): Remove.
* config/frv/frv.h (OUTPUT_ADDR_CONST_EXTRA): Remove definition.
* config/frv/frv.c (frv_unspec): New structure.
(frv_small_data_reloc_p, frv_const_unspec_p): New functions.
(frv_print_operand_memory_reference): Use frv_const_unspec_p to
validate CONST indices. Use frv_output_const_unspec to print them.
(frv_print_operand): Update call to unspec_got_name. Use
frv_output_const_unspec to print constant unspecs.
(frv_legitimate_fdpic_operand_p): Return true if frv_const_unspec_p.
Reject UNSPECs otherwise.
(unspec_got_name): Take the relocation number as argument, not an
rtx containing it.
(frv_output_addr_const_extra): Remove, replacing with...
(frv_output_const_unspec): ...this new function.
(frv_find_base_term): Use frv_const_unspec_p & frv_small_data_reloc_p.
(gpr_or_int12_operand): Use fdpic_got12_operand.
(dbl_memory_one_insn_operand): Likewise.
(fdpic_got12_operand): Use frv_const_unspec_p.
(frv_emit_movsi): Use frv_const_unspec_p to check for CONSTs that
are already legitimate. Use frv_small_data_reloc_p when deciding
whether to use HIGH/LO_SUM for R_FRV_GOTOFF12 and R_FRV_GPREL12.
2003-11-18 Alexandre Oliva <aoliva@redhat.com>
* config/frv/t-linux (SHLIB_MAPFILES): Override so as to export...
* config/frv/libgcc-frv.ver: ... frv-specific symbols. New file.
* config/frv/frv-abi.h (CREATE_DOUBLE_SHIFT): Use branch to local
label, for real this time.
* config/frv/frv.c (frv_local_funcdesc_p): Update to new
representation of visibility.
(fdpic_got12_operand, symbolic_operand): Mark unused arguments as
such.
2003-11-17 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.h (MASK_LINKED_FP, TARGET_LINKED_FP): New macros.
(TARGET_SWITCHES): Add -mlinked-fp and -mno-linked-fp.
* config/frv/frv.c (frv_override_options): Set MASK_LINKED_FP unless
it was explicitly disabled.
(frv_stack_info): There is no need to save the link register in every
frame unless TARGET_LINKED_FP is true.
(frv_frame_pointer_required): If !TARGET_LINKED_FP, only require a
frame pointer if the stack pointer might change value.
(frv_return_addr_rtx): Check and process "count" argument.
2003-11-14 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-protos.h (frv_legitimize_address): Remove.
(frv_find_base_term): Declare.
* config/frv/frv.h (LEGITIMIZE_ADDRESS): Do nothing.
(FIND_BASE_TERM): Define.
(PREDICATE_CODES): Remove pic_register_operand, pic_symbolic_operand,
small_data_register_operand, small_data_symbolic_operand. Add
symbolic_operand.
* config/frv/frv.c (const_small_data_p, plus_small_data_p): Delete.
(frv_print_operand_memory_reference, output_move_single): Remove
special handling for unlegitimized sdata addresses.
(frv_legitimate_address_p): Don't allow sums of SDA_BASE_REG
and symbolic addresses.
(frv_legitimize_address, frv_legitimize_fdpic_address): Delete.
(frv_find_base_term): New function.
(int_2word_operand): Check specifically for symbolic address constants.
(pic_register_operand, pic_symbolic_operand): Delete.
(small_data_register_operand, small_data_symbolic_operand): Delete.
(dbl_memory_one_insn_operand): Don't call plus_small_data_p.
Allow UNSPEC_GOT constants if !TARGET_FDPIC.
(move_source_operand): Only accept CONSTs if they're a two-insn
symbolic constant.
(fdpic_got12_operand): Don't require TARGET_FDPIC.
(frv_emit_movsi): Legitimize sdata and -mlibrary-pic addresses
using gen_symGOTOFF2reg*.
(frv_ifcvt_rewrite_mem): Remove (plus gr16 ...) special cases.
(frv_rtx_costs): Give all MEM addresses a cost of 0. Give MEMs
themselves a cost of 3 insns.
* config/mips/mips.md (*movsi_got): Allow for !TARGET_FDPIC too.
Change predicate to symbolic_operand.
(*movsi_high_got, *movsi_lo_sum_got): Likewise.
(*movsi_lda_sdata): Delete.
(*movsi_pic, movsi_high_pic, movsi_lo_sum_pic): Delete.
2003-11-05 Alexandre Oliva <aoliva@redhat.com>
* config.gcc: Add t-slibgcc-elf-ver and support --with-cpu for
frv-*-*linux*.
* config/frv/frv-abi.h (CREATE_DOUBLE_SHIFT): Use branch to local
label.
* config/frv/frv.h (DRIVER_SELF_SPECS): Add blank before
-multilib-library-pic.
(LINK_SPEC): Add -z text for -mfdpic.
* config/frv/frvbegin.c (__ROFIXUP_LIST__): Don't define on FDPIC.
* config/frv/frvend.c (__ROFIXUP_END__): Likewise.
* config/frv/linux.h (STARTFILE_SPEC, ENDFILE_SPEC, LINK_SPEC):
Override.
(OPTION_DEFAULT_SPECS, HAS_INIT_SECTION, INIT_SECTION_ASM_OP,
FINI_SECTION_ASM_OP, CRT_CALL_STATIC_FUNCTION): Define.
* config/frv/t-linux (EXTRA_MULTILIB_PARTS): Use
crtstuff-generated files.
2003-10-31 Alexandre Oliva <aoliva@redhat.com>
* config.gcc: Add frv-*-*linux*.
* config/frv/linux.h, config/frv/t-linux: New.
2003-10-06 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.h (LINK_SPEC): Pass -melf32frvfd to the linker
when -mfdpic even if a linker script is explicitly listed.
2003-10-02 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_override_options): Clear asm_out
unaligned_op for SImode on FDPIC.
(frv_emit_movsi): Use compute_reloc_for_constant to compute the
argument passed to decl_readonly_section.
(frv_assemble_integer): Revert 2003-09-30's change, but make the
whole block run with FDPIC even with -fno-PIC.
2003-10-02 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_cannot_force_const_mem): Don't force
symbol or label plus offset to memory.
(frv_emit_movsi): Emit GPREL only if -mgprel-ro. Emit 32-bit
GOTOFF and GPREL for LABEL_REF.
* config/frv/frv.h (DRIVER_SELF_SPECS): Add -mgprel-ro with
-mfdpic unless -mno-gprel-ro, -fpic or -fpie.
(MASK_GPREL_RO, TARGET_GPREL_RO): New.
(TARGET_SWITCHES): Added gprel-ro and no-gprel-ro.
* doc/invoke.texi: Document them.
2003-09-30 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv-protos.h (frv_gen_GPsym2reg): Declare.
(frv_splittable_got_operand): Removed.
* config/frv/frv.c (frv_cannot_force_const_mem): Reject HIGH and
LO_SUM. Add comments.
(frv_override_options): Moved enabling of FDPIC to
DRIVER_SELF_SPECS. Don't enable MASK_DWORD.
(frv_local_funcdesc_p): Remove unnecessary heck for flag_pie.
(frv_legitimize_fdpic_address): Don't duplicate logic in
frv_emit_movsi.
(frv_gen_GPsym2reg): New.
(unspec_got_name): Added gprel.
(frv_expand_fdpic_call): Add support for inlining PLTs.
(fdpic_fptr_operand): Renamed from frv_fdpic_fptr_operand.
(gpr_or_int12_operand): Added GPREL12.
(pic_symbolic_operand): Match even if !flag_pic for FDPIC.
(small_data_symbolic_operand): Fail if FDPIC.
(fdpic_splittable_got_operand): Removed.
(fdpic_got12_operand): Added GPREL12.
(frv_emit_movsi): Reorganize to avoid duplication. Emit GPREL
when appropriate. Fix sdata GOTOFF.
(frv_legitimate_constant_p): Require legitimate PIC operand for
FDPIC with pic, but only a legitimate fdpic operand for non-pic.
(frv_assemble_integer): Move FDPIC funcdesc handling out of
flag_pic case.
(frv_asm_out_constructor, frv_asm_out_destructor): Abort if
frv_assemble_integer fails.
* config/frv/frv.h (DRIVER_SELF_SPECS): New.
(SUBTARGET_DRIVER_SELF_SPECS): New.
(ASM_SPEC): Don't pass -mno-fdpic.
(LINK_SPEC): Pass -melf32frvfd for FDPIC.
(MASK_INLINE_PLT, TARGET_INLINE_PLT): New.
(TARGET_SWITCHES): Add -minline-plt, -mno-inline-plt and
-multilib-library-pic.
(PREDICATE_CODES): Added fdpic_operand, fdpic_fptr_operand,
condexec_si_media_operator, condexec_sf_add_operator and
condexec_sf_conv_operator. Removed condexec_sf_binary_operator
and condexec_sf_unary_operator.
* config/frv/frv.md (R_FRV_GPREL12, R_FRV_GPRELHI, R_FRV_GPRELLO):
New.
(movsi_got, movsi_high_got, movsi_lo_sum_got): Move before
movsi_internal. Give them internal names. movsi_got has type
int.
(fdpic got splitters): Remove.
(symGPREL2reg, symGPREL2reg_hilo): New.
* config/frv/t-frv (MULTILIB_MATCHES): Don't map -fpic and -fPIC
to -mlibrary-pic. Map -multilib-library-pic to it.
* doc/invoke.texi: -mfdpic, -minline-plt, -multilib-library-pic:
Document.
2003-09-28 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_function_symbol_referenced_p): Declare.
(TARGET_CANNOT_FORCE_CONST_MEM): Define to...
(frv_cannot_force_const_mem): New function.
(const_small_data_p, plus_small_data_p): Update comments on sdata
on FDPIC.
(frv_override_options): Set flag_pie for FDPIC too.
(frv_conditional_register_usage): Mark gr16 and gr17 as non-fixed,
call-saved registers on FDPIC.
(frv_stack_info): Don't preserve the PIC register on FDPIC, and
don't force LR to be preserved.
(frv_expand_prologue): Likewise.
(frv_asm_output_mi_thunk): Use 12-bit funcdesc gotoff for -fpic.
(frv_frame_pointer_required): Don't force it just because the
FDPIC register is used.
(frv_legitimate_address_p) <CONST>: Accept a legitimate FDPIC
operand only if !condexec_p.
(frv_legitimize_address): Return the FDPIC-legitimized address.
Don't match small data here on FDPIC.
(frv_legitimate_fdpic_operand_p): Don't accept unadorned function
symbols. Use TRUE/FALSE instead of 1/0.
(frv_local_funcdesc_p): New.
(frv_legitimize_fdpic_address): Rewrite to use GOTOFF and 12-bit
immediates when possible.
(pic_symbolic_operand): Accept SYMBOL_REFs and CONSTs in FDPIC.
(dbl_memory_one_insn_operand): Accept addresses that add a REG and
an UNSPEC_GOT.
(frv_emit_movsi): Handle FDPIC before small data. Use GOTOFF and
12-bit immediates when possible.
(frv_legitimate_constant_p): In FDPIC, reject SImode operands that
are not legitimate pic operands.
(frv_in_small_data_p): Re-enable for FDPIC.
* config/frv/frv.h (SDA_BASE_REG): Remove comment about FDPIC.
(FRV_GLOBAL_P): Removed.
* config/frv/frv.md: Add modes to CONSTs.
(movsi_got): New.
(movsi_lo_sum_got): Use separate matches instead of match_dup.
(movsi_high_pic, movsi_lo_sum_pic): Match on non-FDPIC only.
(fdpic splittable operations): Match on flag_pic != 1.
2003-09-22 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_asm_out_constructor,
frv_asm_out_destructor): Pass to frv_assemble_integer the size in
bytes, not bits.
2003-09-19 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_assemble_integer): Reject complex
expressions referencing function SYMBOL_REFs.
* config/frv/frv.c (frv_function_symbol_referenced_p): New.
(move_source_operand): Reject CONSTs that reference function
SYMBOL_REFs on FDPIC.
(frv_emit_movsi): If we get such a CONST, break it up.
* config/frv/frv.h (CPP_SPEC): Define __FRV_FDPIC__ for -mfdpic.
(TRANSFER_FROM_TRAMPOLINE): Use different definitions for FDPIC.
* config/frv/frv.c (frv_print_operand) <I>: Recognize PLUS without
MEM.
(frv_assemble_integer): Don't use funcdesc for LABEL_REFs.
(frv_trampoline_size): Increase for FDPIC.
* config/frv/frv.h (TRAMPOLINE_ALIGNMENT): Bump to 64 for FDPIC.
(TRANSFER_FROM_TRAMPOLINE): Handle FDPIC trampolines.
* config/frv/frv.c (frv_legitimize_fdpic_address, frv_emit_movsi):
Disable use of GOTOFF for now.
(const_small_data_p, plus_small_data_p, frv_in_small_data_p):
Disable use of small data in FDPIC for now.
(frv_asm_output_mi_thunk): Implement for FDPIC.
* config/frv/frv.h (SDA_BASE_REG): Set to -1 with FDPIC.
* config/frv/frv.c (frv_asm_out_constructor): Use
frv_assemble_integer for FDPIC pointers.
(frv_asm_out_destructor): Likewise.
* config/frv/frv.md (ldd): Fix order of operands. Use
address_operand for input.
2003-09-18 DJ Delorie <dj@redhat.com>
* config/frv/frv.c (frv_legitimate_fdpic_operand_p): Remove UNSPEC_PIC.
(unspec_got_name): Correct typo.
(frv_emit_movsi): Pre-expand splittable GOTs.
(frv_expand_fdpic_call): Rename gen_lddi to gen_ldd.
* config/frv/frv.md (lddi): Fix syntax error, rename to ldd.
(symGOT2reg_hilo, symGOTOFF2reg_hilo): New.
* config/frv/t-frv: Add -mfdpic multilibs.
* config/frv/frv.h (ASM_SPEC): Pass -mfdpic/-mno-fdpic.
(TARGET_SWITCHES): Add -mno-fdpic, fix documentation.
* config/frv/frv.c (frv_override_options): -mfdpic assumes
flag_pic, default to 32-bit pics, require DWORD ops.
(frv_override_options): Add W and Z constraints.
(frv_expand_prologue): No pic prologue for -mfdpic.
(frv_asm_output_mi_thunk): Support -mfdpic (soon).
(frv_print_operand_memory_reference): Handle GOT constants.
(frv_legitimate_address_p): Allow GOT constants.
(frv_legitimize_address): Handle GOT addresses too.
(frv_legitimate_fdpic_operand_p): New.
(frv_legitimize_fdpic_address): New.
(unspec_got_name): New.
(frv_output_addr_const_extra): New.
(frv_expand_fdpic_call): New.
(frv_fdpic_fptr_operand): New.
(gpr_or_int12_operand): Handle GOT operands.
(int_2word_operand): Handle GOT operands.
(fdpic_operand): New.
(fdpic_splittable_got_operand): New.
(fdpic_got12_operand): New.
(frv_emit_movsi): Handle GOT operands.
(frv_assemble_integer): -mfdpic doesn't use rofixups.
(frv_print_operand): Support 'g' code for GOT operands.
* config/frv/frv-protos.h: Add prototypes as needed.
* config/frv/frv.md (R_FRV_GOT12, R_FRV_GOTHI, R_FRV_GOTLO,
R_FRV_FUNCDESC, R_FRV_FUNCDESC_GOT12, R_FRV_FUNCDESC_GOTHI,
R_FRV_FUNCDESC_GOTLO, R_FRV_FUNCDESC_VALUE,
R_FRV_FUNCDESC_GOTOFF12, R_FRV_FUNCDESC_GOTOFFHI,
R_FRV_FUNCDESC_GOTOFFLO, R_FRV_GOTOFF12, R_FRV_GOTOFFHI,
R_FRV_GOTOFFLO): New.
(movsi_high_got, movsi_lo_sum_got): New.
(*movsi_pic): Don't use this splitter for -mfdpic.
(addsi3): Allow GOT references also.
(call, call_value): Handle -mfdpic separately.
(call_fdpicdi, call_fdpicsi, lddi, call_value_fdpicdi,
call_value_fdpicsi): New.
(symGOT2reg, symGOT2reg_i, got splitters, symGOTOFF2reg,
symGOTOFF2reg_i): New.
* config/frv/frv.h (MASK_FDPIC): New.
(TARGET_FDPIC): New.
(TARGET_SWITCHES): Add -mfdpic.
(FDPIC_FPTR_REGNO): New.
(FDPIC_REGNO): New.
(OUR_FDPIC_REG): New.
(enum reg_class): Add FDPIC_REGS, FDPIC_FPTR_REGS, and
FDPIC_CALL_REGS.
(REG_CLASS_NAMES): Likewise.
(REG_CLASS_CONTENTS): Likewise.
(EXTRA_CONSTRAINT_FOR_Y): New, for 12-bit GOTs.
(EXTRA_CONSTRAINT): Add it here.
(FRV_GLOBAL_P): New.
(OUTPUT_ADDR_CONST_EXTRA): New.
From-SVN: r78373
2004-02-24 17:58:39 +01:00
|
|
|
struct elf32_fdpic_loadaddr load_base;
|
|
|
|
#else
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
_Unwind_Ptr load_base;
|
Implement FR-V FDPIC ABI support for frv-uclinux and frv-linux.
2004-02-05 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_emit_movsi): Use GOT relocations for
symbols in sections named by the user.
2004-01-30 Alexandre Oliva <aoliva@redhat.com>
* config/frv/linux.h (TARGET_OS_CPP_BUILTINS): New.
2004-01-27 Alexandre Oliva <aoliva@redhat.com>
* config.gcc (frv-*-*linux*): Handle like *-*-linux*.
* config/frv/t-linux (EXTRA_MULTILIB_PARTS): Remove, obviated by
the above.
2004-01-20 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.md (symGOT2reg_hilo, symGOTOFF2reg_hilo): Add
one more pseudo to further improve code generation.
2004-01-19 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.md (movdi_ldd): Introduce explicit indirection
inside UNSPEC.
2004-01-16 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_legitimate_address_p): Added
allow_double_reg_p argument. Adjust all callers. Use it to
decide whether to enable double-register indirect addressing.
(frv_funcdesc_alias_set): Remove.
(frv_expand_fdpic_call): Force non-SYMBOL_REF operand into
register. Emit movdi_ldd.
(ldd_address_operand): New.
* config/frv/frv-protos.h (frv_legitimate_address_p): Adjust.
* config/frv/frv.h (GO_IF_LEGITIMATE_ADDRESS): Likewise.
(PREDICATE_CODES): Add ldd_address_operand.
* config/frv/frv.md (movdi_ldd): New.
(symGOT2reg_hilo, symGOTOFF2reg_hilo): Use separate pseudo for
intermediate computations if possible.
(symGOTOFF2reg_i): Fix harmless typo.
2003-12-18 Alexandre Oliva <aoliva@redhat.com>
* unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Cast
relocated p_vaddr to vaddr type.
* config/frv/frv-protos.h (frv_expand_fdpic_call): Return void.
* config/frv/frv.c (frv_get_funcdesc_alias_set): New.
(frv_expand_fdpic_call): Propagate incoming MEM's expr to funcdesc
MEM, or use a funcdesc alias set. Use regular move instead of
ldd.
(dbl_memory_one_insn_operand): Recognize function descriptors by
type or by alias set, and don't split them.
* config/frv/frv.md (call, call_value): Never use call_internal
for fdpic.
(call_internal, call_value_internal): Never match for FDPIC.
(call_fdpicdi, call_fdpicsi, call_value_fdpicdi,
call_value_fdpicsi): Require FDPIC.
(ldd): Removed.
2003-12-17 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.h (CRT_GET_RFIB_DATA): Define for __FRV_FDPIC__.
* unwind-dw2-fde-glibc.c: Don't include elf-fdpic.h any more.
(_Unwind_IteratePhdrCallback): Adjust type of load_base for FRV
FDPIC. Compute data base address.
* config/frv/linux.h (SUBTARGET_DRIVER_SELF_SPECS): Enable -mfdpic
before the other self-specs are processed.
* config/frv/t-linux (CRTSTUFF_T_CFLAGS, TARGET_LIBGCC2_CFLAGS):
Build with -fPIC.
2003-12-15 Alexandre Oliva <aoliva@redhat.com>
* unwind-dw2-fde-glibc.c: Don't include bits/elf-fdpic.h if
inhibit_libc is defined.
2003-12-12 Alexandre Oliva <aoliva@redhat.com>
* unwind-dw2-fde-glibc.c: Include bits/elf-fdpic.h for
__FRV_FDPIC__.
(__RELOC_POINTER): Define.
(_Unwind_IteratePhdrCallback): Use it.
* config/frv/frv.h (Twrite): Define.
(TRANSFER_FROM_TRAMPOLINE): Use it.
* config/frv/linux.h (INVOKE__main): Undefine.
(Twrite): Override.
2003-12-05 Richard Sandiford <rsandifo@redhat.com>
* doc/invoke.texi (-mlong-calls, -mlinked-fp): Document FRV options.
(-mlibrary-pic): Emphasize that this option generates EABI code.
(-mcpu): Add fr550.
(-mpack): Remove.
2003-11-30 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (int_2word_operand): Reject LABELs, SYMBOL_REFs
and CONSTs in FDPIC mode.
* gcc/config.gcc (with_cpu): Default to fr400 on frv-*-*linux*.
2003-11-29 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.c (move_source_operand): Don't accept symbolic
constants.
* config/frv/frv.md (*movhi_internal, *movsi_internal): Use an 'n'
rather than 'i' constraint for the 2-instruction alternative.
(*movsi_2word): New, incorporating existing int_2word_operand splitter.
2003-11-29 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.h (EXTRA_CONSTRAINT_FOR_Q): Renamed from
EXTRA_CONSTRAINT_FOR_Y.
(EXTRA_CONSTRAINT): Remove handling of 'Y'.
* config/frv/frv.md (*movsi_internal): Remove 'Q' constraint.
(addsi3): Change 'Y' constraint to 'Q'.
2003-11-27 Richard Sandiford <rsandifo@redhat.com>
* reload.c (CONST_POOL_OK_P): New macro.
(find_reloads): Use it to decide whether a constant can be forced
into memory.
* config/frv/frv.h (LEGITIMATE_PIC_OPERAND_P): Return true if the
constant satisfies got12_operand.
(frv_cannot_force_const_mem): Always return true for TARGET_FDPIC.
(frv_legitimate_address_p): Check for valid unspec offsets using
got12_operand rather than frv_legitimate_fdpic_operand_p.
(frv_legitimate_fdpic_operand_p): Delete.
(frv_emit_movsi): Abort if we try to use the FDPIC register during
or after reload.
(frv_legitimate_constant_p): Return LEGITIMATE_PIC_OPERAND_P if
TARGET_FDPIC.
* config/frv/frv.md (*movdf_double): Add alternatives for CONST_DOUBLE.
2003-11-19 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-protos.h (fdpic_operand, fdpic_got12_operand)
(frv_fdpic_fptr_operand): Don't declare here.
* config/frv/frv.h (EXTRA_CONSTRAINT_FOR_Y): Call got12_operand
rather than fdpic_got12_operand.
(PREDICATE_CODES): Remove symbolic_operand entry. Add entries for
got12_operand and const_unspec_operand.
* config/frv/frv.c (got12_operand): Renamed from fdpic_got12_operand.
(gpr_or_int12_operand, dbl_memory_one_insn_operand): Update calls.
(symbolic_operand): Remove.
(const_unspec_operand): New predicate.
* config/frv/frv.md (*movsi_got): Use got12_operand.
(*movsi_high_got, *movsi_lo_sum_got): Use const_unspec_operand.
2003-11-18 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-protos.h (frv_output_addr_const_extra): Remove.
* config/frv/frv.h (OUTPUT_ADDR_CONST_EXTRA): Remove definition.
* config/frv/frv.c (frv_unspec): New structure.
(frv_small_data_reloc_p, frv_const_unspec_p): New functions.
(frv_print_operand_memory_reference): Use frv_const_unspec_p to
validate CONST indices. Use frv_output_const_unspec to print them.
(frv_print_operand): Update call to unspec_got_name. Use
frv_output_const_unspec to print constant unspecs.
(frv_legitimate_fdpic_operand_p): Return true if frv_const_unspec_p.
Reject UNSPECs otherwise.
(unspec_got_name): Take the relocation number as argument, not an
rtx containing it.
(frv_output_addr_const_extra): Remove, replacing with...
(frv_output_const_unspec): ...this new function.
(frv_find_base_term): Use frv_const_unspec_p & frv_small_data_reloc_p.
(gpr_or_int12_operand): Use fdpic_got12_operand.
(dbl_memory_one_insn_operand): Likewise.
(fdpic_got12_operand): Use frv_const_unspec_p.
(frv_emit_movsi): Use frv_const_unspec_p to check for CONSTs that
are already legitimate. Use frv_small_data_reloc_p when deciding
whether to use HIGH/LO_SUM for R_FRV_GOTOFF12 and R_FRV_GPREL12.
2003-11-18 Alexandre Oliva <aoliva@redhat.com>
* config/frv/t-linux (SHLIB_MAPFILES): Override so as to export...
* config/frv/libgcc-frv.ver: ... frv-specific symbols. New file.
* config/frv/frv-abi.h (CREATE_DOUBLE_SHIFT): Use branch to local
label, for real this time.
* config/frv/frv.c (frv_local_funcdesc_p): Update to new
representation of visibility.
(fdpic_got12_operand, symbolic_operand): Mark unused arguments as
such.
2003-11-17 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.h (MASK_LINKED_FP, TARGET_LINKED_FP): New macros.
(TARGET_SWITCHES): Add -mlinked-fp and -mno-linked-fp.
* config/frv/frv.c (frv_override_options): Set MASK_LINKED_FP unless
it was explicitly disabled.
(frv_stack_info): There is no need to save the link register in every
frame unless TARGET_LINKED_FP is true.
(frv_frame_pointer_required): If !TARGET_LINKED_FP, only require a
frame pointer if the stack pointer might change value.
(frv_return_addr_rtx): Check and process "count" argument.
2003-11-14 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-protos.h (frv_legitimize_address): Remove.
(frv_find_base_term): Declare.
* config/frv/frv.h (LEGITIMIZE_ADDRESS): Do nothing.
(FIND_BASE_TERM): Define.
(PREDICATE_CODES): Remove pic_register_operand, pic_symbolic_operand,
small_data_register_operand, small_data_symbolic_operand. Add
symbolic_operand.
* config/frv/frv.c (const_small_data_p, plus_small_data_p): Delete.
(frv_print_operand_memory_reference, output_move_single): Remove
special handling for unlegitimized sdata addresses.
(frv_legitimate_address_p): Don't allow sums of SDA_BASE_REG
and symbolic addresses.
(frv_legitimize_address, frv_legitimize_fdpic_address): Delete.
(frv_find_base_term): New function.
(int_2word_operand): Check specifically for symbolic address constants.
(pic_register_operand, pic_symbolic_operand): Delete.
(small_data_register_operand, small_data_symbolic_operand): Delete.
(dbl_memory_one_insn_operand): Don't call plus_small_data_p.
Allow UNSPEC_GOT constants if !TARGET_FDPIC.
(move_source_operand): Only accept CONSTs if they're a two-insn
symbolic constant.
(fdpic_got12_operand): Don't require TARGET_FDPIC.
(frv_emit_movsi): Legitimize sdata and -mlibrary-pic addresses
using gen_symGOTOFF2reg*.
(frv_ifcvt_rewrite_mem): Remove (plus gr16 ...) special cases.
(frv_rtx_costs): Give all MEM addresses a cost of 0. Give MEMs
themselves a cost of 3 insns.
* config/mips/mips.md (*movsi_got): Allow for !TARGET_FDPIC too.
Change predicate to symbolic_operand.
(*movsi_high_got, *movsi_lo_sum_got): Likewise.
(*movsi_lda_sdata): Delete.
(*movsi_pic, movsi_high_pic, movsi_lo_sum_pic): Delete.
2003-11-05 Alexandre Oliva <aoliva@redhat.com>
* config.gcc: Add t-slibgcc-elf-ver and support --with-cpu for
frv-*-*linux*.
* config/frv/frv-abi.h (CREATE_DOUBLE_SHIFT): Use branch to local
label.
* config/frv/frv.h (DRIVER_SELF_SPECS): Add blank before
-multilib-library-pic.
(LINK_SPEC): Add -z text for -mfdpic.
* config/frv/frvbegin.c (__ROFIXUP_LIST__): Don't define on FDPIC.
* config/frv/frvend.c (__ROFIXUP_END__): Likewise.
* config/frv/linux.h (STARTFILE_SPEC, ENDFILE_SPEC, LINK_SPEC):
Override.
(OPTION_DEFAULT_SPECS, HAS_INIT_SECTION, INIT_SECTION_ASM_OP,
FINI_SECTION_ASM_OP, CRT_CALL_STATIC_FUNCTION): Define.
* config/frv/t-linux (EXTRA_MULTILIB_PARTS): Use
crtstuff-generated files.
2003-10-31 Alexandre Oliva <aoliva@redhat.com>
* config.gcc: Add frv-*-*linux*.
* config/frv/linux.h, config/frv/t-linux: New.
2003-10-06 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.h (LINK_SPEC): Pass -melf32frvfd to the linker
when -mfdpic even if a linker script is explicitly listed.
2003-10-02 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_override_options): Clear asm_out
unaligned_op for SImode on FDPIC.
(frv_emit_movsi): Use compute_reloc_for_constant to compute the
argument passed to decl_readonly_section.
(frv_assemble_integer): Revert 2003-09-30's change, but make the
whole block run with FDPIC even with -fno-PIC.
2003-10-02 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_cannot_force_const_mem): Don't force
symbol or label plus offset to memory.
(frv_emit_movsi): Emit GPREL only if -mgprel-ro. Emit 32-bit
GOTOFF and GPREL for LABEL_REF.
* config/frv/frv.h (DRIVER_SELF_SPECS): Add -mgprel-ro with
-mfdpic unless -mno-gprel-ro, -fpic or -fpie.
(MASK_GPREL_RO, TARGET_GPREL_RO): New.
(TARGET_SWITCHES): Added gprel-ro and no-gprel-ro.
* doc/invoke.texi: Document them.
2003-09-30 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv-protos.h (frv_gen_GPsym2reg): Declare.
(frv_splittable_got_operand): Removed.
* config/frv/frv.c (frv_cannot_force_const_mem): Reject HIGH and
LO_SUM. Add comments.
(frv_override_options): Moved enabling of FDPIC to
DRIVER_SELF_SPECS. Don't enable MASK_DWORD.
(frv_local_funcdesc_p): Remove unnecessary heck for flag_pie.
(frv_legitimize_fdpic_address): Don't duplicate logic in
frv_emit_movsi.
(frv_gen_GPsym2reg): New.
(unspec_got_name): Added gprel.
(frv_expand_fdpic_call): Add support for inlining PLTs.
(fdpic_fptr_operand): Renamed from frv_fdpic_fptr_operand.
(gpr_or_int12_operand): Added GPREL12.
(pic_symbolic_operand): Match even if !flag_pic for FDPIC.
(small_data_symbolic_operand): Fail if FDPIC.
(fdpic_splittable_got_operand): Removed.
(fdpic_got12_operand): Added GPREL12.
(frv_emit_movsi): Reorganize to avoid duplication. Emit GPREL
when appropriate. Fix sdata GOTOFF.
(frv_legitimate_constant_p): Require legitimate PIC operand for
FDPIC with pic, but only a legitimate fdpic operand for non-pic.
(frv_assemble_integer): Move FDPIC funcdesc handling out of
flag_pic case.
(frv_asm_out_constructor, frv_asm_out_destructor): Abort if
frv_assemble_integer fails.
* config/frv/frv.h (DRIVER_SELF_SPECS): New.
(SUBTARGET_DRIVER_SELF_SPECS): New.
(ASM_SPEC): Don't pass -mno-fdpic.
(LINK_SPEC): Pass -melf32frvfd for FDPIC.
(MASK_INLINE_PLT, TARGET_INLINE_PLT): New.
(TARGET_SWITCHES): Add -minline-plt, -mno-inline-plt and
-multilib-library-pic.
(PREDICATE_CODES): Added fdpic_operand, fdpic_fptr_operand,
condexec_si_media_operator, condexec_sf_add_operator and
condexec_sf_conv_operator. Removed condexec_sf_binary_operator
and condexec_sf_unary_operator.
* config/frv/frv.md (R_FRV_GPREL12, R_FRV_GPRELHI, R_FRV_GPRELLO):
New.
(movsi_got, movsi_high_got, movsi_lo_sum_got): Move before
movsi_internal. Give them internal names. movsi_got has type
int.
(fdpic got splitters): Remove.
(symGPREL2reg, symGPREL2reg_hilo): New.
* config/frv/t-frv (MULTILIB_MATCHES): Don't map -fpic and -fPIC
to -mlibrary-pic. Map -multilib-library-pic to it.
* doc/invoke.texi: -mfdpic, -minline-plt, -multilib-library-pic:
Document.
2003-09-28 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_function_symbol_referenced_p): Declare.
(TARGET_CANNOT_FORCE_CONST_MEM): Define to...
(frv_cannot_force_const_mem): New function.
(const_small_data_p, plus_small_data_p): Update comments on sdata
on FDPIC.
(frv_override_options): Set flag_pie for FDPIC too.
(frv_conditional_register_usage): Mark gr16 and gr17 as non-fixed,
call-saved registers on FDPIC.
(frv_stack_info): Don't preserve the PIC register on FDPIC, and
don't force LR to be preserved.
(frv_expand_prologue): Likewise.
(frv_asm_output_mi_thunk): Use 12-bit funcdesc gotoff for -fpic.
(frv_frame_pointer_required): Don't force it just because the
FDPIC register is used.
(frv_legitimate_address_p) <CONST>: Accept a legitimate FDPIC
operand only if !condexec_p.
(frv_legitimize_address): Return the FDPIC-legitimized address.
Don't match small data here on FDPIC.
(frv_legitimate_fdpic_operand_p): Don't accept unadorned function
symbols. Use TRUE/FALSE instead of 1/0.
(frv_local_funcdesc_p): New.
(frv_legitimize_fdpic_address): Rewrite to use GOTOFF and 12-bit
immediates when possible.
(pic_symbolic_operand): Accept SYMBOL_REFs and CONSTs in FDPIC.
(dbl_memory_one_insn_operand): Accept addresses that add a REG and
an UNSPEC_GOT.
(frv_emit_movsi): Handle FDPIC before small data. Use GOTOFF and
12-bit immediates when possible.
(frv_legitimate_constant_p): In FDPIC, reject SImode operands that
are not legitimate pic operands.
(frv_in_small_data_p): Re-enable for FDPIC.
* config/frv/frv.h (SDA_BASE_REG): Remove comment about FDPIC.
(FRV_GLOBAL_P): Removed.
* config/frv/frv.md: Add modes to CONSTs.
(movsi_got): New.
(movsi_lo_sum_got): Use separate matches instead of match_dup.
(movsi_high_pic, movsi_lo_sum_pic): Match on non-FDPIC only.
(fdpic splittable operations): Match on flag_pic != 1.
2003-09-22 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_asm_out_constructor,
frv_asm_out_destructor): Pass to frv_assemble_integer the size in
bytes, not bits.
2003-09-19 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_assemble_integer): Reject complex
expressions referencing function SYMBOL_REFs.
* config/frv/frv.c (frv_function_symbol_referenced_p): New.
(move_source_operand): Reject CONSTs that reference function
SYMBOL_REFs on FDPIC.
(frv_emit_movsi): If we get such a CONST, break it up.
* config/frv/frv.h (CPP_SPEC): Define __FRV_FDPIC__ for -mfdpic.
(TRANSFER_FROM_TRAMPOLINE): Use different definitions for FDPIC.
* config/frv/frv.c (frv_print_operand) <I>: Recognize PLUS without
MEM.
(frv_assemble_integer): Don't use funcdesc for LABEL_REFs.
(frv_trampoline_size): Increase for FDPIC.
* config/frv/frv.h (TRAMPOLINE_ALIGNMENT): Bump to 64 for FDPIC.
(TRANSFER_FROM_TRAMPOLINE): Handle FDPIC trampolines.
* config/frv/frv.c (frv_legitimize_fdpic_address, frv_emit_movsi):
Disable use of GOTOFF for now.
(const_small_data_p, plus_small_data_p, frv_in_small_data_p):
Disable use of small data in FDPIC for now.
(frv_asm_output_mi_thunk): Implement for FDPIC.
* config/frv/frv.h (SDA_BASE_REG): Set to -1 with FDPIC.
* config/frv/frv.c (frv_asm_out_constructor): Use
frv_assemble_integer for FDPIC pointers.
(frv_asm_out_destructor): Likewise.
* config/frv/frv.md (ldd): Fix order of operands. Use
address_operand for input.
2003-09-18 DJ Delorie <dj@redhat.com>
* config/frv/frv.c (frv_legitimate_fdpic_operand_p): Remove UNSPEC_PIC.
(unspec_got_name): Correct typo.
(frv_emit_movsi): Pre-expand splittable GOTs.
(frv_expand_fdpic_call): Rename gen_lddi to gen_ldd.
* config/frv/frv.md (lddi): Fix syntax error, rename to ldd.
(symGOT2reg_hilo, symGOTOFF2reg_hilo): New.
* config/frv/t-frv: Add -mfdpic multilibs.
* config/frv/frv.h (ASM_SPEC): Pass -mfdpic/-mno-fdpic.
(TARGET_SWITCHES): Add -mno-fdpic, fix documentation.
* config/frv/frv.c (frv_override_options): -mfdpic assumes
flag_pic, default to 32-bit pics, require DWORD ops.
(frv_override_options): Add W and Z constraints.
(frv_expand_prologue): No pic prologue for -mfdpic.
(frv_asm_output_mi_thunk): Support -mfdpic (soon).
(frv_print_operand_memory_reference): Handle GOT constants.
(frv_legitimate_address_p): Allow GOT constants.
(frv_legitimize_address): Handle GOT addresses too.
(frv_legitimate_fdpic_operand_p): New.
(frv_legitimize_fdpic_address): New.
(unspec_got_name): New.
(frv_output_addr_const_extra): New.
(frv_expand_fdpic_call): New.
(frv_fdpic_fptr_operand): New.
(gpr_or_int12_operand): Handle GOT operands.
(int_2word_operand): Handle GOT operands.
(fdpic_operand): New.
(fdpic_splittable_got_operand): New.
(fdpic_got12_operand): New.
(frv_emit_movsi): Handle GOT operands.
(frv_assemble_integer): -mfdpic doesn't use rofixups.
(frv_print_operand): Support 'g' code for GOT operands.
* config/frv/frv-protos.h: Add prototypes as needed.
* config/frv/frv.md (R_FRV_GOT12, R_FRV_GOTHI, R_FRV_GOTLO,
R_FRV_FUNCDESC, R_FRV_FUNCDESC_GOT12, R_FRV_FUNCDESC_GOTHI,
R_FRV_FUNCDESC_GOTLO, R_FRV_FUNCDESC_VALUE,
R_FRV_FUNCDESC_GOTOFF12, R_FRV_FUNCDESC_GOTOFFHI,
R_FRV_FUNCDESC_GOTOFFLO, R_FRV_GOTOFF12, R_FRV_GOTOFFHI,
R_FRV_GOTOFFLO): New.
(movsi_high_got, movsi_lo_sum_got): New.
(*movsi_pic): Don't use this splitter for -mfdpic.
(addsi3): Allow GOT references also.
(call, call_value): Handle -mfdpic separately.
(call_fdpicdi, call_fdpicsi, lddi, call_value_fdpicdi,
call_value_fdpicsi): New.
(symGOT2reg, symGOT2reg_i, got splitters, symGOTOFF2reg,
symGOTOFF2reg_i): New.
* config/frv/frv.h (MASK_FDPIC): New.
(TARGET_FDPIC): New.
(TARGET_SWITCHES): Add -mfdpic.
(FDPIC_FPTR_REGNO): New.
(FDPIC_REGNO): New.
(OUR_FDPIC_REG): New.
(enum reg_class): Add FDPIC_REGS, FDPIC_FPTR_REGS, and
FDPIC_CALL_REGS.
(REG_CLASS_NAMES): Likewise.
(REG_CLASS_CONTENTS): Likewise.
(EXTRA_CONSTRAINT_FOR_Y): New, for 12-bit GOTs.
(EXTRA_CONSTRAINT): Add it here.
(FRV_GLOBAL_P): New.
(OUTPUT_ADDR_CONST_EXTRA): New.
From-SVN: r78373
2004-02-24 17:58:39 +01:00
|
|
|
#endif
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
const unsigned char *p;
|
|
|
|
const struct unw_eh_frame_hdr *hdr;
|
|
|
|
_Unwind_Ptr eh_frame;
|
|
|
|
struct object ob;
|
2009-07-02 06:50:20 +02:00
|
|
|
_Unwind_Ptr pc_low = 0, pc_high = 0;
|
|
|
|
|
2005-03-04 20:54:16 +01:00
|
|
|
struct ext_dl_phdr_info
|
|
|
|
{
|
|
|
|
ElfW(Addr) dlpi_addr;
|
|
|
|
const char *dlpi_name;
|
|
|
|
const ElfW(Phdr) *dlpi_phdr;
|
|
|
|
ElfW(Half) dlpi_phnum;
|
|
|
|
unsigned long long int dlpi_adds;
|
|
|
|
unsigned long long int dlpi_subs;
|
|
|
|
};
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
|
|
|
|
match = 0;
|
|
|
|
phdr = info->dlpi_phdr;
|
|
|
|
load_base = info->dlpi_addr;
|
|
|
|
p_eh_frame_hdr = NULL;
|
|
|
|
p_dynamic = NULL;
|
|
|
|
|
2005-03-04 20:54:16 +01:00
|
|
|
struct frame_hdr_cache_element *prev_cache_entry = NULL,
|
|
|
|
*last_cache_entry = NULL;
|
|
|
|
|
|
|
|
if (data->check_cache && size >= sizeof (struct ext_dl_phdr_info))
|
|
|
|
{
|
|
|
|
static unsigned long long adds = -1ULL, subs;
|
|
|
|
struct ext_dl_phdr_info *einfo = (struct ext_dl_phdr_info *) info;
|
|
|
|
|
|
|
|
/* We use a least recently used cache replacement policy. Also,
|
|
|
|
the most recently used cache entries are placed at the head
|
|
|
|
of the search chain. */
|
|
|
|
|
|
|
|
if (einfo->dlpi_adds == adds && einfo->dlpi_subs == subs)
|
|
|
|
{
|
|
|
|
/* Find data->pc in shared library cache.
|
|
|
|
Set load_base, p_eh_frame_hdr and p_dynamic
|
|
|
|
plus match from the cache and goto
|
|
|
|
"Read .eh_frame_hdr header." below. */
|
|
|
|
|
|
|
|
struct frame_hdr_cache_element *cache_entry;
|
|
|
|
|
|
|
|
for (cache_entry = frame_hdr_cache_head;
|
|
|
|
cache_entry;
|
|
|
|
cache_entry = cache_entry->link)
|
|
|
|
{
|
|
|
|
if (data->pc >= cache_entry->pc_low
|
|
|
|
&& data->pc < cache_entry->pc_high)
|
|
|
|
{
|
|
|
|
load_base = cache_entry->load_base;
|
|
|
|
p_eh_frame_hdr = cache_entry->p_eh_frame_hdr;
|
|
|
|
p_dynamic = cache_entry->p_dynamic;
|
|
|
|
|
|
|
|
/* And move the entry we're using to the head. */
|
|
|
|
if (cache_entry != frame_hdr_cache_head)
|
|
|
|
{
|
|
|
|
prev_cache_entry->link = cache_entry->link;
|
|
|
|
cache_entry->link = frame_hdr_cache_head;
|
|
|
|
frame_hdr_cache_head = cache_entry;
|
|
|
|
}
|
|
|
|
goto found;
|
|
|
|
}
|
2009-11-25 11:55:54 +01:00
|
|
|
|
2005-03-04 20:54:16 +01:00
|
|
|
last_cache_entry = cache_entry;
|
|
|
|
/* Exit early if we found an unused entry. */
|
|
|
|
if ((cache_entry->pc_low | cache_entry->pc_high) == 0)
|
|
|
|
break;
|
|
|
|
if (cache_entry->link != NULL)
|
2009-11-25 11:55:54 +01:00
|
|
|
prev_cache_entry = cache_entry;
|
2005-03-04 20:54:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
adds = einfo->dlpi_adds;
|
|
|
|
subs = einfo->dlpi_subs;
|
|
|
|
/* Initialize the cache. Create a chain of cache entries,
|
|
|
|
with the final one terminated by a NULL link. */
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < FRAME_HDR_CACHE_SIZE; i++)
|
|
|
|
{
|
|
|
|
frame_hdr_cache[i].pc_low = 0;
|
|
|
|
frame_hdr_cache[i].pc_high = 0;
|
|
|
|
frame_hdr_cache[i].link = &frame_hdr_cache[i+1];
|
|
|
|
}
|
|
|
|
frame_hdr_cache[i-1].link = NULL;
|
|
|
|
frame_hdr_cache_head = &frame_hdr_cache[0];
|
|
|
|
data->check_cache = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Make sure struct dl_phdr_info is at least as big as we need. */
|
|
|
|
if (size < offsetof (struct dl_phdr_info, dlpi_phnum)
|
|
|
|
+ sizeof (info->dlpi_phnum))
|
|
|
|
return -1;
|
2009-11-25 11:55:54 +01:00
|
|
|
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
/* See if PC falls into one of the loaded segments. Find the eh_frame
|
|
|
|
segment at the same time. */
|
|
|
|
for (n = info->dlpi_phnum; --n >= 0; phdr++)
|
|
|
|
{
|
|
|
|
if (phdr->p_type == PT_LOAD)
|
|
|
|
{
|
Implement FR-V FDPIC ABI support for frv-uclinux and frv-linux.
2004-02-05 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_emit_movsi): Use GOT relocations for
symbols in sections named by the user.
2004-01-30 Alexandre Oliva <aoliva@redhat.com>
* config/frv/linux.h (TARGET_OS_CPP_BUILTINS): New.
2004-01-27 Alexandre Oliva <aoliva@redhat.com>
* config.gcc (frv-*-*linux*): Handle like *-*-linux*.
* config/frv/t-linux (EXTRA_MULTILIB_PARTS): Remove, obviated by
the above.
2004-01-20 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.md (symGOT2reg_hilo, symGOTOFF2reg_hilo): Add
one more pseudo to further improve code generation.
2004-01-19 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.md (movdi_ldd): Introduce explicit indirection
inside UNSPEC.
2004-01-16 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_legitimate_address_p): Added
allow_double_reg_p argument. Adjust all callers. Use it to
decide whether to enable double-register indirect addressing.
(frv_funcdesc_alias_set): Remove.
(frv_expand_fdpic_call): Force non-SYMBOL_REF operand into
register. Emit movdi_ldd.
(ldd_address_operand): New.
* config/frv/frv-protos.h (frv_legitimate_address_p): Adjust.
* config/frv/frv.h (GO_IF_LEGITIMATE_ADDRESS): Likewise.
(PREDICATE_CODES): Add ldd_address_operand.
* config/frv/frv.md (movdi_ldd): New.
(symGOT2reg_hilo, symGOTOFF2reg_hilo): Use separate pseudo for
intermediate computations if possible.
(symGOTOFF2reg_i): Fix harmless typo.
2003-12-18 Alexandre Oliva <aoliva@redhat.com>
* unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Cast
relocated p_vaddr to vaddr type.
* config/frv/frv-protos.h (frv_expand_fdpic_call): Return void.
* config/frv/frv.c (frv_get_funcdesc_alias_set): New.
(frv_expand_fdpic_call): Propagate incoming MEM's expr to funcdesc
MEM, or use a funcdesc alias set. Use regular move instead of
ldd.
(dbl_memory_one_insn_operand): Recognize function descriptors by
type or by alias set, and don't split them.
* config/frv/frv.md (call, call_value): Never use call_internal
for fdpic.
(call_internal, call_value_internal): Never match for FDPIC.
(call_fdpicdi, call_fdpicsi, call_value_fdpicdi,
call_value_fdpicsi): Require FDPIC.
(ldd): Removed.
2003-12-17 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.h (CRT_GET_RFIB_DATA): Define for __FRV_FDPIC__.
* unwind-dw2-fde-glibc.c: Don't include elf-fdpic.h any more.
(_Unwind_IteratePhdrCallback): Adjust type of load_base for FRV
FDPIC. Compute data base address.
* config/frv/linux.h (SUBTARGET_DRIVER_SELF_SPECS): Enable -mfdpic
before the other self-specs are processed.
* config/frv/t-linux (CRTSTUFF_T_CFLAGS, TARGET_LIBGCC2_CFLAGS):
Build with -fPIC.
2003-12-15 Alexandre Oliva <aoliva@redhat.com>
* unwind-dw2-fde-glibc.c: Don't include bits/elf-fdpic.h if
inhibit_libc is defined.
2003-12-12 Alexandre Oliva <aoliva@redhat.com>
* unwind-dw2-fde-glibc.c: Include bits/elf-fdpic.h for
__FRV_FDPIC__.
(__RELOC_POINTER): Define.
(_Unwind_IteratePhdrCallback): Use it.
* config/frv/frv.h (Twrite): Define.
(TRANSFER_FROM_TRAMPOLINE): Use it.
* config/frv/linux.h (INVOKE__main): Undefine.
(Twrite): Override.
2003-12-05 Richard Sandiford <rsandifo@redhat.com>
* doc/invoke.texi (-mlong-calls, -mlinked-fp): Document FRV options.
(-mlibrary-pic): Emphasize that this option generates EABI code.
(-mcpu): Add fr550.
(-mpack): Remove.
2003-11-30 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (int_2word_operand): Reject LABELs, SYMBOL_REFs
and CONSTs in FDPIC mode.
* gcc/config.gcc (with_cpu): Default to fr400 on frv-*-*linux*.
2003-11-29 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.c (move_source_operand): Don't accept symbolic
constants.
* config/frv/frv.md (*movhi_internal, *movsi_internal): Use an 'n'
rather than 'i' constraint for the 2-instruction alternative.
(*movsi_2word): New, incorporating existing int_2word_operand splitter.
2003-11-29 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.h (EXTRA_CONSTRAINT_FOR_Q): Renamed from
EXTRA_CONSTRAINT_FOR_Y.
(EXTRA_CONSTRAINT): Remove handling of 'Y'.
* config/frv/frv.md (*movsi_internal): Remove 'Q' constraint.
(addsi3): Change 'Y' constraint to 'Q'.
2003-11-27 Richard Sandiford <rsandifo@redhat.com>
* reload.c (CONST_POOL_OK_P): New macro.
(find_reloads): Use it to decide whether a constant can be forced
into memory.
* config/frv/frv.h (LEGITIMATE_PIC_OPERAND_P): Return true if the
constant satisfies got12_operand.
(frv_cannot_force_const_mem): Always return true for TARGET_FDPIC.
(frv_legitimate_address_p): Check for valid unspec offsets using
got12_operand rather than frv_legitimate_fdpic_operand_p.
(frv_legitimate_fdpic_operand_p): Delete.
(frv_emit_movsi): Abort if we try to use the FDPIC register during
or after reload.
(frv_legitimate_constant_p): Return LEGITIMATE_PIC_OPERAND_P if
TARGET_FDPIC.
* config/frv/frv.md (*movdf_double): Add alternatives for CONST_DOUBLE.
2003-11-19 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-protos.h (fdpic_operand, fdpic_got12_operand)
(frv_fdpic_fptr_operand): Don't declare here.
* config/frv/frv.h (EXTRA_CONSTRAINT_FOR_Y): Call got12_operand
rather than fdpic_got12_operand.
(PREDICATE_CODES): Remove symbolic_operand entry. Add entries for
got12_operand and const_unspec_operand.
* config/frv/frv.c (got12_operand): Renamed from fdpic_got12_operand.
(gpr_or_int12_operand, dbl_memory_one_insn_operand): Update calls.
(symbolic_operand): Remove.
(const_unspec_operand): New predicate.
* config/frv/frv.md (*movsi_got): Use got12_operand.
(*movsi_high_got, *movsi_lo_sum_got): Use const_unspec_operand.
2003-11-18 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-protos.h (frv_output_addr_const_extra): Remove.
* config/frv/frv.h (OUTPUT_ADDR_CONST_EXTRA): Remove definition.
* config/frv/frv.c (frv_unspec): New structure.
(frv_small_data_reloc_p, frv_const_unspec_p): New functions.
(frv_print_operand_memory_reference): Use frv_const_unspec_p to
validate CONST indices. Use frv_output_const_unspec to print them.
(frv_print_operand): Update call to unspec_got_name. Use
frv_output_const_unspec to print constant unspecs.
(frv_legitimate_fdpic_operand_p): Return true if frv_const_unspec_p.
Reject UNSPECs otherwise.
(unspec_got_name): Take the relocation number as argument, not an
rtx containing it.
(frv_output_addr_const_extra): Remove, replacing with...
(frv_output_const_unspec): ...this new function.
(frv_find_base_term): Use frv_const_unspec_p & frv_small_data_reloc_p.
(gpr_or_int12_operand): Use fdpic_got12_operand.
(dbl_memory_one_insn_operand): Likewise.
(fdpic_got12_operand): Use frv_const_unspec_p.
(frv_emit_movsi): Use frv_const_unspec_p to check for CONSTs that
are already legitimate. Use frv_small_data_reloc_p when deciding
whether to use HIGH/LO_SUM for R_FRV_GOTOFF12 and R_FRV_GPREL12.
2003-11-18 Alexandre Oliva <aoliva@redhat.com>
* config/frv/t-linux (SHLIB_MAPFILES): Override so as to export...
* config/frv/libgcc-frv.ver: ... frv-specific symbols. New file.
* config/frv/frv-abi.h (CREATE_DOUBLE_SHIFT): Use branch to local
label, for real this time.
* config/frv/frv.c (frv_local_funcdesc_p): Update to new
representation of visibility.
(fdpic_got12_operand, symbolic_operand): Mark unused arguments as
such.
2003-11-17 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.h (MASK_LINKED_FP, TARGET_LINKED_FP): New macros.
(TARGET_SWITCHES): Add -mlinked-fp and -mno-linked-fp.
* config/frv/frv.c (frv_override_options): Set MASK_LINKED_FP unless
it was explicitly disabled.
(frv_stack_info): There is no need to save the link register in every
frame unless TARGET_LINKED_FP is true.
(frv_frame_pointer_required): If !TARGET_LINKED_FP, only require a
frame pointer if the stack pointer might change value.
(frv_return_addr_rtx): Check and process "count" argument.
2003-11-14 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-protos.h (frv_legitimize_address): Remove.
(frv_find_base_term): Declare.
* config/frv/frv.h (LEGITIMIZE_ADDRESS): Do nothing.
(FIND_BASE_TERM): Define.
(PREDICATE_CODES): Remove pic_register_operand, pic_symbolic_operand,
small_data_register_operand, small_data_symbolic_operand. Add
symbolic_operand.
* config/frv/frv.c (const_small_data_p, plus_small_data_p): Delete.
(frv_print_operand_memory_reference, output_move_single): Remove
special handling for unlegitimized sdata addresses.
(frv_legitimate_address_p): Don't allow sums of SDA_BASE_REG
and symbolic addresses.
(frv_legitimize_address, frv_legitimize_fdpic_address): Delete.
(frv_find_base_term): New function.
(int_2word_operand): Check specifically for symbolic address constants.
(pic_register_operand, pic_symbolic_operand): Delete.
(small_data_register_operand, small_data_symbolic_operand): Delete.
(dbl_memory_one_insn_operand): Don't call plus_small_data_p.
Allow UNSPEC_GOT constants if !TARGET_FDPIC.
(move_source_operand): Only accept CONSTs if they're a two-insn
symbolic constant.
(fdpic_got12_operand): Don't require TARGET_FDPIC.
(frv_emit_movsi): Legitimize sdata and -mlibrary-pic addresses
using gen_symGOTOFF2reg*.
(frv_ifcvt_rewrite_mem): Remove (plus gr16 ...) special cases.
(frv_rtx_costs): Give all MEM addresses a cost of 0. Give MEMs
themselves a cost of 3 insns.
* config/mips/mips.md (*movsi_got): Allow for !TARGET_FDPIC too.
Change predicate to symbolic_operand.
(*movsi_high_got, *movsi_lo_sum_got): Likewise.
(*movsi_lda_sdata): Delete.
(*movsi_pic, movsi_high_pic, movsi_lo_sum_pic): Delete.
2003-11-05 Alexandre Oliva <aoliva@redhat.com>
* config.gcc: Add t-slibgcc-elf-ver and support --with-cpu for
frv-*-*linux*.
* config/frv/frv-abi.h (CREATE_DOUBLE_SHIFT): Use branch to local
label.
* config/frv/frv.h (DRIVER_SELF_SPECS): Add blank before
-multilib-library-pic.
(LINK_SPEC): Add -z text for -mfdpic.
* config/frv/frvbegin.c (__ROFIXUP_LIST__): Don't define on FDPIC.
* config/frv/frvend.c (__ROFIXUP_END__): Likewise.
* config/frv/linux.h (STARTFILE_SPEC, ENDFILE_SPEC, LINK_SPEC):
Override.
(OPTION_DEFAULT_SPECS, HAS_INIT_SECTION, INIT_SECTION_ASM_OP,
FINI_SECTION_ASM_OP, CRT_CALL_STATIC_FUNCTION): Define.
* config/frv/t-linux (EXTRA_MULTILIB_PARTS): Use
crtstuff-generated files.
2003-10-31 Alexandre Oliva <aoliva@redhat.com>
* config.gcc: Add frv-*-*linux*.
* config/frv/linux.h, config/frv/t-linux: New.
2003-10-06 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.h (LINK_SPEC): Pass -melf32frvfd to the linker
when -mfdpic even if a linker script is explicitly listed.
2003-10-02 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_override_options): Clear asm_out
unaligned_op for SImode on FDPIC.
(frv_emit_movsi): Use compute_reloc_for_constant to compute the
argument passed to decl_readonly_section.
(frv_assemble_integer): Revert 2003-09-30's change, but make the
whole block run with FDPIC even with -fno-PIC.
2003-10-02 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_cannot_force_const_mem): Don't force
symbol or label plus offset to memory.
(frv_emit_movsi): Emit GPREL only if -mgprel-ro. Emit 32-bit
GOTOFF and GPREL for LABEL_REF.
* config/frv/frv.h (DRIVER_SELF_SPECS): Add -mgprel-ro with
-mfdpic unless -mno-gprel-ro, -fpic or -fpie.
(MASK_GPREL_RO, TARGET_GPREL_RO): New.
(TARGET_SWITCHES): Added gprel-ro and no-gprel-ro.
* doc/invoke.texi: Document them.
2003-09-30 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv-protos.h (frv_gen_GPsym2reg): Declare.
(frv_splittable_got_operand): Removed.
* config/frv/frv.c (frv_cannot_force_const_mem): Reject HIGH and
LO_SUM. Add comments.
(frv_override_options): Moved enabling of FDPIC to
DRIVER_SELF_SPECS. Don't enable MASK_DWORD.
(frv_local_funcdesc_p): Remove unnecessary heck for flag_pie.
(frv_legitimize_fdpic_address): Don't duplicate logic in
frv_emit_movsi.
(frv_gen_GPsym2reg): New.
(unspec_got_name): Added gprel.
(frv_expand_fdpic_call): Add support for inlining PLTs.
(fdpic_fptr_operand): Renamed from frv_fdpic_fptr_operand.
(gpr_or_int12_operand): Added GPREL12.
(pic_symbolic_operand): Match even if !flag_pic for FDPIC.
(small_data_symbolic_operand): Fail if FDPIC.
(fdpic_splittable_got_operand): Removed.
(fdpic_got12_operand): Added GPREL12.
(frv_emit_movsi): Reorganize to avoid duplication. Emit GPREL
when appropriate. Fix sdata GOTOFF.
(frv_legitimate_constant_p): Require legitimate PIC operand for
FDPIC with pic, but only a legitimate fdpic operand for non-pic.
(frv_assemble_integer): Move FDPIC funcdesc handling out of
flag_pic case.
(frv_asm_out_constructor, frv_asm_out_destructor): Abort if
frv_assemble_integer fails.
* config/frv/frv.h (DRIVER_SELF_SPECS): New.
(SUBTARGET_DRIVER_SELF_SPECS): New.
(ASM_SPEC): Don't pass -mno-fdpic.
(LINK_SPEC): Pass -melf32frvfd for FDPIC.
(MASK_INLINE_PLT, TARGET_INLINE_PLT): New.
(TARGET_SWITCHES): Add -minline-plt, -mno-inline-plt and
-multilib-library-pic.
(PREDICATE_CODES): Added fdpic_operand, fdpic_fptr_operand,
condexec_si_media_operator, condexec_sf_add_operator and
condexec_sf_conv_operator. Removed condexec_sf_binary_operator
and condexec_sf_unary_operator.
* config/frv/frv.md (R_FRV_GPREL12, R_FRV_GPRELHI, R_FRV_GPRELLO):
New.
(movsi_got, movsi_high_got, movsi_lo_sum_got): Move before
movsi_internal. Give them internal names. movsi_got has type
int.
(fdpic got splitters): Remove.
(symGPREL2reg, symGPREL2reg_hilo): New.
* config/frv/t-frv (MULTILIB_MATCHES): Don't map -fpic and -fPIC
to -mlibrary-pic. Map -multilib-library-pic to it.
* doc/invoke.texi: -mfdpic, -minline-plt, -multilib-library-pic:
Document.
2003-09-28 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_function_symbol_referenced_p): Declare.
(TARGET_CANNOT_FORCE_CONST_MEM): Define to...
(frv_cannot_force_const_mem): New function.
(const_small_data_p, plus_small_data_p): Update comments on sdata
on FDPIC.
(frv_override_options): Set flag_pie for FDPIC too.
(frv_conditional_register_usage): Mark gr16 and gr17 as non-fixed,
call-saved registers on FDPIC.
(frv_stack_info): Don't preserve the PIC register on FDPIC, and
don't force LR to be preserved.
(frv_expand_prologue): Likewise.
(frv_asm_output_mi_thunk): Use 12-bit funcdesc gotoff for -fpic.
(frv_frame_pointer_required): Don't force it just because the
FDPIC register is used.
(frv_legitimate_address_p) <CONST>: Accept a legitimate FDPIC
operand only if !condexec_p.
(frv_legitimize_address): Return the FDPIC-legitimized address.
Don't match small data here on FDPIC.
(frv_legitimate_fdpic_operand_p): Don't accept unadorned function
symbols. Use TRUE/FALSE instead of 1/0.
(frv_local_funcdesc_p): New.
(frv_legitimize_fdpic_address): Rewrite to use GOTOFF and 12-bit
immediates when possible.
(pic_symbolic_operand): Accept SYMBOL_REFs and CONSTs in FDPIC.
(dbl_memory_one_insn_operand): Accept addresses that add a REG and
an UNSPEC_GOT.
(frv_emit_movsi): Handle FDPIC before small data. Use GOTOFF and
12-bit immediates when possible.
(frv_legitimate_constant_p): In FDPIC, reject SImode operands that
are not legitimate pic operands.
(frv_in_small_data_p): Re-enable for FDPIC.
* config/frv/frv.h (SDA_BASE_REG): Remove comment about FDPIC.
(FRV_GLOBAL_P): Removed.
* config/frv/frv.md: Add modes to CONSTs.
(movsi_got): New.
(movsi_lo_sum_got): Use separate matches instead of match_dup.
(movsi_high_pic, movsi_lo_sum_pic): Match on non-FDPIC only.
(fdpic splittable operations): Match on flag_pic != 1.
2003-09-22 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_asm_out_constructor,
frv_asm_out_destructor): Pass to frv_assemble_integer the size in
bytes, not bits.
2003-09-19 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_assemble_integer): Reject complex
expressions referencing function SYMBOL_REFs.
* config/frv/frv.c (frv_function_symbol_referenced_p): New.
(move_source_operand): Reject CONSTs that reference function
SYMBOL_REFs on FDPIC.
(frv_emit_movsi): If we get such a CONST, break it up.
* config/frv/frv.h (CPP_SPEC): Define __FRV_FDPIC__ for -mfdpic.
(TRANSFER_FROM_TRAMPOLINE): Use different definitions for FDPIC.
* config/frv/frv.c (frv_print_operand) <I>: Recognize PLUS without
MEM.
(frv_assemble_integer): Don't use funcdesc for LABEL_REFs.
(frv_trampoline_size): Increase for FDPIC.
* config/frv/frv.h (TRAMPOLINE_ALIGNMENT): Bump to 64 for FDPIC.
(TRANSFER_FROM_TRAMPOLINE): Handle FDPIC trampolines.
* config/frv/frv.c (frv_legitimize_fdpic_address, frv_emit_movsi):
Disable use of GOTOFF for now.
(const_small_data_p, plus_small_data_p, frv_in_small_data_p):
Disable use of small data in FDPIC for now.
(frv_asm_output_mi_thunk): Implement for FDPIC.
* config/frv/frv.h (SDA_BASE_REG): Set to -1 with FDPIC.
* config/frv/frv.c (frv_asm_out_constructor): Use
frv_assemble_integer for FDPIC pointers.
(frv_asm_out_destructor): Likewise.
* config/frv/frv.md (ldd): Fix order of operands. Use
address_operand for input.
2003-09-18 DJ Delorie <dj@redhat.com>
* config/frv/frv.c (frv_legitimate_fdpic_operand_p): Remove UNSPEC_PIC.
(unspec_got_name): Correct typo.
(frv_emit_movsi): Pre-expand splittable GOTs.
(frv_expand_fdpic_call): Rename gen_lddi to gen_ldd.
* config/frv/frv.md (lddi): Fix syntax error, rename to ldd.
(symGOT2reg_hilo, symGOTOFF2reg_hilo): New.
* config/frv/t-frv: Add -mfdpic multilibs.
* config/frv/frv.h (ASM_SPEC): Pass -mfdpic/-mno-fdpic.
(TARGET_SWITCHES): Add -mno-fdpic, fix documentation.
* config/frv/frv.c (frv_override_options): -mfdpic assumes
flag_pic, default to 32-bit pics, require DWORD ops.
(frv_override_options): Add W and Z constraints.
(frv_expand_prologue): No pic prologue for -mfdpic.
(frv_asm_output_mi_thunk): Support -mfdpic (soon).
(frv_print_operand_memory_reference): Handle GOT constants.
(frv_legitimate_address_p): Allow GOT constants.
(frv_legitimize_address): Handle GOT addresses too.
(frv_legitimate_fdpic_operand_p): New.
(frv_legitimize_fdpic_address): New.
(unspec_got_name): New.
(frv_output_addr_const_extra): New.
(frv_expand_fdpic_call): New.
(frv_fdpic_fptr_operand): New.
(gpr_or_int12_operand): Handle GOT operands.
(int_2word_operand): Handle GOT operands.
(fdpic_operand): New.
(fdpic_splittable_got_operand): New.
(fdpic_got12_operand): New.
(frv_emit_movsi): Handle GOT operands.
(frv_assemble_integer): -mfdpic doesn't use rofixups.
(frv_print_operand): Support 'g' code for GOT operands.
* config/frv/frv-protos.h: Add prototypes as needed.
* config/frv/frv.md (R_FRV_GOT12, R_FRV_GOTHI, R_FRV_GOTLO,
R_FRV_FUNCDESC, R_FRV_FUNCDESC_GOT12, R_FRV_FUNCDESC_GOTHI,
R_FRV_FUNCDESC_GOTLO, R_FRV_FUNCDESC_VALUE,
R_FRV_FUNCDESC_GOTOFF12, R_FRV_FUNCDESC_GOTOFFHI,
R_FRV_FUNCDESC_GOTOFFLO, R_FRV_GOTOFF12, R_FRV_GOTOFFHI,
R_FRV_GOTOFFLO): New.
(movsi_high_got, movsi_lo_sum_got): New.
(*movsi_pic): Don't use this splitter for -mfdpic.
(addsi3): Allow GOT references also.
(call, call_value): Handle -mfdpic separately.
(call_fdpicdi, call_fdpicsi, lddi, call_value_fdpicdi,
call_value_fdpicsi): New.
(symGOT2reg, symGOT2reg_i, got splitters, symGOTOFF2reg,
symGOTOFF2reg_i): New.
* config/frv/frv.h (MASK_FDPIC): New.
(TARGET_FDPIC): New.
(TARGET_SWITCHES): Add -mfdpic.
(FDPIC_FPTR_REGNO): New.
(FDPIC_REGNO): New.
(OUR_FDPIC_REG): New.
(enum reg_class): Add FDPIC_REGS, FDPIC_FPTR_REGS, and
FDPIC_CALL_REGS.
(REG_CLASS_NAMES): Likewise.
(REG_CLASS_CONTENTS): Likewise.
(EXTRA_CONSTRAINT_FOR_Y): New, for 12-bit GOTs.
(EXTRA_CONSTRAINT): Add it here.
(FRV_GLOBAL_P): New.
(OUTPUT_ADDR_CONST_EXTRA): New.
From-SVN: r78373
2004-02-24 17:58:39 +01:00
|
|
|
_Unwind_Ptr vaddr = (_Unwind_Ptr)
|
|
|
|
__RELOC_POINTER (phdr->p_vaddr, load_base);
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
if (data->pc >= vaddr && data->pc < vaddr + phdr->p_memsz)
|
2005-03-04 20:54:16 +01:00
|
|
|
{
|
|
|
|
match = 1;
|
|
|
|
pc_low = vaddr;
|
|
|
|
pc_high = vaddr + phdr->p_memsz;
|
|
|
|
}
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
}
|
|
|
|
else if (phdr->p_type == PT_GNU_EH_FRAME)
|
|
|
|
p_eh_frame_hdr = phdr;
|
2010-12-23 13:08:21 +01:00
|
|
|
#ifdef PT_SUNW_UNWIND
|
|
|
|
/* Sun ld emits PT_SUNW_UNWIND .eh_frame_hdr sections instead of
|
|
|
|
PT_SUNW_EH_FRAME/PT_GNU_EH_FRAME, so accept them as well. */
|
|
|
|
else if (phdr->p_type == PT_SUNW_UNWIND)
|
|
|
|
p_eh_frame_hdr = phdr;
|
|
|
|
#endif
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
else if (phdr->p_type == PT_DYNAMIC)
|
|
|
|
p_dynamic = phdr;
|
|
|
|
}
|
2009-11-25 11:55:54 +01:00
|
|
|
|
2005-03-04 20:54:16 +01:00
|
|
|
if (!match)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (size >= sizeof (struct ext_dl_phdr_info))
|
|
|
|
{
|
2005-12-15 17:17:50 +01:00
|
|
|
/* Move the cache entry we're about to overwrite to the head of
|
|
|
|
the list. If either last_cache_entry or prev_cache_entry are
|
|
|
|
NULL, that cache entry is already at the head. */
|
|
|
|
if (last_cache_entry != NULL && prev_cache_entry != NULL)
|
2005-03-04 20:54:16 +01:00
|
|
|
{
|
|
|
|
prev_cache_entry->link = last_cache_entry->link;
|
|
|
|
last_cache_entry->link = frame_hdr_cache_head;
|
|
|
|
frame_hdr_cache_head = last_cache_entry;
|
|
|
|
}
|
|
|
|
|
|
|
|
frame_hdr_cache_head->load_base = load_base;
|
|
|
|
frame_hdr_cache_head->p_eh_frame_hdr = p_eh_frame_hdr;
|
|
|
|
frame_hdr_cache_head->p_dynamic = p_dynamic;
|
|
|
|
frame_hdr_cache_head->pc_low = pc_low;
|
|
|
|
frame_hdr_cache_head->pc_high = pc_high;
|
|
|
|
}
|
|
|
|
|
|
|
|
found:
|
|
|
|
|
|
|
|
if (!p_eh_frame_hdr)
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* Read .eh_frame_hdr header. */
|
|
|
|
hdr = (const struct unw_eh_frame_hdr *)
|
Implement FR-V FDPIC ABI support for frv-uclinux and frv-linux.
2004-02-05 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_emit_movsi): Use GOT relocations for
symbols in sections named by the user.
2004-01-30 Alexandre Oliva <aoliva@redhat.com>
* config/frv/linux.h (TARGET_OS_CPP_BUILTINS): New.
2004-01-27 Alexandre Oliva <aoliva@redhat.com>
* config.gcc (frv-*-*linux*): Handle like *-*-linux*.
* config/frv/t-linux (EXTRA_MULTILIB_PARTS): Remove, obviated by
the above.
2004-01-20 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.md (symGOT2reg_hilo, symGOTOFF2reg_hilo): Add
one more pseudo to further improve code generation.
2004-01-19 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.md (movdi_ldd): Introduce explicit indirection
inside UNSPEC.
2004-01-16 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_legitimate_address_p): Added
allow_double_reg_p argument. Adjust all callers. Use it to
decide whether to enable double-register indirect addressing.
(frv_funcdesc_alias_set): Remove.
(frv_expand_fdpic_call): Force non-SYMBOL_REF operand into
register. Emit movdi_ldd.
(ldd_address_operand): New.
* config/frv/frv-protos.h (frv_legitimate_address_p): Adjust.
* config/frv/frv.h (GO_IF_LEGITIMATE_ADDRESS): Likewise.
(PREDICATE_CODES): Add ldd_address_operand.
* config/frv/frv.md (movdi_ldd): New.
(symGOT2reg_hilo, symGOTOFF2reg_hilo): Use separate pseudo for
intermediate computations if possible.
(symGOTOFF2reg_i): Fix harmless typo.
2003-12-18 Alexandre Oliva <aoliva@redhat.com>
* unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Cast
relocated p_vaddr to vaddr type.
* config/frv/frv-protos.h (frv_expand_fdpic_call): Return void.
* config/frv/frv.c (frv_get_funcdesc_alias_set): New.
(frv_expand_fdpic_call): Propagate incoming MEM's expr to funcdesc
MEM, or use a funcdesc alias set. Use regular move instead of
ldd.
(dbl_memory_one_insn_operand): Recognize function descriptors by
type or by alias set, and don't split them.
* config/frv/frv.md (call, call_value): Never use call_internal
for fdpic.
(call_internal, call_value_internal): Never match for FDPIC.
(call_fdpicdi, call_fdpicsi, call_value_fdpicdi,
call_value_fdpicsi): Require FDPIC.
(ldd): Removed.
2003-12-17 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.h (CRT_GET_RFIB_DATA): Define for __FRV_FDPIC__.
* unwind-dw2-fde-glibc.c: Don't include elf-fdpic.h any more.
(_Unwind_IteratePhdrCallback): Adjust type of load_base for FRV
FDPIC. Compute data base address.
* config/frv/linux.h (SUBTARGET_DRIVER_SELF_SPECS): Enable -mfdpic
before the other self-specs are processed.
* config/frv/t-linux (CRTSTUFF_T_CFLAGS, TARGET_LIBGCC2_CFLAGS):
Build with -fPIC.
2003-12-15 Alexandre Oliva <aoliva@redhat.com>
* unwind-dw2-fde-glibc.c: Don't include bits/elf-fdpic.h if
inhibit_libc is defined.
2003-12-12 Alexandre Oliva <aoliva@redhat.com>
* unwind-dw2-fde-glibc.c: Include bits/elf-fdpic.h for
__FRV_FDPIC__.
(__RELOC_POINTER): Define.
(_Unwind_IteratePhdrCallback): Use it.
* config/frv/frv.h (Twrite): Define.
(TRANSFER_FROM_TRAMPOLINE): Use it.
* config/frv/linux.h (INVOKE__main): Undefine.
(Twrite): Override.
2003-12-05 Richard Sandiford <rsandifo@redhat.com>
* doc/invoke.texi (-mlong-calls, -mlinked-fp): Document FRV options.
(-mlibrary-pic): Emphasize that this option generates EABI code.
(-mcpu): Add fr550.
(-mpack): Remove.
2003-11-30 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (int_2word_operand): Reject LABELs, SYMBOL_REFs
and CONSTs in FDPIC mode.
* gcc/config.gcc (with_cpu): Default to fr400 on frv-*-*linux*.
2003-11-29 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.c (move_source_operand): Don't accept symbolic
constants.
* config/frv/frv.md (*movhi_internal, *movsi_internal): Use an 'n'
rather than 'i' constraint for the 2-instruction alternative.
(*movsi_2word): New, incorporating existing int_2word_operand splitter.
2003-11-29 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.h (EXTRA_CONSTRAINT_FOR_Q): Renamed from
EXTRA_CONSTRAINT_FOR_Y.
(EXTRA_CONSTRAINT): Remove handling of 'Y'.
* config/frv/frv.md (*movsi_internal): Remove 'Q' constraint.
(addsi3): Change 'Y' constraint to 'Q'.
2003-11-27 Richard Sandiford <rsandifo@redhat.com>
* reload.c (CONST_POOL_OK_P): New macro.
(find_reloads): Use it to decide whether a constant can be forced
into memory.
* config/frv/frv.h (LEGITIMATE_PIC_OPERAND_P): Return true if the
constant satisfies got12_operand.
(frv_cannot_force_const_mem): Always return true for TARGET_FDPIC.
(frv_legitimate_address_p): Check for valid unspec offsets using
got12_operand rather than frv_legitimate_fdpic_operand_p.
(frv_legitimate_fdpic_operand_p): Delete.
(frv_emit_movsi): Abort if we try to use the FDPIC register during
or after reload.
(frv_legitimate_constant_p): Return LEGITIMATE_PIC_OPERAND_P if
TARGET_FDPIC.
* config/frv/frv.md (*movdf_double): Add alternatives for CONST_DOUBLE.
2003-11-19 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-protos.h (fdpic_operand, fdpic_got12_operand)
(frv_fdpic_fptr_operand): Don't declare here.
* config/frv/frv.h (EXTRA_CONSTRAINT_FOR_Y): Call got12_operand
rather than fdpic_got12_operand.
(PREDICATE_CODES): Remove symbolic_operand entry. Add entries for
got12_operand and const_unspec_operand.
* config/frv/frv.c (got12_operand): Renamed from fdpic_got12_operand.
(gpr_or_int12_operand, dbl_memory_one_insn_operand): Update calls.
(symbolic_operand): Remove.
(const_unspec_operand): New predicate.
* config/frv/frv.md (*movsi_got): Use got12_operand.
(*movsi_high_got, *movsi_lo_sum_got): Use const_unspec_operand.
2003-11-18 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-protos.h (frv_output_addr_const_extra): Remove.
* config/frv/frv.h (OUTPUT_ADDR_CONST_EXTRA): Remove definition.
* config/frv/frv.c (frv_unspec): New structure.
(frv_small_data_reloc_p, frv_const_unspec_p): New functions.
(frv_print_operand_memory_reference): Use frv_const_unspec_p to
validate CONST indices. Use frv_output_const_unspec to print them.
(frv_print_operand): Update call to unspec_got_name. Use
frv_output_const_unspec to print constant unspecs.
(frv_legitimate_fdpic_operand_p): Return true if frv_const_unspec_p.
Reject UNSPECs otherwise.
(unspec_got_name): Take the relocation number as argument, not an
rtx containing it.
(frv_output_addr_const_extra): Remove, replacing with...
(frv_output_const_unspec): ...this new function.
(frv_find_base_term): Use frv_const_unspec_p & frv_small_data_reloc_p.
(gpr_or_int12_operand): Use fdpic_got12_operand.
(dbl_memory_one_insn_operand): Likewise.
(fdpic_got12_operand): Use frv_const_unspec_p.
(frv_emit_movsi): Use frv_const_unspec_p to check for CONSTs that
are already legitimate. Use frv_small_data_reloc_p when deciding
whether to use HIGH/LO_SUM for R_FRV_GOTOFF12 and R_FRV_GPREL12.
2003-11-18 Alexandre Oliva <aoliva@redhat.com>
* config/frv/t-linux (SHLIB_MAPFILES): Override so as to export...
* config/frv/libgcc-frv.ver: ... frv-specific symbols. New file.
* config/frv/frv-abi.h (CREATE_DOUBLE_SHIFT): Use branch to local
label, for real this time.
* config/frv/frv.c (frv_local_funcdesc_p): Update to new
representation of visibility.
(fdpic_got12_operand, symbolic_operand): Mark unused arguments as
such.
2003-11-17 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.h (MASK_LINKED_FP, TARGET_LINKED_FP): New macros.
(TARGET_SWITCHES): Add -mlinked-fp and -mno-linked-fp.
* config/frv/frv.c (frv_override_options): Set MASK_LINKED_FP unless
it was explicitly disabled.
(frv_stack_info): There is no need to save the link register in every
frame unless TARGET_LINKED_FP is true.
(frv_frame_pointer_required): If !TARGET_LINKED_FP, only require a
frame pointer if the stack pointer might change value.
(frv_return_addr_rtx): Check and process "count" argument.
2003-11-14 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-protos.h (frv_legitimize_address): Remove.
(frv_find_base_term): Declare.
* config/frv/frv.h (LEGITIMIZE_ADDRESS): Do nothing.
(FIND_BASE_TERM): Define.
(PREDICATE_CODES): Remove pic_register_operand, pic_symbolic_operand,
small_data_register_operand, small_data_symbolic_operand. Add
symbolic_operand.
* config/frv/frv.c (const_small_data_p, plus_small_data_p): Delete.
(frv_print_operand_memory_reference, output_move_single): Remove
special handling for unlegitimized sdata addresses.
(frv_legitimate_address_p): Don't allow sums of SDA_BASE_REG
and symbolic addresses.
(frv_legitimize_address, frv_legitimize_fdpic_address): Delete.
(frv_find_base_term): New function.
(int_2word_operand): Check specifically for symbolic address constants.
(pic_register_operand, pic_symbolic_operand): Delete.
(small_data_register_operand, small_data_symbolic_operand): Delete.
(dbl_memory_one_insn_operand): Don't call plus_small_data_p.
Allow UNSPEC_GOT constants if !TARGET_FDPIC.
(move_source_operand): Only accept CONSTs if they're a two-insn
symbolic constant.
(fdpic_got12_operand): Don't require TARGET_FDPIC.
(frv_emit_movsi): Legitimize sdata and -mlibrary-pic addresses
using gen_symGOTOFF2reg*.
(frv_ifcvt_rewrite_mem): Remove (plus gr16 ...) special cases.
(frv_rtx_costs): Give all MEM addresses a cost of 0. Give MEMs
themselves a cost of 3 insns.
* config/mips/mips.md (*movsi_got): Allow for !TARGET_FDPIC too.
Change predicate to symbolic_operand.
(*movsi_high_got, *movsi_lo_sum_got): Likewise.
(*movsi_lda_sdata): Delete.
(*movsi_pic, movsi_high_pic, movsi_lo_sum_pic): Delete.
2003-11-05 Alexandre Oliva <aoliva@redhat.com>
* config.gcc: Add t-slibgcc-elf-ver and support --with-cpu for
frv-*-*linux*.
* config/frv/frv-abi.h (CREATE_DOUBLE_SHIFT): Use branch to local
label.
* config/frv/frv.h (DRIVER_SELF_SPECS): Add blank before
-multilib-library-pic.
(LINK_SPEC): Add -z text for -mfdpic.
* config/frv/frvbegin.c (__ROFIXUP_LIST__): Don't define on FDPIC.
* config/frv/frvend.c (__ROFIXUP_END__): Likewise.
* config/frv/linux.h (STARTFILE_SPEC, ENDFILE_SPEC, LINK_SPEC):
Override.
(OPTION_DEFAULT_SPECS, HAS_INIT_SECTION, INIT_SECTION_ASM_OP,
FINI_SECTION_ASM_OP, CRT_CALL_STATIC_FUNCTION): Define.
* config/frv/t-linux (EXTRA_MULTILIB_PARTS): Use
crtstuff-generated files.
2003-10-31 Alexandre Oliva <aoliva@redhat.com>
* config.gcc: Add frv-*-*linux*.
* config/frv/linux.h, config/frv/t-linux: New.
2003-10-06 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.h (LINK_SPEC): Pass -melf32frvfd to the linker
when -mfdpic even if a linker script is explicitly listed.
2003-10-02 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_override_options): Clear asm_out
unaligned_op for SImode on FDPIC.
(frv_emit_movsi): Use compute_reloc_for_constant to compute the
argument passed to decl_readonly_section.
(frv_assemble_integer): Revert 2003-09-30's change, but make the
whole block run with FDPIC even with -fno-PIC.
2003-10-02 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_cannot_force_const_mem): Don't force
symbol or label plus offset to memory.
(frv_emit_movsi): Emit GPREL only if -mgprel-ro. Emit 32-bit
GOTOFF and GPREL for LABEL_REF.
* config/frv/frv.h (DRIVER_SELF_SPECS): Add -mgprel-ro with
-mfdpic unless -mno-gprel-ro, -fpic or -fpie.
(MASK_GPREL_RO, TARGET_GPREL_RO): New.
(TARGET_SWITCHES): Added gprel-ro and no-gprel-ro.
* doc/invoke.texi: Document them.
2003-09-30 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv-protos.h (frv_gen_GPsym2reg): Declare.
(frv_splittable_got_operand): Removed.
* config/frv/frv.c (frv_cannot_force_const_mem): Reject HIGH and
LO_SUM. Add comments.
(frv_override_options): Moved enabling of FDPIC to
DRIVER_SELF_SPECS. Don't enable MASK_DWORD.
(frv_local_funcdesc_p): Remove unnecessary heck for flag_pie.
(frv_legitimize_fdpic_address): Don't duplicate logic in
frv_emit_movsi.
(frv_gen_GPsym2reg): New.
(unspec_got_name): Added gprel.
(frv_expand_fdpic_call): Add support for inlining PLTs.
(fdpic_fptr_operand): Renamed from frv_fdpic_fptr_operand.
(gpr_or_int12_operand): Added GPREL12.
(pic_symbolic_operand): Match even if !flag_pic for FDPIC.
(small_data_symbolic_operand): Fail if FDPIC.
(fdpic_splittable_got_operand): Removed.
(fdpic_got12_operand): Added GPREL12.
(frv_emit_movsi): Reorganize to avoid duplication. Emit GPREL
when appropriate. Fix sdata GOTOFF.
(frv_legitimate_constant_p): Require legitimate PIC operand for
FDPIC with pic, but only a legitimate fdpic operand for non-pic.
(frv_assemble_integer): Move FDPIC funcdesc handling out of
flag_pic case.
(frv_asm_out_constructor, frv_asm_out_destructor): Abort if
frv_assemble_integer fails.
* config/frv/frv.h (DRIVER_SELF_SPECS): New.
(SUBTARGET_DRIVER_SELF_SPECS): New.
(ASM_SPEC): Don't pass -mno-fdpic.
(LINK_SPEC): Pass -melf32frvfd for FDPIC.
(MASK_INLINE_PLT, TARGET_INLINE_PLT): New.
(TARGET_SWITCHES): Add -minline-plt, -mno-inline-plt and
-multilib-library-pic.
(PREDICATE_CODES): Added fdpic_operand, fdpic_fptr_operand,
condexec_si_media_operator, condexec_sf_add_operator and
condexec_sf_conv_operator. Removed condexec_sf_binary_operator
and condexec_sf_unary_operator.
* config/frv/frv.md (R_FRV_GPREL12, R_FRV_GPRELHI, R_FRV_GPRELLO):
New.
(movsi_got, movsi_high_got, movsi_lo_sum_got): Move before
movsi_internal. Give them internal names. movsi_got has type
int.
(fdpic got splitters): Remove.
(symGPREL2reg, symGPREL2reg_hilo): New.
* config/frv/t-frv (MULTILIB_MATCHES): Don't map -fpic and -fPIC
to -mlibrary-pic. Map -multilib-library-pic to it.
* doc/invoke.texi: -mfdpic, -minline-plt, -multilib-library-pic:
Document.
2003-09-28 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_function_symbol_referenced_p): Declare.
(TARGET_CANNOT_FORCE_CONST_MEM): Define to...
(frv_cannot_force_const_mem): New function.
(const_small_data_p, plus_small_data_p): Update comments on sdata
on FDPIC.
(frv_override_options): Set flag_pie for FDPIC too.
(frv_conditional_register_usage): Mark gr16 and gr17 as non-fixed,
call-saved registers on FDPIC.
(frv_stack_info): Don't preserve the PIC register on FDPIC, and
don't force LR to be preserved.
(frv_expand_prologue): Likewise.
(frv_asm_output_mi_thunk): Use 12-bit funcdesc gotoff for -fpic.
(frv_frame_pointer_required): Don't force it just because the
FDPIC register is used.
(frv_legitimate_address_p) <CONST>: Accept a legitimate FDPIC
operand only if !condexec_p.
(frv_legitimize_address): Return the FDPIC-legitimized address.
Don't match small data here on FDPIC.
(frv_legitimate_fdpic_operand_p): Don't accept unadorned function
symbols. Use TRUE/FALSE instead of 1/0.
(frv_local_funcdesc_p): New.
(frv_legitimize_fdpic_address): Rewrite to use GOTOFF and 12-bit
immediates when possible.
(pic_symbolic_operand): Accept SYMBOL_REFs and CONSTs in FDPIC.
(dbl_memory_one_insn_operand): Accept addresses that add a REG and
an UNSPEC_GOT.
(frv_emit_movsi): Handle FDPIC before small data. Use GOTOFF and
12-bit immediates when possible.
(frv_legitimate_constant_p): In FDPIC, reject SImode operands that
are not legitimate pic operands.
(frv_in_small_data_p): Re-enable for FDPIC.
* config/frv/frv.h (SDA_BASE_REG): Remove comment about FDPIC.
(FRV_GLOBAL_P): Removed.
* config/frv/frv.md: Add modes to CONSTs.
(movsi_got): New.
(movsi_lo_sum_got): Use separate matches instead of match_dup.
(movsi_high_pic, movsi_lo_sum_pic): Match on non-FDPIC only.
(fdpic splittable operations): Match on flag_pic != 1.
2003-09-22 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_asm_out_constructor,
frv_asm_out_destructor): Pass to frv_assemble_integer the size in
bytes, not bits.
2003-09-19 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_assemble_integer): Reject complex
expressions referencing function SYMBOL_REFs.
* config/frv/frv.c (frv_function_symbol_referenced_p): New.
(move_source_operand): Reject CONSTs that reference function
SYMBOL_REFs on FDPIC.
(frv_emit_movsi): If we get such a CONST, break it up.
* config/frv/frv.h (CPP_SPEC): Define __FRV_FDPIC__ for -mfdpic.
(TRANSFER_FROM_TRAMPOLINE): Use different definitions for FDPIC.
* config/frv/frv.c (frv_print_operand) <I>: Recognize PLUS without
MEM.
(frv_assemble_integer): Don't use funcdesc for LABEL_REFs.
(frv_trampoline_size): Increase for FDPIC.
* config/frv/frv.h (TRAMPOLINE_ALIGNMENT): Bump to 64 for FDPIC.
(TRANSFER_FROM_TRAMPOLINE): Handle FDPIC trampolines.
* config/frv/frv.c (frv_legitimize_fdpic_address, frv_emit_movsi):
Disable use of GOTOFF for now.
(const_small_data_p, plus_small_data_p, frv_in_small_data_p):
Disable use of small data in FDPIC for now.
(frv_asm_output_mi_thunk): Implement for FDPIC.
* config/frv/frv.h (SDA_BASE_REG): Set to -1 with FDPIC.
* config/frv/frv.c (frv_asm_out_constructor): Use
frv_assemble_integer for FDPIC pointers.
(frv_asm_out_destructor): Likewise.
* config/frv/frv.md (ldd): Fix order of operands. Use
address_operand for input.
2003-09-18 DJ Delorie <dj@redhat.com>
* config/frv/frv.c (frv_legitimate_fdpic_operand_p): Remove UNSPEC_PIC.
(unspec_got_name): Correct typo.
(frv_emit_movsi): Pre-expand splittable GOTs.
(frv_expand_fdpic_call): Rename gen_lddi to gen_ldd.
* config/frv/frv.md (lddi): Fix syntax error, rename to ldd.
(symGOT2reg_hilo, symGOTOFF2reg_hilo): New.
* config/frv/t-frv: Add -mfdpic multilibs.
* config/frv/frv.h (ASM_SPEC): Pass -mfdpic/-mno-fdpic.
(TARGET_SWITCHES): Add -mno-fdpic, fix documentation.
* config/frv/frv.c (frv_override_options): -mfdpic assumes
flag_pic, default to 32-bit pics, require DWORD ops.
(frv_override_options): Add W and Z constraints.
(frv_expand_prologue): No pic prologue for -mfdpic.
(frv_asm_output_mi_thunk): Support -mfdpic (soon).
(frv_print_operand_memory_reference): Handle GOT constants.
(frv_legitimate_address_p): Allow GOT constants.
(frv_legitimize_address): Handle GOT addresses too.
(frv_legitimate_fdpic_operand_p): New.
(frv_legitimize_fdpic_address): New.
(unspec_got_name): New.
(frv_output_addr_const_extra): New.
(frv_expand_fdpic_call): New.
(frv_fdpic_fptr_operand): New.
(gpr_or_int12_operand): Handle GOT operands.
(int_2word_operand): Handle GOT operands.
(fdpic_operand): New.
(fdpic_splittable_got_operand): New.
(fdpic_got12_operand): New.
(frv_emit_movsi): Handle GOT operands.
(frv_assemble_integer): -mfdpic doesn't use rofixups.
(frv_print_operand): Support 'g' code for GOT operands.
* config/frv/frv-protos.h: Add prototypes as needed.
* config/frv/frv.md (R_FRV_GOT12, R_FRV_GOTHI, R_FRV_GOTLO,
R_FRV_FUNCDESC, R_FRV_FUNCDESC_GOT12, R_FRV_FUNCDESC_GOTHI,
R_FRV_FUNCDESC_GOTLO, R_FRV_FUNCDESC_VALUE,
R_FRV_FUNCDESC_GOTOFF12, R_FRV_FUNCDESC_GOTOFFHI,
R_FRV_FUNCDESC_GOTOFFLO, R_FRV_GOTOFF12, R_FRV_GOTOFFHI,
R_FRV_GOTOFFLO): New.
(movsi_high_got, movsi_lo_sum_got): New.
(*movsi_pic): Don't use this splitter for -mfdpic.
(addsi3): Allow GOT references also.
(call, call_value): Handle -mfdpic separately.
(call_fdpicdi, call_fdpicsi, lddi, call_value_fdpicdi,
call_value_fdpicsi): New.
(symGOT2reg, symGOT2reg_i, got splitters, symGOTOFF2reg,
symGOTOFF2reg_i): New.
* config/frv/frv.h (MASK_FDPIC): New.
(TARGET_FDPIC): New.
(TARGET_SWITCHES): Add -mfdpic.
(FDPIC_FPTR_REGNO): New.
(FDPIC_REGNO): New.
(OUR_FDPIC_REG): New.
(enum reg_class): Add FDPIC_REGS, FDPIC_FPTR_REGS, and
FDPIC_CALL_REGS.
(REG_CLASS_NAMES): Likewise.
(REG_CLASS_CONTENTS): Likewise.
(EXTRA_CONSTRAINT_FOR_Y): New, for 12-bit GOTs.
(EXTRA_CONSTRAINT): Add it here.
(FRV_GLOBAL_P): New.
(OUTPUT_ADDR_CONST_EXTRA): New.
From-SVN: r78373
2004-02-24 17:58:39 +01:00
|
|
|
__RELOC_POINTER (p_eh_frame_hdr->p_vaddr, load_base);
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
if (hdr->version != 1)
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
#ifdef CRT_GET_RFIB_DATA
|
|
|
|
# ifdef __i386__
|
|
|
|
data->dbase = NULL;
|
|
|
|
if (p_dynamic)
|
|
|
|
{
|
2003-01-17 04:28:11 +01:00
|
|
|
/* For dynamically linked executables and shared libraries,
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
DT_PLTGOT is the gp value for that object. */
|
Implement FR-V FDPIC ABI support for frv-uclinux and frv-linux.
2004-02-05 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_emit_movsi): Use GOT relocations for
symbols in sections named by the user.
2004-01-30 Alexandre Oliva <aoliva@redhat.com>
* config/frv/linux.h (TARGET_OS_CPP_BUILTINS): New.
2004-01-27 Alexandre Oliva <aoliva@redhat.com>
* config.gcc (frv-*-*linux*): Handle like *-*-linux*.
* config/frv/t-linux (EXTRA_MULTILIB_PARTS): Remove, obviated by
the above.
2004-01-20 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.md (symGOT2reg_hilo, symGOTOFF2reg_hilo): Add
one more pseudo to further improve code generation.
2004-01-19 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.md (movdi_ldd): Introduce explicit indirection
inside UNSPEC.
2004-01-16 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_legitimate_address_p): Added
allow_double_reg_p argument. Adjust all callers. Use it to
decide whether to enable double-register indirect addressing.
(frv_funcdesc_alias_set): Remove.
(frv_expand_fdpic_call): Force non-SYMBOL_REF operand into
register. Emit movdi_ldd.
(ldd_address_operand): New.
* config/frv/frv-protos.h (frv_legitimate_address_p): Adjust.
* config/frv/frv.h (GO_IF_LEGITIMATE_ADDRESS): Likewise.
(PREDICATE_CODES): Add ldd_address_operand.
* config/frv/frv.md (movdi_ldd): New.
(symGOT2reg_hilo, symGOTOFF2reg_hilo): Use separate pseudo for
intermediate computations if possible.
(symGOTOFF2reg_i): Fix harmless typo.
2003-12-18 Alexandre Oliva <aoliva@redhat.com>
* unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Cast
relocated p_vaddr to vaddr type.
* config/frv/frv-protos.h (frv_expand_fdpic_call): Return void.
* config/frv/frv.c (frv_get_funcdesc_alias_set): New.
(frv_expand_fdpic_call): Propagate incoming MEM's expr to funcdesc
MEM, or use a funcdesc alias set. Use regular move instead of
ldd.
(dbl_memory_one_insn_operand): Recognize function descriptors by
type or by alias set, and don't split them.
* config/frv/frv.md (call, call_value): Never use call_internal
for fdpic.
(call_internal, call_value_internal): Never match for FDPIC.
(call_fdpicdi, call_fdpicsi, call_value_fdpicdi,
call_value_fdpicsi): Require FDPIC.
(ldd): Removed.
2003-12-17 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.h (CRT_GET_RFIB_DATA): Define for __FRV_FDPIC__.
* unwind-dw2-fde-glibc.c: Don't include elf-fdpic.h any more.
(_Unwind_IteratePhdrCallback): Adjust type of load_base for FRV
FDPIC. Compute data base address.
* config/frv/linux.h (SUBTARGET_DRIVER_SELF_SPECS): Enable -mfdpic
before the other self-specs are processed.
* config/frv/t-linux (CRTSTUFF_T_CFLAGS, TARGET_LIBGCC2_CFLAGS):
Build with -fPIC.
2003-12-15 Alexandre Oliva <aoliva@redhat.com>
* unwind-dw2-fde-glibc.c: Don't include bits/elf-fdpic.h if
inhibit_libc is defined.
2003-12-12 Alexandre Oliva <aoliva@redhat.com>
* unwind-dw2-fde-glibc.c: Include bits/elf-fdpic.h for
__FRV_FDPIC__.
(__RELOC_POINTER): Define.
(_Unwind_IteratePhdrCallback): Use it.
* config/frv/frv.h (Twrite): Define.
(TRANSFER_FROM_TRAMPOLINE): Use it.
* config/frv/linux.h (INVOKE__main): Undefine.
(Twrite): Override.
2003-12-05 Richard Sandiford <rsandifo@redhat.com>
* doc/invoke.texi (-mlong-calls, -mlinked-fp): Document FRV options.
(-mlibrary-pic): Emphasize that this option generates EABI code.
(-mcpu): Add fr550.
(-mpack): Remove.
2003-11-30 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (int_2word_operand): Reject LABELs, SYMBOL_REFs
and CONSTs in FDPIC mode.
* gcc/config.gcc (with_cpu): Default to fr400 on frv-*-*linux*.
2003-11-29 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.c (move_source_operand): Don't accept symbolic
constants.
* config/frv/frv.md (*movhi_internal, *movsi_internal): Use an 'n'
rather than 'i' constraint for the 2-instruction alternative.
(*movsi_2word): New, incorporating existing int_2word_operand splitter.
2003-11-29 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.h (EXTRA_CONSTRAINT_FOR_Q): Renamed from
EXTRA_CONSTRAINT_FOR_Y.
(EXTRA_CONSTRAINT): Remove handling of 'Y'.
* config/frv/frv.md (*movsi_internal): Remove 'Q' constraint.
(addsi3): Change 'Y' constraint to 'Q'.
2003-11-27 Richard Sandiford <rsandifo@redhat.com>
* reload.c (CONST_POOL_OK_P): New macro.
(find_reloads): Use it to decide whether a constant can be forced
into memory.
* config/frv/frv.h (LEGITIMATE_PIC_OPERAND_P): Return true if the
constant satisfies got12_operand.
(frv_cannot_force_const_mem): Always return true for TARGET_FDPIC.
(frv_legitimate_address_p): Check for valid unspec offsets using
got12_operand rather than frv_legitimate_fdpic_operand_p.
(frv_legitimate_fdpic_operand_p): Delete.
(frv_emit_movsi): Abort if we try to use the FDPIC register during
or after reload.
(frv_legitimate_constant_p): Return LEGITIMATE_PIC_OPERAND_P if
TARGET_FDPIC.
* config/frv/frv.md (*movdf_double): Add alternatives for CONST_DOUBLE.
2003-11-19 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-protos.h (fdpic_operand, fdpic_got12_operand)
(frv_fdpic_fptr_operand): Don't declare here.
* config/frv/frv.h (EXTRA_CONSTRAINT_FOR_Y): Call got12_operand
rather than fdpic_got12_operand.
(PREDICATE_CODES): Remove symbolic_operand entry. Add entries for
got12_operand and const_unspec_operand.
* config/frv/frv.c (got12_operand): Renamed from fdpic_got12_operand.
(gpr_or_int12_operand, dbl_memory_one_insn_operand): Update calls.
(symbolic_operand): Remove.
(const_unspec_operand): New predicate.
* config/frv/frv.md (*movsi_got): Use got12_operand.
(*movsi_high_got, *movsi_lo_sum_got): Use const_unspec_operand.
2003-11-18 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-protos.h (frv_output_addr_const_extra): Remove.
* config/frv/frv.h (OUTPUT_ADDR_CONST_EXTRA): Remove definition.
* config/frv/frv.c (frv_unspec): New structure.
(frv_small_data_reloc_p, frv_const_unspec_p): New functions.
(frv_print_operand_memory_reference): Use frv_const_unspec_p to
validate CONST indices. Use frv_output_const_unspec to print them.
(frv_print_operand): Update call to unspec_got_name. Use
frv_output_const_unspec to print constant unspecs.
(frv_legitimate_fdpic_operand_p): Return true if frv_const_unspec_p.
Reject UNSPECs otherwise.
(unspec_got_name): Take the relocation number as argument, not an
rtx containing it.
(frv_output_addr_const_extra): Remove, replacing with...
(frv_output_const_unspec): ...this new function.
(frv_find_base_term): Use frv_const_unspec_p & frv_small_data_reloc_p.
(gpr_or_int12_operand): Use fdpic_got12_operand.
(dbl_memory_one_insn_operand): Likewise.
(fdpic_got12_operand): Use frv_const_unspec_p.
(frv_emit_movsi): Use frv_const_unspec_p to check for CONSTs that
are already legitimate. Use frv_small_data_reloc_p when deciding
whether to use HIGH/LO_SUM for R_FRV_GOTOFF12 and R_FRV_GPREL12.
2003-11-18 Alexandre Oliva <aoliva@redhat.com>
* config/frv/t-linux (SHLIB_MAPFILES): Override so as to export...
* config/frv/libgcc-frv.ver: ... frv-specific symbols. New file.
* config/frv/frv-abi.h (CREATE_DOUBLE_SHIFT): Use branch to local
label, for real this time.
* config/frv/frv.c (frv_local_funcdesc_p): Update to new
representation of visibility.
(fdpic_got12_operand, symbolic_operand): Mark unused arguments as
such.
2003-11-17 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.h (MASK_LINKED_FP, TARGET_LINKED_FP): New macros.
(TARGET_SWITCHES): Add -mlinked-fp and -mno-linked-fp.
* config/frv/frv.c (frv_override_options): Set MASK_LINKED_FP unless
it was explicitly disabled.
(frv_stack_info): There is no need to save the link register in every
frame unless TARGET_LINKED_FP is true.
(frv_frame_pointer_required): If !TARGET_LINKED_FP, only require a
frame pointer if the stack pointer might change value.
(frv_return_addr_rtx): Check and process "count" argument.
2003-11-14 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-protos.h (frv_legitimize_address): Remove.
(frv_find_base_term): Declare.
* config/frv/frv.h (LEGITIMIZE_ADDRESS): Do nothing.
(FIND_BASE_TERM): Define.
(PREDICATE_CODES): Remove pic_register_operand, pic_symbolic_operand,
small_data_register_operand, small_data_symbolic_operand. Add
symbolic_operand.
* config/frv/frv.c (const_small_data_p, plus_small_data_p): Delete.
(frv_print_operand_memory_reference, output_move_single): Remove
special handling for unlegitimized sdata addresses.
(frv_legitimate_address_p): Don't allow sums of SDA_BASE_REG
and symbolic addresses.
(frv_legitimize_address, frv_legitimize_fdpic_address): Delete.
(frv_find_base_term): New function.
(int_2word_operand): Check specifically for symbolic address constants.
(pic_register_operand, pic_symbolic_operand): Delete.
(small_data_register_operand, small_data_symbolic_operand): Delete.
(dbl_memory_one_insn_operand): Don't call plus_small_data_p.
Allow UNSPEC_GOT constants if !TARGET_FDPIC.
(move_source_operand): Only accept CONSTs if they're a two-insn
symbolic constant.
(fdpic_got12_operand): Don't require TARGET_FDPIC.
(frv_emit_movsi): Legitimize sdata and -mlibrary-pic addresses
using gen_symGOTOFF2reg*.
(frv_ifcvt_rewrite_mem): Remove (plus gr16 ...) special cases.
(frv_rtx_costs): Give all MEM addresses a cost of 0. Give MEMs
themselves a cost of 3 insns.
* config/mips/mips.md (*movsi_got): Allow for !TARGET_FDPIC too.
Change predicate to symbolic_operand.
(*movsi_high_got, *movsi_lo_sum_got): Likewise.
(*movsi_lda_sdata): Delete.
(*movsi_pic, movsi_high_pic, movsi_lo_sum_pic): Delete.
2003-11-05 Alexandre Oliva <aoliva@redhat.com>
* config.gcc: Add t-slibgcc-elf-ver and support --with-cpu for
frv-*-*linux*.
* config/frv/frv-abi.h (CREATE_DOUBLE_SHIFT): Use branch to local
label.
* config/frv/frv.h (DRIVER_SELF_SPECS): Add blank before
-multilib-library-pic.
(LINK_SPEC): Add -z text for -mfdpic.
* config/frv/frvbegin.c (__ROFIXUP_LIST__): Don't define on FDPIC.
* config/frv/frvend.c (__ROFIXUP_END__): Likewise.
* config/frv/linux.h (STARTFILE_SPEC, ENDFILE_SPEC, LINK_SPEC):
Override.
(OPTION_DEFAULT_SPECS, HAS_INIT_SECTION, INIT_SECTION_ASM_OP,
FINI_SECTION_ASM_OP, CRT_CALL_STATIC_FUNCTION): Define.
* config/frv/t-linux (EXTRA_MULTILIB_PARTS): Use
crtstuff-generated files.
2003-10-31 Alexandre Oliva <aoliva@redhat.com>
* config.gcc: Add frv-*-*linux*.
* config/frv/linux.h, config/frv/t-linux: New.
2003-10-06 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.h (LINK_SPEC): Pass -melf32frvfd to the linker
when -mfdpic even if a linker script is explicitly listed.
2003-10-02 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_override_options): Clear asm_out
unaligned_op for SImode on FDPIC.
(frv_emit_movsi): Use compute_reloc_for_constant to compute the
argument passed to decl_readonly_section.
(frv_assemble_integer): Revert 2003-09-30's change, but make the
whole block run with FDPIC even with -fno-PIC.
2003-10-02 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_cannot_force_const_mem): Don't force
symbol or label plus offset to memory.
(frv_emit_movsi): Emit GPREL only if -mgprel-ro. Emit 32-bit
GOTOFF and GPREL for LABEL_REF.
* config/frv/frv.h (DRIVER_SELF_SPECS): Add -mgprel-ro with
-mfdpic unless -mno-gprel-ro, -fpic or -fpie.
(MASK_GPREL_RO, TARGET_GPREL_RO): New.
(TARGET_SWITCHES): Added gprel-ro and no-gprel-ro.
* doc/invoke.texi: Document them.
2003-09-30 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv-protos.h (frv_gen_GPsym2reg): Declare.
(frv_splittable_got_operand): Removed.
* config/frv/frv.c (frv_cannot_force_const_mem): Reject HIGH and
LO_SUM. Add comments.
(frv_override_options): Moved enabling of FDPIC to
DRIVER_SELF_SPECS. Don't enable MASK_DWORD.
(frv_local_funcdesc_p): Remove unnecessary heck for flag_pie.
(frv_legitimize_fdpic_address): Don't duplicate logic in
frv_emit_movsi.
(frv_gen_GPsym2reg): New.
(unspec_got_name): Added gprel.
(frv_expand_fdpic_call): Add support for inlining PLTs.
(fdpic_fptr_operand): Renamed from frv_fdpic_fptr_operand.
(gpr_or_int12_operand): Added GPREL12.
(pic_symbolic_operand): Match even if !flag_pic for FDPIC.
(small_data_symbolic_operand): Fail if FDPIC.
(fdpic_splittable_got_operand): Removed.
(fdpic_got12_operand): Added GPREL12.
(frv_emit_movsi): Reorganize to avoid duplication. Emit GPREL
when appropriate. Fix sdata GOTOFF.
(frv_legitimate_constant_p): Require legitimate PIC operand for
FDPIC with pic, but only a legitimate fdpic operand for non-pic.
(frv_assemble_integer): Move FDPIC funcdesc handling out of
flag_pic case.
(frv_asm_out_constructor, frv_asm_out_destructor): Abort if
frv_assemble_integer fails.
* config/frv/frv.h (DRIVER_SELF_SPECS): New.
(SUBTARGET_DRIVER_SELF_SPECS): New.
(ASM_SPEC): Don't pass -mno-fdpic.
(LINK_SPEC): Pass -melf32frvfd for FDPIC.
(MASK_INLINE_PLT, TARGET_INLINE_PLT): New.
(TARGET_SWITCHES): Add -minline-plt, -mno-inline-plt and
-multilib-library-pic.
(PREDICATE_CODES): Added fdpic_operand, fdpic_fptr_operand,
condexec_si_media_operator, condexec_sf_add_operator and
condexec_sf_conv_operator. Removed condexec_sf_binary_operator
and condexec_sf_unary_operator.
* config/frv/frv.md (R_FRV_GPREL12, R_FRV_GPRELHI, R_FRV_GPRELLO):
New.
(movsi_got, movsi_high_got, movsi_lo_sum_got): Move before
movsi_internal. Give them internal names. movsi_got has type
int.
(fdpic got splitters): Remove.
(symGPREL2reg, symGPREL2reg_hilo): New.
* config/frv/t-frv (MULTILIB_MATCHES): Don't map -fpic and -fPIC
to -mlibrary-pic. Map -multilib-library-pic to it.
* doc/invoke.texi: -mfdpic, -minline-plt, -multilib-library-pic:
Document.
2003-09-28 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_function_symbol_referenced_p): Declare.
(TARGET_CANNOT_FORCE_CONST_MEM): Define to...
(frv_cannot_force_const_mem): New function.
(const_small_data_p, plus_small_data_p): Update comments on sdata
on FDPIC.
(frv_override_options): Set flag_pie for FDPIC too.
(frv_conditional_register_usage): Mark gr16 and gr17 as non-fixed,
call-saved registers on FDPIC.
(frv_stack_info): Don't preserve the PIC register on FDPIC, and
don't force LR to be preserved.
(frv_expand_prologue): Likewise.
(frv_asm_output_mi_thunk): Use 12-bit funcdesc gotoff for -fpic.
(frv_frame_pointer_required): Don't force it just because the
FDPIC register is used.
(frv_legitimate_address_p) <CONST>: Accept a legitimate FDPIC
operand only if !condexec_p.
(frv_legitimize_address): Return the FDPIC-legitimized address.
Don't match small data here on FDPIC.
(frv_legitimate_fdpic_operand_p): Don't accept unadorned function
symbols. Use TRUE/FALSE instead of 1/0.
(frv_local_funcdesc_p): New.
(frv_legitimize_fdpic_address): Rewrite to use GOTOFF and 12-bit
immediates when possible.
(pic_symbolic_operand): Accept SYMBOL_REFs and CONSTs in FDPIC.
(dbl_memory_one_insn_operand): Accept addresses that add a REG and
an UNSPEC_GOT.
(frv_emit_movsi): Handle FDPIC before small data. Use GOTOFF and
12-bit immediates when possible.
(frv_legitimate_constant_p): In FDPIC, reject SImode operands that
are not legitimate pic operands.
(frv_in_small_data_p): Re-enable for FDPIC.
* config/frv/frv.h (SDA_BASE_REG): Remove comment about FDPIC.
(FRV_GLOBAL_P): Removed.
* config/frv/frv.md: Add modes to CONSTs.
(movsi_got): New.
(movsi_lo_sum_got): Use separate matches instead of match_dup.
(movsi_high_pic, movsi_lo_sum_pic): Match on non-FDPIC only.
(fdpic splittable operations): Match on flag_pic != 1.
2003-09-22 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_asm_out_constructor,
frv_asm_out_destructor): Pass to frv_assemble_integer the size in
bytes, not bits.
2003-09-19 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_assemble_integer): Reject complex
expressions referencing function SYMBOL_REFs.
* config/frv/frv.c (frv_function_symbol_referenced_p): New.
(move_source_operand): Reject CONSTs that reference function
SYMBOL_REFs on FDPIC.
(frv_emit_movsi): If we get such a CONST, break it up.
* config/frv/frv.h (CPP_SPEC): Define __FRV_FDPIC__ for -mfdpic.
(TRANSFER_FROM_TRAMPOLINE): Use different definitions for FDPIC.
* config/frv/frv.c (frv_print_operand) <I>: Recognize PLUS without
MEM.
(frv_assemble_integer): Don't use funcdesc for LABEL_REFs.
(frv_trampoline_size): Increase for FDPIC.
* config/frv/frv.h (TRAMPOLINE_ALIGNMENT): Bump to 64 for FDPIC.
(TRANSFER_FROM_TRAMPOLINE): Handle FDPIC trampolines.
* config/frv/frv.c (frv_legitimize_fdpic_address, frv_emit_movsi):
Disable use of GOTOFF for now.
(const_small_data_p, plus_small_data_p, frv_in_small_data_p):
Disable use of small data in FDPIC for now.
(frv_asm_output_mi_thunk): Implement for FDPIC.
* config/frv/frv.h (SDA_BASE_REG): Set to -1 with FDPIC.
* config/frv/frv.c (frv_asm_out_constructor): Use
frv_assemble_integer for FDPIC pointers.
(frv_asm_out_destructor): Likewise.
* config/frv/frv.md (ldd): Fix order of operands. Use
address_operand for input.
2003-09-18 DJ Delorie <dj@redhat.com>
* config/frv/frv.c (frv_legitimate_fdpic_operand_p): Remove UNSPEC_PIC.
(unspec_got_name): Correct typo.
(frv_emit_movsi): Pre-expand splittable GOTs.
(frv_expand_fdpic_call): Rename gen_lddi to gen_ldd.
* config/frv/frv.md (lddi): Fix syntax error, rename to ldd.
(symGOT2reg_hilo, symGOTOFF2reg_hilo): New.
* config/frv/t-frv: Add -mfdpic multilibs.
* config/frv/frv.h (ASM_SPEC): Pass -mfdpic/-mno-fdpic.
(TARGET_SWITCHES): Add -mno-fdpic, fix documentation.
* config/frv/frv.c (frv_override_options): -mfdpic assumes
flag_pic, default to 32-bit pics, require DWORD ops.
(frv_override_options): Add W and Z constraints.
(frv_expand_prologue): No pic prologue for -mfdpic.
(frv_asm_output_mi_thunk): Support -mfdpic (soon).
(frv_print_operand_memory_reference): Handle GOT constants.
(frv_legitimate_address_p): Allow GOT constants.
(frv_legitimize_address): Handle GOT addresses too.
(frv_legitimate_fdpic_operand_p): New.
(frv_legitimize_fdpic_address): New.
(unspec_got_name): New.
(frv_output_addr_const_extra): New.
(frv_expand_fdpic_call): New.
(frv_fdpic_fptr_operand): New.
(gpr_or_int12_operand): Handle GOT operands.
(int_2word_operand): Handle GOT operands.
(fdpic_operand): New.
(fdpic_splittable_got_operand): New.
(fdpic_got12_operand): New.
(frv_emit_movsi): Handle GOT operands.
(frv_assemble_integer): -mfdpic doesn't use rofixups.
(frv_print_operand): Support 'g' code for GOT operands.
* config/frv/frv-protos.h: Add prototypes as needed.
* config/frv/frv.md (R_FRV_GOT12, R_FRV_GOTHI, R_FRV_GOTLO,
R_FRV_FUNCDESC, R_FRV_FUNCDESC_GOT12, R_FRV_FUNCDESC_GOTHI,
R_FRV_FUNCDESC_GOTLO, R_FRV_FUNCDESC_VALUE,
R_FRV_FUNCDESC_GOTOFF12, R_FRV_FUNCDESC_GOTOFFHI,
R_FRV_FUNCDESC_GOTOFFLO, R_FRV_GOTOFF12, R_FRV_GOTOFFHI,
R_FRV_GOTOFFLO): New.
(movsi_high_got, movsi_lo_sum_got): New.
(*movsi_pic): Don't use this splitter for -mfdpic.
(addsi3): Allow GOT references also.
(call, call_value): Handle -mfdpic separately.
(call_fdpicdi, call_fdpicsi, lddi, call_value_fdpicdi,
call_value_fdpicsi): New.
(symGOT2reg, symGOT2reg_i, got splitters, symGOTOFF2reg,
symGOTOFF2reg_i): New.
* config/frv/frv.h (MASK_FDPIC): New.
(TARGET_FDPIC): New.
(TARGET_SWITCHES): Add -mfdpic.
(FDPIC_FPTR_REGNO): New.
(FDPIC_REGNO): New.
(OUR_FDPIC_REG): New.
(enum reg_class): Add FDPIC_REGS, FDPIC_FPTR_REGS, and
FDPIC_CALL_REGS.
(REG_CLASS_NAMES): Likewise.
(REG_CLASS_CONTENTS): Likewise.
(EXTRA_CONSTRAINT_FOR_Y): New, for 12-bit GOTs.
(EXTRA_CONSTRAINT): Add it here.
(FRV_GLOBAL_P): New.
(OUTPUT_ADDR_CONST_EXTRA): New.
From-SVN: r78373
2004-02-24 17:58:39 +01:00
|
|
|
ElfW(Dyn) *dyn = (ElfW(Dyn) *)
|
|
|
|
__RELOC_POINTER (p_dynamic->p_vaddr, load_base);
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
for (; dyn->d_tag != DT_NULL ; dyn++)
|
|
|
|
if (dyn->d_tag == DT_PLTGOT)
|
|
|
|
{
|
|
|
|
data->dbase = (void *) dyn->d_un.d_ptr;
|
2010-12-23 13:08:21 +01:00
|
|
|
#if defined __linux__
|
|
|
|
/* On IA-32 Linux, _DYNAMIC is writable and GLIBC has
|
|
|
|
relocated it. */
|
|
|
|
#elif defined __sun__ && defined __svr4__
|
|
|
|
/* On Solaris 2/x86, we need to do this ourselves. */
|
|
|
|
data->dbase += load_base;
|
|
|
|
#endif
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2016-11-16 08:01:56 +01:00
|
|
|
# elif (defined __FRV_FDPIC__ || defined __BFIN_FDPIC__) && defined __linux__
|
Implement FR-V FDPIC ABI support for frv-uclinux and frv-linux.
2004-02-05 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_emit_movsi): Use GOT relocations for
symbols in sections named by the user.
2004-01-30 Alexandre Oliva <aoliva@redhat.com>
* config/frv/linux.h (TARGET_OS_CPP_BUILTINS): New.
2004-01-27 Alexandre Oliva <aoliva@redhat.com>
* config.gcc (frv-*-*linux*): Handle like *-*-linux*.
* config/frv/t-linux (EXTRA_MULTILIB_PARTS): Remove, obviated by
the above.
2004-01-20 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.md (symGOT2reg_hilo, symGOTOFF2reg_hilo): Add
one more pseudo to further improve code generation.
2004-01-19 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.md (movdi_ldd): Introduce explicit indirection
inside UNSPEC.
2004-01-16 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_legitimate_address_p): Added
allow_double_reg_p argument. Adjust all callers. Use it to
decide whether to enable double-register indirect addressing.
(frv_funcdesc_alias_set): Remove.
(frv_expand_fdpic_call): Force non-SYMBOL_REF operand into
register. Emit movdi_ldd.
(ldd_address_operand): New.
* config/frv/frv-protos.h (frv_legitimate_address_p): Adjust.
* config/frv/frv.h (GO_IF_LEGITIMATE_ADDRESS): Likewise.
(PREDICATE_CODES): Add ldd_address_operand.
* config/frv/frv.md (movdi_ldd): New.
(symGOT2reg_hilo, symGOTOFF2reg_hilo): Use separate pseudo for
intermediate computations if possible.
(symGOTOFF2reg_i): Fix harmless typo.
2003-12-18 Alexandre Oliva <aoliva@redhat.com>
* unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Cast
relocated p_vaddr to vaddr type.
* config/frv/frv-protos.h (frv_expand_fdpic_call): Return void.
* config/frv/frv.c (frv_get_funcdesc_alias_set): New.
(frv_expand_fdpic_call): Propagate incoming MEM's expr to funcdesc
MEM, or use a funcdesc alias set. Use regular move instead of
ldd.
(dbl_memory_one_insn_operand): Recognize function descriptors by
type or by alias set, and don't split them.
* config/frv/frv.md (call, call_value): Never use call_internal
for fdpic.
(call_internal, call_value_internal): Never match for FDPIC.
(call_fdpicdi, call_fdpicsi, call_value_fdpicdi,
call_value_fdpicsi): Require FDPIC.
(ldd): Removed.
2003-12-17 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.h (CRT_GET_RFIB_DATA): Define for __FRV_FDPIC__.
* unwind-dw2-fde-glibc.c: Don't include elf-fdpic.h any more.
(_Unwind_IteratePhdrCallback): Adjust type of load_base for FRV
FDPIC. Compute data base address.
* config/frv/linux.h (SUBTARGET_DRIVER_SELF_SPECS): Enable -mfdpic
before the other self-specs are processed.
* config/frv/t-linux (CRTSTUFF_T_CFLAGS, TARGET_LIBGCC2_CFLAGS):
Build with -fPIC.
2003-12-15 Alexandre Oliva <aoliva@redhat.com>
* unwind-dw2-fde-glibc.c: Don't include bits/elf-fdpic.h if
inhibit_libc is defined.
2003-12-12 Alexandre Oliva <aoliva@redhat.com>
* unwind-dw2-fde-glibc.c: Include bits/elf-fdpic.h for
__FRV_FDPIC__.
(__RELOC_POINTER): Define.
(_Unwind_IteratePhdrCallback): Use it.
* config/frv/frv.h (Twrite): Define.
(TRANSFER_FROM_TRAMPOLINE): Use it.
* config/frv/linux.h (INVOKE__main): Undefine.
(Twrite): Override.
2003-12-05 Richard Sandiford <rsandifo@redhat.com>
* doc/invoke.texi (-mlong-calls, -mlinked-fp): Document FRV options.
(-mlibrary-pic): Emphasize that this option generates EABI code.
(-mcpu): Add fr550.
(-mpack): Remove.
2003-11-30 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (int_2word_operand): Reject LABELs, SYMBOL_REFs
and CONSTs in FDPIC mode.
* gcc/config.gcc (with_cpu): Default to fr400 on frv-*-*linux*.
2003-11-29 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.c (move_source_operand): Don't accept symbolic
constants.
* config/frv/frv.md (*movhi_internal, *movsi_internal): Use an 'n'
rather than 'i' constraint for the 2-instruction alternative.
(*movsi_2word): New, incorporating existing int_2word_operand splitter.
2003-11-29 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.h (EXTRA_CONSTRAINT_FOR_Q): Renamed from
EXTRA_CONSTRAINT_FOR_Y.
(EXTRA_CONSTRAINT): Remove handling of 'Y'.
* config/frv/frv.md (*movsi_internal): Remove 'Q' constraint.
(addsi3): Change 'Y' constraint to 'Q'.
2003-11-27 Richard Sandiford <rsandifo@redhat.com>
* reload.c (CONST_POOL_OK_P): New macro.
(find_reloads): Use it to decide whether a constant can be forced
into memory.
* config/frv/frv.h (LEGITIMATE_PIC_OPERAND_P): Return true if the
constant satisfies got12_operand.
(frv_cannot_force_const_mem): Always return true for TARGET_FDPIC.
(frv_legitimate_address_p): Check for valid unspec offsets using
got12_operand rather than frv_legitimate_fdpic_operand_p.
(frv_legitimate_fdpic_operand_p): Delete.
(frv_emit_movsi): Abort if we try to use the FDPIC register during
or after reload.
(frv_legitimate_constant_p): Return LEGITIMATE_PIC_OPERAND_P if
TARGET_FDPIC.
* config/frv/frv.md (*movdf_double): Add alternatives for CONST_DOUBLE.
2003-11-19 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-protos.h (fdpic_operand, fdpic_got12_operand)
(frv_fdpic_fptr_operand): Don't declare here.
* config/frv/frv.h (EXTRA_CONSTRAINT_FOR_Y): Call got12_operand
rather than fdpic_got12_operand.
(PREDICATE_CODES): Remove symbolic_operand entry. Add entries for
got12_operand and const_unspec_operand.
* config/frv/frv.c (got12_operand): Renamed from fdpic_got12_operand.
(gpr_or_int12_operand, dbl_memory_one_insn_operand): Update calls.
(symbolic_operand): Remove.
(const_unspec_operand): New predicate.
* config/frv/frv.md (*movsi_got): Use got12_operand.
(*movsi_high_got, *movsi_lo_sum_got): Use const_unspec_operand.
2003-11-18 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-protos.h (frv_output_addr_const_extra): Remove.
* config/frv/frv.h (OUTPUT_ADDR_CONST_EXTRA): Remove definition.
* config/frv/frv.c (frv_unspec): New structure.
(frv_small_data_reloc_p, frv_const_unspec_p): New functions.
(frv_print_operand_memory_reference): Use frv_const_unspec_p to
validate CONST indices. Use frv_output_const_unspec to print them.
(frv_print_operand): Update call to unspec_got_name. Use
frv_output_const_unspec to print constant unspecs.
(frv_legitimate_fdpic_operand_p): Return true if frv_const_unspec_p.
Reject UNSPECs otherwise.
(unspec_got_name): Take the relocation number as argument, not an
rtx containing it.
(frv_output_addr_const_extra): Remove, replacing with...
(frv_output_const_unspec): ...this new function.
(frv_find_base_term): Use frv_const_unspec_p & frv_small_data_reloc_p.
(gpr_or_int12_operand): Use fdpic_got12_operand.
(dbl_memory_one_insn_operand): Likewise.
(fdpic_got12_operand): Use frv_const_unspec_p.
(frv_emit_movsi): Use frv_const_unspec_p to check for CONSTs that
are already legitimate. Use frv_small_data_reloc_p when deciding
whether to use HIGH/LO_SUM for R_FRV_GOTOFF12 and R_FRV_GPREL12.
2003-11-18 Alexandre Oliva <aoliva@redhat.com>
* config/frv/t-linux (SHLIB_MAPFILES): Override so as to export...
* config/frv/libgcc-frv.ver: ... frv-specific symbols. New file.
* config/frv/frv-abi.h (CREATE_DOUBLE_SHIFT): Use branch to local
label, for real this time.
* config/frv/frv.c (frv_local_funcdesc_p): Update to new
representation of visibility.
(fdpic_got12_operand, symbolic_operand): Mark unused arguments as
such.
2003-11-17 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.h (MASK_LINKED_FP, TARGET_LINKED_FP): New macros.
(TARGET_SWITCHES): Add -mlinked-fp and -mno-linked-fp.
* config/frv/frv.c (frv_override_options): Set MASK_LINKED_FP unless
it was explicitly disabled.
(frv_stack_info): There is no need to save the link register in every
frame unless TARGET_LINKED_FP is true.
(frv_frame_pointer_required): If !TARGET_LINKED_FP, only require a
frame pointer if the stack pointer might change value.
(frv_return_addr_rtx): Check and process "count" argument.
2003-11-14 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv-protos.h (frv_legitimize_address): Remove.
(frv_find_base_term): Declare.
* config/frv/frv.h (LEGITIMIZE_ADDRESS): Do nothing.
(FIND_BASE_TERM): Define.
(PREDICATE_CODES): Remove pic_register_operand, pic_symbolic_operand,
small_data_register_operand, small_data_symbolic_operand. Add
symbolic_operand.
* config/frv/frv.c (const_small_data_p, plus_small_data_p): Delete.
(frv_print_operand_memory_reference, output_move_single): Remove
special handling for unlegitimized sdata addresses.
(frv_legitimate_address_p): Don't allow sums of SDA_BASE_REG
and symbolic addresses.
(frv_legitimize_address, frv_legitimize_fdpic_address): Delete.
(frv_find_base_term): New function.
(int_2word_operand): Check specifically for symbolic address constants.
(pic_register_operand, pic_symbolic_operand): Delete.
(small_data_register_operand, small_data_symbolic_operand): Delete.
(dbl_memory_one_insn_operand): Don't call plus_small_data_p.
Allow UNSPEC_GOT constants if !TARGET_FDPIC.
(move_source_operand): Only accept CONSTs if they're a two-insn
symbolic constant.
(fdpic_got12_operand): Don't require TARGET_FDPIC.
(frv_emit_movsi): Legitimize sdata and -mlibrary-pic addresses
using gen_symGOTOFF2reg*.
(frv_ifcvt_rewrite_mem): Remove (plus gr16 ...) special cases.
(frv_rtx_costs): Give all MEM addresses a cost of 0. Give MEMs
themselves a cost of 3 insns.
* config/mips/mips.md (*movsi_got): Allow for !TARGET_FDPIC too.
Change predicate to symbolic_operand.
(*movsi_high_got, *movsi_lo_sum_got): Likewise.
(*movsi_lda_sdata): Delete.
(*movsi_pic, movsi_high_pic, movsi_lo_sum_pic): Delete.
2003-11-05 Alexandre Oliva <aoliva@redhat.com>
* config.gcc: Add t-slibgcc-elf-ver and support --with-cpu for
frv-*-*linux*.
* config/frv/frv-abi.h (CREATE_DOUBLE_SHIFT): Use branch to local
label.
* config/frv/frv.h (DRIVER_SELF_SPECS): Add blank before
-multilib-library-pic.
(LINK_SPEC): Add -z text for -mfdpic.
* config/frv/frvbegin.c (__ROFIXUP_LIST__): Don't define on FDPIC.
* config/frv/frvend.c (__ROFIXUP_END__): Likewise.
* config/frv/linux.h (STARTFILE_SPEC, ENDFILE_SPEC, LINK_SPEC):
Override.
(OPTION_DEFAULT_SPECS, HAS_INIT_SECTION, INIT_SECTION_ASM_OP,
FINI_SECTION_ASM_OP, CRT_CALL_STATIC_FUNCTION): Define.
* config/frv/t-linux (EXTRA_MULTILIB_PARTS): Use
crtstuff-generated files.
2003-10-31 Alexandre Oliva <aoliva@redhat.com>
* config.gcc: Add frv-*-*linux*.
* config/frv/linux.h, config/frv/t-linux: New.
2003-10-06 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.h (LINK_SPEC): Pass -melf32frvfd to the linker
when -mfdpic even if a linker script is explicitly listed.
2003-10-02 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_override_options): Clear asm_out
unaligned_op for SImode on FDPIC.
(frv_emit_movsi): Use compute_reloc_for_constant to compute the
argument passed to decl_readonly_section.
(frv_assemble_integer): Revert 2003-09-30's change, but make the
whole block run with FDPIC even with -fno-PIC.
2003-10-02 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_cannot_force_const_mem): Don't force
symbol or label plus offset to memory.
(frv_emit_movsi): Emit GPREL only if -mgprel-ro. Emit 32-bit
GOTOFF and GPREL for LABEL_REF.
* config/frv/frv.h (DRIVER_SELF_SPECS): Add -mgprel-ro with
-mfdpic unless -mno-gprel-ro, -fpic or -fpie.
(MASK_GPREL_RO, TARGET_GPREL_RO): New.
(TARGET_SWITCHES): Added gprel-ro and no-gprel-ro.
* doc/invoke.texi: Document them.
2003-09-30 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv-protos.h (frv_gen_GPsym2reg): Declare.
(frv_splittable_got_operand): Removed.
* config/frv/frv.c (frv_cannot_force_const_mem): Reject HIGH and
LO_SUM. Add comments.
(frv_override_options): Moved enabling of FDPIC to
DRIVER_SELF_SPECS. Don't enable MASK_DWORD.
(frv_local_funcdesc_p): Remove unnecessary heck for flag_pie.
(frv_legitimize_fdpic_address): Don't duplicate logic in
frv_emit_movsi.
(frv_gen_GPsym2reg): New.
(unspec_got_name): Added gprel.
(frv_expand_fdpic_call): Add support for inlining PLTs.
(fdpic_fptr_operand): Renamed from frv_fdpic_fptr_operand.
(gpr_or_int12_operand): Added GPREL12.
(pic_symbolic_operand): Match even if !flag_pic for FDPIC.
(small_data_symbolic_operand): Fail if FDPIC.
(fdpic_splittable_got_operand): Removed.
(fdpic_got12_operand): Added GPREL12.
(frv_emit_movsi): Reorganize to avoid duplication. Emit GPREL
when appropriate. Fix sdata GOTOFF.
(frv_legitimate_constant_p): Require legitimate PIC operand for
FDPIC with pic, but only a legitimate fdpic operand for non-pic.
(frv_assemble_integer): Move FDPIC funcdesc handling out of
flag_pic case.
(frv_asm_out_constructor, frv_asm_out_destructor): Abort if
frv_assemble_integer fails.
* config/frv/frv.h (DRIVER_SELF_SPECS): New.
(SUBTARGET_DRIVER_SELF_SPECS): New.
(ASM_SPEC): Don't pass -mno-fdpic.
(LINK_SPEC): Pass -melf32frvfd for FDPIC.
(MASK_INLINE_PLT, TARGET_INLINE_PLT): New.
(TARGET_SWITCHES): Add -minline-plt, -mno-inline-plt and
-multilib-library-pic.
(PREDICATE_CODES): Added fdpic_operand, fdpic_fptr_operand,
condexec_si_media_operator, condexec_sf_add_operator and
condexec_sf_conv_operator. Removed condexec_sf_binary_operator
and condexec_sf_unary_operator.
* config/frv/frv.md (R_FRV_GPREL12, R_FRV_GPRELHI, R_FRV_GPRELLO):
New.
(movsi_got, movsi_high_got, movsi_lo_sum_got): Move before
movsi_internal. Give them internal names. movsi_got has type
int.
(fdpic got splitters): Remove.
(symGPREL2reg, symGPREL2reg_hilo): New.
* config/frv/t-frv (MULTILIB_MATCHES): Don't map -fpic and -fPIC
to -mlibrary-pic. Map -multilib-library-pic to it.
* doc/invoke.texi: -mfdpic, -minline-plt, -multilib-library-pic:
Document.
2003-09-28 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_function_symbol_referenced_p): Declare.
(TARGET_CANNOT_FORCE_CONST_MEM): Define to...
(frv_cannot_force_const_mem): New function.
(const_small_data_p, plus_small_data_p): Update comments on sdata
on FDPIC.
(frv_override_options): Set flag_pie for FDPIC too.
(frv_conditional_register_usage): Mark gr16 and gr17 as non-fixed,
call-saved registers on FDPIC.
(frv_stack_info): Don't preserve the PIC register on FDPIC, and
don't force LR to be preserved.
(frv_expand_prologue): Likewise.
(frv_asm_output_mi_thunk): Use 12-bit funcdesc gotoff for -fpic.
(frv_frame_pointer_required): Don't force it just because the
FDPIC register is used.
(frv_legitimate_address_p) <CONST>: Accept a legitimate FDPIC
operand only if !condexec_p.
(frv_legitimize_address): Return the FDPIC-legitimized address.
Don't match small data here on FDPIC.
(frv_legitimate_fdpic_operand_p): Don't accept unadorned function
symbols. Use TRUE/FALSE instead of 1/0.
(frv_local_funcdesc_p): New.
(frv_legitimize_fdpic_address): Rewrite to use GOTOFF and 12-bit
immediates when possible.
(pic_symbolic_operand): Accept SYMBOL_REFs and CONSTs in FDPIC.
(dbl_memory_one_insn_operand): Accept addresses that add a REG and
an UNSPEC_GOT.
(frv_emit_movsi): Handle FDPIC before small data. Use GOTOFF and
12-bit immediates when possible.
(frv_legitimate_constant_p): In FDPIC, reject SImode operands that
are not legitimate pic operands.
(frv_in_small_data_p): Re-enable for FDPIC.
* config/frv/frv.h (SDA_BASE_REG): Remove comment about FDPIC.
(FRV_GLOBAL_P): Removed.
* config/frv/frv.md: Add modes to CONSTs.
(movsi_got): New.
(movsi_lo_sum_got): Use separate matches instead of match_dup.
(movsi_high_pic, movsi_lo_sum_pic): Match on non-FDPIC only.
(fdpic splittable operations): Match on flag_pic != 1.
2003-09-22 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_asm_out_constructor,
frv_asm_out_destructor): Pass to frv_assemble_integer the size in
bytes, not bits.
2003-09-19 Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.c (frv_assemble_integer): Reject complex
expressions referencing function SYMBOL_REFs.
* config/frv/frv.c (frv_function_symbol_referenced_p): New.
(move_source_operand): Reject CONSTs that reference function
SYMBOL_REFs on FDPIC.
(frv_emit_movsi): If we get such a CONST, break it up.
* config/frv/frv.h (CPP_SPEC): Define __FRV_FDPIC__ for -mfdpic.
(TRANSFER_FROM_TRAMPOLINE): Use different definitions for FDPIC.
* config/frv/frv.c (frv_print_operand) <I>: Recognize PLUS without
MEM.
(frv_assemble_integer): Don't use funcdesc for LABEL_REFs.
(frv_trampoline_size): Increase for FDPIC.
* config/frv/frv.h (TRAMPOLINE_ALIGNMENT): Bump to 64 for FDPIC.
(TRANSFER_FROM_TRAMPOLINE): Handle FDPIC trampolines.
* config/frv/frv.c (frv_legitimize_fdpic_address, frv_emit_movsi):
Disable use of GOTOFF for now.
(const_small_data_p, plus_small_data_p, frv_in_small_data_p):
Disable use of small data in FDPIC for now.
(frv_asm_output_mi_thunk): Implement for FDPIC.
* config/frv/frv.h (SDA_BASE_REG): Set to -1 with FDPIC.
* config/frv/frv.c (frv_asm_out_constructor): Use
frv_assemble_integer for FDPIC pointers.
(frv_asm_out_destructor): Likewise.
* config/frv/frv.md (ldd): Fix order of operands. Use
address_operand for input.
2003-09-18 DJ Delorie <dj@redhat.com>
* config/frv/frv.c (frv_legitimate_fdpic_operand_p): Remove UNSPEC_PIC.
(unspec_got_name): Correct typo.
(frv_emit_movsi): Pre-expand splittable GOTs.
(frv_expand_fdpic_call): Rename gen_lddi to gen_ldd.
* config/frv/frv.md (lddi): Fix syntax error, rename to ldd.
(symGOT2reg_hilo, symGOTOFF2reg_hilo): New.
* config/frv/t-frv: Add -mfdpic multilibs.
* config/frv/frv.h (ASM_SPEC): Pass -mfdpic/-mno-fdpic.
(TARGET_SWITCHES): Add -mno-fdpic, fix documentation.
* config/frv/frv.c (frv_override_options): -mfdpic assumes
flag_pic, default to 32-bit pics, require DWORD ops.
(frv_override_options): Add W and Z constraints.
(frv_expand_prologue): No pic prologue for -mfdpic.
(frv_asm_output_mi_thunk): Support -mfdpic (soon).
(frv_print_operand_memory_reference): Handle GOT constants.
(frv_legitimate_address_p): Allow GOT constants.
(frv_legitimize_address): Handle GOT addresses too.
(frv_legitimate_fdpic_operand_p): New.
(frv_legitimize_fdpic_address): New.
(unspec_got_name): New.
(frv_output_addr_const_extra): New.
(frv_expand_fdpic_call): New.
(frv_fdpic_fptr_operand): New.
(gpr_or_int12_operand): Handle GOT operands.
(int_2word_operand): Handle GOT operands.
(fdpic_operand): New.
(fdpic_splittable_got_operand): New.
(fdpic_got12_operand): New.
(frv_emit_movsi): Handle GOT operands.
(frv_assemble_integer): -mfdpic doesn't use rofixups.
(frv_print_operand): Support 'g' code for GOT operands.
* config/frv/frv-protos.h: Add prototypes as needed.
* config/frv/frv.md (R_FRV_GOT12, R_FRV_GOTHI, R_FRV_GOTLO,
R_FRV_FUNCDESC, R_FRV_FUNCDESC_GOT12, R_FRV_FUNCDESC_GOTHI,
R_FRV_FUNCDESC_GOTLO, R_FRV_FUNCDESC_VALUE,
R_FRV_FUNCDESC_GOTOFF12, R_FRV_FUNCDESC_GOTOFFHI,
R_FRV_FUNCDESC_GOTOFFLO, R_FRV_GOTOFF12, R_FRV_GOTOFFHI,
R_FRV_GOTOFFLO): New.
(movsi_high_got, movsi_lo_sum_got): New.
(*movsi_pic): Don't use this splitter for -mfdpic.
(addsi3): Allow GOT references also.
(call, call_value): Handle -mfdpic separately.
(call_fdpicdi, call_fdpicsi, lddi, call_value_fdpicdi,
call_value_fdpicsi): New.
(symGOT2reg, symGOT2reg_i, got splitters, symGOTOFF2reg,
symGOTOFF2reg_i): New.
* config/frv/frv.h (MASK_FDPIC): New.
(TARGET_FDPIC): New.
(TARGET_SWITCHES): Add -mfdpic.
(FDPIC_FPTR_REGNO): New.
(FDPIC_REGNO): New.
(OUR_FDPIC_REG): New.
(enum reg_class): Add FDPIC_REGS, FDPIC_FPTR_REGS, and
FDPIC_CALL_REGS.
(REG_CLASS_NAMES): Likewise.
(REG_CLASS_CONTENTS): Likewise.
(EXTRA_CONSTRAINT_FOR_Y): New, for 12-bit GOTs.
(EXTRA_CONSTRAINT): Add it here.
(FRV_GLOBAL_P): New.
(OUTPUT_ADDR_CONST_EXTRA): New.
From-SVN: r78373
2004-02-24 17:58:39 +01:00
|
|
|
data->dbase = load_base.got_value;
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
# else
|
|
|
|
# error What is DW_EH_PE_datarel base on this platform?
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
p = read_encoded_value_with_base (hdr->eh_frame_ptr_enc,
|
|
|
|
base_from_cb_data (hdr->eh_frame_ptr_enc,
|
|
|
|
data),
|
|
|
|
(const unsigned char *) (hdr + 1),
|
|
|
|
&eh_frame);
|
|
|
|
|
|
|
|
/* We require here specific table encoding to speed things up.
|
|
|
|
Also, DW_EH_PE_datarel here means using PT_GNU_EH_FRAME start
|
|
|
|
as base, not the processor specific DW_EH_PE_datarel. */
|
|
|
|
if (hdr->fde_count_enc != DW_EH_PE_omit
|
|
|
|
&& hdr->table_enc == (DW_EH_PE_datarel | DW_EH_PE_sdata4))
|
|
|
|
{
|
|
|
|
_Unwind_Ptr fde_count;
|
|
|
|
|
|
|
|
p = read_encoded_value_with_base (hdr->fde_count_enc,
|
|
|
|
base_from_cb_data (hdr->fde_count_enc,
|
|
|
|
data),
|
|
|
|
p, &fde_count);
|
|
|
|
/* Shouldn't happen. */
|
|
|
|
if (fde_count == 0)
|
|
|
|
return 1;
|
|
|
|
if ((((_Unwind_Ptr) p) & 3) == 0)
|
|
|
|
{
|
|
|
|
struct fde_table {
|
|
|
|
signed initial_loc __attribute__ ((mode (SI)));
|
|
|
|
signed fde __attribute__ ((mode (SI)));
|
|
|
|
};
|
|
|
|
const struct fde_table *table = (const struct fde_table *) p;
|
|
|
|
size_t lo, hi, mid;
|
|
|
|
_Unwind_Ptr data_base = (_Unwind_Ptr) hdr;
|
|
|
|
fde *f;
|
|
|
|
unsigned int f_enc, f_enc_size;
|
|
|
|
_Unwind_Ptr range;
|
|
|
|
|
|
|
|
mid = fde_count - 1;
|
|
|
|
if (data->pc < table[0].initial_loc + data_base)
|
|
|
|
return 1;
|
|
|
|
else if (data->pc < table[mid].initial_loc + data_base)
|
|
|
|
{
|
|
|
|
lo = 0;
|
|
|
|
hi = mid;
|
|
|
|
|
|
|
|
while (lo < hi)
|
|
|
|
{
|
|
|
|
mid = (lo + hi) / 2;
|
|
|
|
if (data->pc < table[mid].initial_loc + data_base)
|
|
|
|
hi = mid;
|
|
|
|
else if (data->pc >= table[mid + 1].initial_loc + data_base)
|
|
|
|
lo = mid + 1;
|
|
|
|
else
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
unwind-dw2-fde-glibc.c (base_from_cb_data, [...]): Use gcc_assert and gcc_unreachable as appropriate.
* unwind-dw2-fde-glibc.c (base_from_cb_data,
_Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as
appropriate.
* unwind-dw2-fde.c (__deregister_frame_info_bases,
base_from_object, fde_split, end_fde_sort): Likewise.
* unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op,
execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1,
uw_init_context_1): Likewise.
* unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume,
_Unwind_Resume_or_Rethrow): Likewise.
* unwind-pe.h (__gxx_abort): Do not define.
(size_of_encoded_value, base_of_encoded_value,
read_encoded_value_with_base): Use gcc_unreachable.
* unwind.h (_Unwind_GetTextRelBase): Likewise.
From-SVN: r99835
2005-05-17 17:37:47 +02:00
|
|
|
gcc_assert (lo < hi);
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
f = (fde *) (table[mid].fde + data_base);
|
|
|
|
f_enc = get_fde_encoding (f);
|
|
|
|
f_enc_size = size_of_encoded_value (f_enc);
|
|
|
|
read_encoded_value_with_base (f_enc & 0x0f, 0,
|
|
|
|
&f->pc_begin[f_enc_size], &range);
|
|
|
|
if (data->pc < table[mid].initial_loc + data_base + range)
|
|
|
|
data->ret = f;
|
|
|
|
data->func = (void *) (table[mid].initial_loc + data_base);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* We have no sorted search table, so need to go the slow way.
|
|
|
|
As soon as GLIBC will provide API so to notify that a library has been
|
|
|
|
removed, we could cache this (and thus use search_object). */
|
|
|
|
ob.pc_begin = NULL;
|
|
|
|
ob.tbase = data->tbase;
|
|
|
|
ob.dbase = data->dbase;
|
|
|
|
ob.u.single = (fde *) eh_frame;
|
|
|
|
ob.s.i = 0;
|
|
|
|
ob.s.b.mixed_encoding = 1; /* Need to assume worst case. */
|
|
|
|
data->ret = linear_search_fdes (&ob, (fde *) eh_frame, (void *) data->pc);
|
|
|
|
if (data->ret != NULL)
|
|
|
|
{
|
2005-06-14 10:25:18 +02:00
|
|
|
_Unwind_Ptr func;
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
unsigned int encoding = get_fde_encoding (data->ret);
|
2009-11-25 11:55:54 +01:00
|
|
|
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
read_encoded_value_with_base (encoding,
|
|
|
|
base_from_cb_data (encoding, data),
|
2005-06-14 10:25:18 +02:00
|
|
|
data->ret->pc_begin, &func);
|
|
|
|
data->func = (void *) func;
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2003-10-31 Andreas Jaeger <aj@suse.de>,
Zack Weinberg <zack@codesourcery.com>
* crtstuff.c (__register_frame_info, __register_frame_info_bases)
(__deregister_frame_info, __deregister_frame_info_bases):
Constify void * argument.
* unwind-dw2-fde.h (struct fde_vector):
Constify 'orig_data' and 'array' fields.
(__register_frame_info, __register_frame_info_bases)
(__deregister_frame_info, __deregister_frame_info_bases):
Constify void * argument.
(get_cie, next_fde, _Unwind_Find_FDE): Constify arguments,
return values, and casts of type fde *, struct dwarf_fde *,
and struct dwarf_cie *.
* unwind-dw2-fde.c (__register_frame_info, __register_frame_info_bases)
(__deregister_frame_info, __deregister_frame_info_bases):
Constify void * argument.
(get_cie_encoding, ): Constify struct dwarf_cie * argument.
(get_fde_encoding, fde_unencoded_compare, fde_single_encoding_compare)
(fde_mixed_encoding_compare, fde_compare_t, start_fde_sort, fde_insert)
fde_split, SWAP, frame_downheap, frame_heapsort)
(classify_object_over_fdes, add_fdes, linear_search_fdes,
binary_search_unencoded_fdes, binary_search_single_encoding_fdes,
binary_search_mixed_encoding_fdes, search_object, _Unwind_Find_FDE):
Constify arguments, local variables, return values, and casts
of type fde *, fde **, struct dwarf_fde *, and struct dwarf_cie *.
Use const pointer types in sizeof expressions, for clarity.
* unwind-dw2-fde-glibc.c
(_Unwind_find_registered_FDE, _Unwind_find_FDE): Constify return value.
(struct unw_eh_callback_data): Constify 'ret' field.
Co-Authored-By: Zack Weinberg <zack@codesourcery.com>
From-SVN: r73155
2003-10-31 21:46:26 +01:00
|
|
|
const fde *
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
_Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases)
|
|
|
|
{
|
|
|
|
struct unw_eh_callback_data data;
|
2003-10-31 Andreas Jaeger <aj@suse.de>,
Zack Weinberg <zack@codesourcery.com>
* crtstuff.c (__register_frame_info, __register_frame_info_bases)
(__deregister_frame_info, __deregister_frame_info_bases):
Constify void * argument.
* unwind-dw2-fde.h (struct fde_vector):
Constify 'orig_data' and 'array' fields.
(__register_frame_info, __register_frame_info_bases)
(__deregister_frame_info, __deregister_frame_info_bases):
Constify void * argument.
(get_cie, next_fde, _Unwind_Find_FDE): Constify arguments,
return values, and casts of type fde *, struct dwarf_fde *,
and struct dwarf_cie *.
* unwind-dw2-fde.c (__register_frame_info, __register_frame_info_bases)
(__deregister_frame_info, __deregister_frame_info_bases):
Constify void * argument.
(get_cie_encoding, ): Constify struct dwarf_cie * argument.
(get_fde_encoding, fde_unencoded_compare, fde_single_encoding_compare)
(fde_mixed_encoding_compare, fde_compare_t, start_fde_sort, fde_insert)
fde_split, SWAP, frame_downheap, frame_heapsort)
(classify_object_over_fdes, add_fdes, linear_search_fdes,
binary_search_unencoded_fdes, binary_search_single_encoding_fdes,
binary_search_mixed_encoding_fdes, search_object, _Unwind_Find_FDE):
Constify arguments, local variables, return values, and casts
of type fde *, fde **, struct dwarf_fde *, and struct dwarf_cie *.
Use const pointer types in sizeof expressions, for clarity.
* unwind-dw2-fde-glibc.c
(_Unwind_find_registered_FDE, _Unwind_find_FDE): Constify return value.
(struct unw_eh_callback_data): Constify 'ret' field.
Co-Authored-By: Zack Weinberg <zack@codesourcery.com>
From-SVN: r73155
2003-10-31 21:46:26 +01:00
|
|
|
const fde *ret;
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
|
|
|
|
ret = _Unwind_Find_registered_FDE (pc, bases);
|
|
|
|
if (ret != NULL)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
data.pc = (_Unwind_Ptr) pc;
|
|
|
|
data.tbase = NULL;
|
|
|
|
data.dbase = NULL;
|
|
|
|
data.func = NULL;
|
|
|
|
data.ret = NULL;
|
2005-03-04 20:54:16 +01:00
|
|
|
data.check_cache = 1;
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
|
|
|
|
if (dl_iterate_phdr (_Unwind_IteratePhdrCallback, &data) < 0)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if (data.ret)
|
|
|
|
{
|
|
|
|
bases->tbase = data.tbase;
|
|
|
|
bases->dbase = data.dbase;
|
|
|
|
bases->func = data.func;
|
|
|
|
}
|
|
|
|
return data.ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
2001-12-16 02:27:57 +01:00
|
|
|
/* Prevent multiple include of header files. */
|
|
|
|
#define _Unwind_Find_FDE _Unwind_Find_FDE
|
configure.in: Check for ld.
* configure.in: Check for ld.
(HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option.
* configure, config.in: Rebuilt.
* config.gcc: Add crtbeginT.o to extra_parts where needed.
* config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc
frame unwinding on Linux.
* config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde
frame unwinding.
* config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static.
* config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define.
* config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't
iterate further if pc falls into current library, but fde was not
found.
* config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static
if using glibc.
(LINK_EH_SPEC): Define.
* config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64):
Use crtbeginT.o for -static.
(LINK_EH_SPEC): Define.
* config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
* Makefile.in (crtbeginT.o): Add rule.
* gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh.
If neither -static-libgcc nor -shared-libgcc is passed and -shared,
use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not.
If none of the above switches are passed, use -lgcc -lgcc_eh.
(init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec.
* mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if
creating libgcc_s.so, put them into separate libgcc_eh.a instead.
* unwind-dw2-fde.c: Don't include any headers if this file
is included from other .c file.
* unwind-dw2-fde-glibc.c: New file.
* crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define.
Use it instead of EH_FRAME_SECTION_NAME where appropriate.
From-SVN: r48039
2001-12-15 12:49:18 +01:00
|
|
|
#include "unwind-dw2-fde.c"
|
|
|
|
#endif
|
2004-09-04 02:15:42 +02:00
|
|
|
|
|
|
|
#if defined (USE_GAS_SYMVER) && defined (SHARED) && defined (USE_LIBUNWIND_EXCEPTIONS)
|
|
|
|
alias (_Unwind_Find_FDE);
|
|
|
|
#endif
|