Commit 2208d2ac by Loren J. Rittle Committed by Loren J. Rittle

unwind-dw2-fde-glibc.c: Define and use USE_PT_GNU_EH_FRAME.

2009-09-22  Loren J. Rittle  <ljrittle@acm.org>

	* unwind-dw2-fde-glibc.c: Define and use USE_PT_GNU_EH_FRAME.
	Enable a new case for __FreeBSD__ >= 7.
	* crtstuff.c:  Define USE_PT_GNU_EH_FRAME for __FreeBSD__ >= 7.
	* config/t-freebsd: Define LIB2ADDEH and LIB2ADDEHDEP.
	* config/freebsd-spec.h: Conditionally define LINK_EH_SPEC
	and USE_LD_AS_NEEDED.

From-SVN: r152027
parent 5d0001f0
2009-09-22 Loren J. Rittle <ljrittle@acm.org>
* unwind-dw2-fde-glibc.c: Define and use USE_PT_GNU_EH_FRAME.
Enable a new case for __FreeBSD__ >= 7.
* crtstuff.c: Define USE_PT_GNU_EH_FRAME for __FreeBSD__ >= 7.
* config/t-freebsd: Define LIB2ADDEH and LIB2ADDEHDEP.
* config/freebsd-spec.h: Conditionally define LINK_EH_SPEC
and USE_LD_AS_NEEDED.
2009-09-22 Richard Guenther <rguenther@suse.de>
PR middle-end/41395
......
......@@ -148,3 +148,12 @@ is built with the --enable-threads configure-time option.} \
#else
#define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1"
#endif
#if defined(HAVE_LD_EH_FRAME_HDR)
#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
#endif
/* Use --as-needed -lgcc_s for eh support. */
#ifdef HAVE_LD_AS_NEEDED
#define USE_LD_AS_NEEDED 1
#endif
......@@ -3,3 +3,8 @@ CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
# Compile libgcc.a with pic.
TARGET_LIBGCC2_CFLAGS += -fPIC
# Use unwind-dw2-fde-glibc
LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
$(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c
LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
......@@ -83,6 +83,15 @@ call_ ## FUNC (void) \
&& !defined(OBJECT_FORMAT_FLAT) \
&& defined(HAVE_LD_EH_FRAME_HDR) \
&& !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
&& defined(__FreeBSD__) && __FreeBSD__ >= 7
#include <link.h>
# define USE_PT_GNU_EH_FRAME
#endif
#if defined(OBJECT_FORMAT_ELF) \
&& !defined(OBJECT_FORMAT_FLAT) \
&& defined(HAVE_LD_EH_FRAME_HDR) \
&& !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
&& defined(__GLIBC__) && __GLIBC__ >= 2
#include <link.h>
/* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h.
......
......@@ -48,6 +48,16 @@
#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
&& (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
|| (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
# define USE_PT_GNU_EH_FRAME
#endif
#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
&& defined(__FreeBSD__) && __FreeBSD__ >= 7
# define ElfW __ElfN
# define USE_PT_GNU_EH_FRAME
#endif
#if defined(USE_PT_GNU_EH_FRAME)
#ifndef __RELOC_POINTER
# define __RELOC_POINTER(ptr, base) ((ptr) + (base))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment