aboutsummaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils/gdb
diff options
context:
space:
mode:
authorDoug Rabson <dfr@FreeBSD.org>1998-04-30 08:03:50 +0000
committerDoug Rabson <dfr@FreeBSD.org>1998-04-30 08:03:50 +0000
commit0f9bd807c985d7a830c49588e52139d5004013f6 (patch)
tree7bfcc4fc1a9c186bda6862884574c5d6b6203e8d /gnu/usr.bin/binutils/gdb
parent9890b24c74cf25c4d648f5f8a39c53635232d1ea (diff)
downloadsrc-0f9bd807c985d7a830c49588e52139d5004013f6.tar.gz
src-0f9bd807c985d7a830c49588e52139d5004013f6.zip
Add support for ELF shared libraries. Also use bfd from the binutils in that
case rather than gdb's own copy.
Notes
Notes: svn path=/head/; revision=35535
Diffstat (limited to 'gnu/usr.bin/binutils/gdb')
-rw-r--r--gnu/usr.bin/binutils/gdb/Makefile33
-rw-r--r--gnu/usr.bin/binutils/gdb/i386/nm.h7
2 files changed, 37 insertions, 3 deletions
diff --git a/gnu/usr.bin/binutils/gdb/Makefile b/gnu/usr.bin/binutils/gdb/Makefile
index b75e304d312e..8937114b181b 100644
--- a/gnu/usr.bin/binutils/gdb/Makefile
+++ b/gnu/usr.bin/binutils/gdb/Makefile
@@ -1,12 +1,21 @@
-# $Id: Makefile,v 1.30 1998/03/07 08:54:42 bde Exp $
+# $Id: Makefile,v 1.31 1998/03/19 15:21:19 bde Exp $
PROG = gdb
GDBDIR= ${.CURDIR}/../../../../contrib/gdb
+.if ${BINFORMAT} == elf
+BFDDIR= ${.CURDIR}/../../binutils/libbfd/${MACHINE_ARCH}
+.else
+BFDDIR= ${.CURDIR}/../bfd
+.endif
.PATH: ${GDBDIR}/gdb
.PATH: ${GDBDIR}/opcodes
-BINDIR= /usr/bin
+.if ${BINFORMAT} == elf
+CFLAGS+= -DFREEBSD_ELF
+.endif
+
+BINDIR?= /usr/bin
XSRCS = annotate.c blockframe.c breakpoint.c buildsym.c c-lang.c \
c-typeprint.c c-valprint.c ch-lang.c ch-typeprint.c \
ch-valprint.c coffread.c command.c complaints.c copying.c \
@@ -32,7 +41,7 @@ XSRCS = annotate.c blockframe.c breakpoint.c buildsym.c c-lang.c \
XSRCS+= i386-dis.c dis-buf.c disassemble.c
SRCS= init.c ${XSRCS}
-CFLAGS+= -I$(.CURDIR) -I${DESTDIR}/usr/include/readline -I$(.CURDIR)/../bfd
+CFLAGS+= -I$(.CURDIR) -I${DESTDIR}/usr/include/readline -I${BFDDIR}
# use phkmalloc
CFLAGS+= -DNO_MMALLOC
# uncomment the next line if you want to debug gdb
@@ -40,6 +49,22 @@ CFLAGS+= -DNO_MMALLOC
CLEANFILES+= c-exp.c f-exp.c m2-exp.c init.c y.tab.h init.c-tmp
+.if ${BINFORMAT} == elf
+
+.if exists(${.OBJDIR}/../../binutils/libbfd)
+LIBBFD= ${.OBJDIR}/../../binutils/libbfd/libbfd.a
+.else
+LIBBFD= ${.CURDIR}/../../binutils/libbfd/libbfd.a
+.endif
+
+.if exists(${.OBJDIR}/../../binutils/libiberty)
+LIBIBERTY= ${.OBJDIR}/../../binutils/libiberty/libiberty.a
+.else
+LIBIBERTY= ${.CURDIR}/../../binutils/libiberty/libiberty.a
+.endif
+
+.else
+
.if exists(${.OBJDIR}/../bfd)
LIBBFD= ${.OBJDIR}/../bfd/libbfd.a
.else
@@ -52,6 +77,8 @@ LIBIBERTY= ${.OBJDIR}/../libiberty/libiberty.a
LIBIBERTY= ${.CURDIR}/../libiberty/libiberty.a
.endif
+.endif # BINFORMAT
+
DPADD= ${LIBBFD} ${LIBREADLINE} ${LIBGNUREGEX} ${LIBIBERTY} ${LIBTERMCAP}
LDADD= ${LIBBFD} -lreadline -lgnuregex ${LIBIBERTY} -ltermcap
DPADD+= ${LIBIBERTY}
diff --git a/gnu/usr.bin/binutils/gdb/i386/nm.h b/gnu/usr.bin/binutils/gdb/i386/nm.h
index 1edc1cecaf51..84ec01ea5032 100644
--- a/gnu/usr.bin/binutils/gdb/i386/nm.h
+++ b/gnu/usr.bin/binutils/gdb/i386/nm.h
@@ -24,6 +24,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Be shared lib aware */
#include "solib.h"
+#ifdef FREEBSD_ELF
+#define SVR4_SHARED_LIBS
+#endif
/* This is the amount to subtract from u.u_ar0
to get the offset in the core file of the register values. */
@@ -42,6 +45,8 @@ i386_register_u_addr PARAMS ((int, int));
#define PTRACE_ARG3_TYPE char*
+#ifndef FREEBSD_ELF
+
/* make structure definitions match up with those expected in solib.c */
#define link_object sod
#define lo_name sod_name
@@ -95,6 +100,8 @@ i386_register_u_addr PARAMS ((int, int));
#define ld_un d_un
#define ld_2 d_sdt
+#endif
+
/* Return sizeof user struct to callers in less machine dependent routines */
#define KERNEL_U_SIZE kernel_u_size()