config.host: Add bits to support powerpc64-*-freebsd*.
2012-03-21 Andreas Tobler <andreast@fgznet.ch> * config.host: Add bits to support powerpc64-*-freebsd*. * config/rs6000/freebsd-unwind.h: New file. * config/rs6000/t-freebsd64: New file. From-SVN: r185614
This commit is contained in:
parent
f4e017c4b1
commit
d82ad50db3
4 changed files with 88 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
2012-03-21 Andreas Tobler <andreast@fgznet.ch>
|
||||
|
||||
* config.host: Add bits to support powerpc64-*-freebsd*.
|
||||
* config/rs6000/freebsd-unwind.h: New file.
|
||||
* config/rs6000/t-freebsd64: New file.
|
||||
|
||||
2012-03-20 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR gcov-profile/52627
|
||||
|
|
|
@ -830,9 +830,15 @@ powerpc64-*-darwin*)
|
|||
tmake_file="$tmake_file rs6000/t-darwin64 rs6000/t-ibm-ldouble"
|
||||
extra_parts="$extra_parts crt2.o"
|
||||
;;
|
||||
powerpc-*-freebsd*)
|
||||
tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-savresfgpr rs6000/t-crtstuff rs6000/t-freebsd t-softfp-sfdf t-softfp-excl t-softfp t-slibgcc-libgcc"
|
||||
powerpc*-*-freebsd*)
|
||||
tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-savresfgpr rs6000/t-crtstuff rs6000/t-freebsd t-softfp-sfdf t-softfp-excl t-softfp"
|
||||
extra_parts="$extra_parts crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
|
||||
case ${host} in
|
||||
powerpc64*)
|
||||
tmake_file="${tmake_file} rs6000/t-freebsd64"
|
||||
md_unwind_header=rs6000/freebsd-unwind.h
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
powerpc-*-netbsd*)
|
||||
tmake_file="$tmake_file rs6000/t-netbsd rs6000/t-crtstuff"
|
||||
|
|
69
libgcc/config/rs6000/freebsd-unwind.h
Normal file
69
libgcc/config/rs6000/freebsd-unwind.h
Normal file
|
@ -0,0 +1,69 @@
|
|||
/* DWARF2 EH unwinding support for PowerPC64 FreeBSD.
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published
|
||||
by the Free Software Foundation; either version 3, or (at your
|
||||
option) any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
License for more details.
|
||||
|
||||
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.
|
||||
|
||||
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/>. */
|
||||
|
||||
#define R_LR 65
|
||||
|
||||
#define MD_FROB_UPDATE_CONTEXT frob_update_context
|
||||
|
||||
static void
|
||||
frob_update_context (struct _Unwind_Context *context,
|
||||
_Unwind_FrameState *fs ATTRIBUTE_UNUSED)
|
||||
{
|
||||
const unsigned int *pc = (const unsigned int *) context->ra;
|
||||
|
||||
#ifdef __powerpc64__
|
||||
if (fs->regs.reg[2].how == REG_UNSAVED)
|
||||
{
|
||||
/* If the current unwind info (FS) does not contain explicit info
|
||||
saving R2, then we have to do a minor amount of code reading to
|
||||
figure out if it was saved. The big problem here is that the
|
||||
code that does the save/restore is generated by the linker, so
|
||||
we have no good way to determine at compile time what to do. */
|
||||
if (pc[0] == 0xF8410028
|
||||
|| ((pc[0] & 0xFFFF0000) == 0x3D820000
|
||||
&& pc[1] == 0xF8410028))
|
||||
{
|
||||
/* We are in a plt call stub or r2 adjusting long branch stub,
|
||||
before r2 has been saved. Keep REG_UNSAVED. */
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned int *insn
|
||||
= (unsigned int *) _Unwind_GetGR (context, R_LR);
|
||||
if (insn && *insn == 0xE8410028)
|
||||
_Unwind_SetGRPtr (context, 2, context->cfa + 40);
|
||||
else if (pc[0] == 0x4E800421
|
||||
&& pc[1] == 0xE8410028)
|
||||
{
|
||||
/* We are at the bctrl instruction in a call via function
|
||||
pointer. gcc always emits the load of the new R2 just
|
||||
before the bctrl so this is the first and only place
|
||||
we need to use the stored R2. */
|
||||
_Unwind_Word sp = _Unwind_GetGR (context, 1);
|
||||
_Unwind_SetGRPtr (context, 2, (void *)(sp + 40));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
5
libgcc/config/rs6000/t-freebsd64
Normal file
5
libgcc/config/rs6000/t-freebsd64
Normal file
|
@ -0,0 +1,5 @@
|
|||
HOST_LIBGCC2_CFLAGS += -mno-minimal-toc
|
||||
SHLIB_MAPFILES = libgcc-std.ver
|
||||
|
||||
softfp_wrap_start := '\#ifndef __powerpc64__'
|
||||
softfp_wrap_end := '\#endif'
|
Loading…
Add table
Reference in a new issue