summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2004-10-27 18:05:57 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2004-10-27 18:05:57 +0000
commitcaa7273e1ab27414f10973ff857f9281a1b240bb (patch)
treea889acebbf79d1b923a2cac04ed30bdd6eb06b90
parent3b8609c9a7c0307f2b893350d424b1e67d6122bd (diff)
Add support to find DWARF call fame info in shared libraries.
This makes DWARF-based exception handling work for shared libraries and dynamic executables. ok drahn@, millert@, pval@
-rw-r--r--gnu/usr.bin/gcc/gcc/config/openbsd.h4
-rw-r--r--gnu/usr.bin/gcc/gcc/config/t-openbsd6
-rw-r--r--gnu/usr.bin/gcc/gcc/unwind-dw2-fde-openbsd.c9
3 files changed, 19 insertions, 0 deletions
diff --git a/gnu/usr.bin/gcc/gcc/config/openbsd.h b/gnu/usr.bin/gcc/gcc/config/openbsd.h
index 8ccc385000d..96f6ee1c8ef 100644
--- a/gnu/usr.bin/gcc/gcc/config/openbsd.h
+++ b/gnu/usr.bin/gcc/gcc/config/openbsd.h
@@ -153,6 +153,10 @@ Boston, MA 02111-1307, USA. */
"%{g:%{!nostdlib:-L/usr/lib/debug}} %{!shared:%{!nostdlib:%{!r*:%{!e*:-e start}}}} %{shared:-Bshareable -x} -dc -dp %{R*} %{static:-Bstatic} %{assert*}"
#endif
+#if defined(HAVE_LD_EH_FRAME_HDR)
+#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
+#endif
+
#undef LIB_SPEC
#define LIB_SPEC OBSD_LIB_SPEC
#endif
diff --git a/gnu/usr.bin/gcc/gcc/config/t-openbsd b/gnu/usr.bin/gcc/gcc/config/t-openbsd
index 0578cbd6225..91d7b7ede4e 100644
--- a/gnu/usr.bin/gcc/gcc/config/t-openbsd
+++ b/gnu/usr.bin/gcc/gcc/config/t-openbsd
@@ -3,3 +3,9 @@ STMP_FIXPROTO =
# We don't need GCC's own include files.
USER_H =
+
+# Use unwind-dw2-fde-openbsd
+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-openbsd.c \
+ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c \
+ unwind-dw2-fde-glibc.c
diff --git a/gnu/usr.bin/gcc/gcc/unwind-dw2-fde-openbsd.c b/gnu/usr.bin/gcc/gcc/unwind-dw2-fde-openbsd.c
new file mode 100644
index 00000000000..69310d9a32d
--- /dev/null
+++ b/gnu/usr.bin/gcc/gcc/unwind-dw2-fde-openbsd.c
@@ -0,0 +1,9 @@
+/* XXX This file provides a few defines such that we can compile the
+ source from unwind-dw2-fde-glibc.c on OpenBSD. Hopefully we can
+ integrate these defines in that file and rename it to something
+ like unwind-de2-fde-phdr.c in the up-stream sources. */
+
+#define ElfW(type) Elf_##type
+
+#define __GLIBC__ 3 /* Fool unwind-dw2-fde-glibc.c. */
+#include "unwind-dw2-fde-glibc.c"