binutils 2.12 - GNU development tools.

This commit is contained in:
fgsch 2002-04-21 21:39:52 +00:00
parent 04a37450ba
commit 419f484a97
27 changed files with 841 additions and 0 deletions

View File

@ -0,0 +1,68 @@
# $OpenBSD: Makefile,v 1.1.1.1 2002/04/21 21:39:52 fgsch Exp $
COMMENT= "GNU development tools"
DISTNAME= binutils-2.12
CATEGORIES= devel
NEED_VERSION= 1.524
MASTER_SITES= ${MASTER_SITE_GNU}
MASTER_SITE_SUBDIR= binutils
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
MAINTAINER= Federico G. Schwindt <fgsch@openbsd.org>
HOMEPAGE= http://sources.redhat.com/
BUILD_DEPENDS= automake::devel/automake \
autoconf::devel/autoconf-new
CONFIGURE_STYLE= simple
CONFIGURE_ARGS= --with-prefix=${PREFIX} \
--disable-nls --disable-commonbfdlib
# cross-tools
FLAVORS= alpha hppa i386 m68k m88k mips powerpc sparc sparc64
#FLAVORS+= vax
FLAVOR?=
# XXX: special handling needed for powerpc arch's and bootstraping
.if !empty(FLAVOR:L) && ${FLAVOR:L} != ${MACHINE_ARCH}
CONFIGURE_ARGS+= --target=${FLAVOR:L}-unknown-openbsd${OSREV}
TARGET_ARCH= ${FLAVOR:L}
.else
TARGET_ARCH= ${MACHINE_ARCH}
.endif
TARGET_DIR= $${PREFIX}/${TARGET_ARCH}-unknown-openbsd${OSREV}
FILES= ar nm-new objdump ranlib size strings strip-new
post-patch:
@cd ${WRKSRC}/bfd && autoconf-new
@-cd ${WRKSRC}/gas && { automake; autoconf-new; }
@cd ${WRKSRC}/ld && automake
do-install:
${INSTALL_DATA_DIR} ${TARGET_DIR}/bin
${INSTALL_DATA_DIR} ${TARGET_DIR}/man/man1
cd ${WRKSRC} && { \
${INSTALL_PROGRAM} gas/as-new ${TARGET_DIR}/bin/as; \
${INSTALL_PROGRAM} gprof/gprof ${TARGET_DIR}/bin; \
${INSTALL_PROGRAM} ld/ld-new ${TARGET_DIR}/bin/ld; \
${INSTALL_MAN} gas/doc/as.1 ${TARGET_DIR}/man/man1; \
${INSTALL_MAN} gprof/gprof.1 ${TARGET_DIR}/man/man1; \
${INSTALL_MAN} ld/ld.1 ${TARGET_DIR}/man/man1; \
for s in ${FILES}; do \
d=`echo $${s} | sed s/-new//`; \
${INSTALL_PROGRAM} binutils/$${s} ${TARGET_DIR}/bin/$${d}; \
${INSTALL_MAN} binutils/doc/$${d}.1 ${TARGET_DIR}/man/man1; \
done \
}
SUBST_VARS=TARGET_ARCH OSREV
.include <bsd.port.mk>

View File

@ -0,0 +1,3 @@
MD5 (binutils-2.12.tar.gz) = 295ea15df939ca42b2ef8320dcd76f4c
RMD160 (binutils-2.12.tar.gz) = ab46e4b447ae74e3b5095fcb2b5a1e944ab2944a
SHA1 (binutils-2.12.tar.gz) = de3898182180c69fea6b083968190ac0f36ca1ff

View File

@ -0,0 +1,30 @@
$OpenBSD: patch-bfd_config_bfd,v 1.1.1.1 2002/04/21 21:39:56 fgsch Exp $
--- bfd/config.bfd.orig Wed Feb 13 17:45:46 2002
+++ bfd/config.bfd Sat Apr 6 22:09:49 2002
@@ -70,7 +70,7 @@ esac
case "${targ}" in
# START OF targmatch.h
#ifdef BFD64
- alpha*-*-netbsd* | alpha*-*-freebsd*)
+ alpha*-*-netbsd* | alpha*-*-freebsd* | alpha*-*-openbsd*)
targ_defvec=bfd_elf64_alpha_vec
targ_selvecs=ecoffalpha_little_vec
;;
@@ -104,7 +104,7 @@ case "${targ}" in
targ_defvec=bfd_elf32_ia64_hpux_big_vec
targ_selvecs="bfd_elf64_ia64_hpux_big_vec"
;;
- sparc64-*-freebsd* | sparc64-*-netbsd*)
+ sparc64-*-freebsd* | sparc64-*-netbsd* | sparc64-*-openbsd*)
targ_defvec=bfd_elf64_sparc_vec
targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
;;
@@ -303,7 +303,7 @@ case "${targ}" in
targ_defvec=bfd_elf32_hppa_linux_vec
targ_selvecs=bfd_elf32_hppa_vec
;;
- hppa*-*-*elf* | hppa*-*-lites* | hppa*-*-netbsd* | hppa*-*-sysv4* | hppa*-*-rtems*)
+ hppa*-*-*elf* | hppa*-*-lites* | hppa*-*-netbsd* | hppa*-*-openbsd* | hppa*-*-sysv4* | hppa*-*-rtems*)
targ_defvec=bfd_elf32_hppa_vec
targ_selvecs=bfd_elf32_hppa_linux_vec
;;

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-bfd_configure_in,v 1.1.1.1 2002/04/21 21:39:52 fgsch Exp $
--- bfd/configure.in.orig Fri Mar 8 03:12:11 2002
+++ bfd/configure.in Sat Apr 6 22:09:50 2002
@@ -163,6 +163,7 @@ if test "${target}" = "${host}"; then
TRAD_HEADER='"hosts/alphalinux.h"'
;;
alpha*-*-netbsd*) COREFILE=netbsd-core.lo ;;
+ alpha*-*-openbsd*) COREFILE=netbsd-core.lo ;;
alpha*-*-*) COREFILE=osf-core.lo ;;
arm-*-freebsd*) COREFILE='' ;;
arm-*-netbsd*) COREFILE=netbsd-core.lo ;;

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-bfd_elf_c,v 1.1.1.1 2002/04/21 21:39:56 fgsch Exp $
--- bfd/elf.c.orig Thu Feb 14 01:12:45 2002
+++ bfd/elf.c Sun Apr 7 18:27:48 2002
@@ -5096,7 +5096,9 @@ _bfd_elf_get_symtab_upper_bound (abfd)
Elf_Internal_Shdr *hdr = &elf_tdata (abfd)->symtab_hdr;
symcount = hdr->sh_size / get_elf_backend_data (abfd)->s->sizeof_sym;
- symtab_size = (symcount - 1 + 1) * (sizeof (asymbol *));
+ symtab_size = (symcount + 1) * (sizeof (asymbol *));
+ if (symtab_size > 0)
+ symtab_size -= sizeof (asymbol *);
return symtab_size;
}
@@ -5116,7 +5118,9 @@ _bfd_elf_get_dynamic_symtab_upper_bound
}
symcount = hdr->sh_size / get_elf_backend_data (abfd)->s->sizeof_sym;
- symtab_size = (symcount - 1 + 1) * (sizeof (asymbol *));
+ symtab_size = (symcount + 1) * (sizeof (asymbol *));
+ if (symtab_size > 0)
+ symtab_size -= sizeof (asymbol *);
return symtab_size;
}

View File

@ -0,0 +1,11 @@
--- binutils/ar.c.orig Wed Jan 23 13:12:55 2002
+++ binutils/ar.c Sat Apr 6 22:09:50 2002
@@ -1091,7 +1091,7 @@ write_archive (iarch)
old_name = xmalloc (strlen (bfd_get_filename (iarch)) + 1);
strcpy (old_name, bfd_get_filename (iarch));
- new_name = make_tempname (old_name);
+ new_name = make_tempname (old_name, 0);
output_filename = new_name;

View File

@ -0,0 +1,62 @@
--- binutils/bucomm.c.orig Thu Nov 29 15:51:21 2001
+++ binutils/bucomm.c Sat Apr 6 22:09:51 2002
@@ -198,12 +198,14 @@ print_arelt_descr (file, abfd, verbose)
/* Return the name of a temporary file in the same directory as FILENAME. */
char *
-make_tempname (filename)
+make_tempname (filename, isdir)
char *filename;
+ int isdir;
{
static char template[] = "stXXXXXX";
char *tmpname;
char *slash = strrchr (filename, '/');
+ char c;
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
{
@@ -218,8 +220,6 @@ make_tempname (filename)
if (slash != (char *) NULL)
{
- char c;
-
c = *slash;
*slash = 0;
tmpname = xmalloc (strlen (filename) + sizeof (template) + 2);
@@ -233,15 +233,31 @@ make_tempname (filename)
#endif
strcat (tmpname, "/");
strcat (tmpname, template);
- mktemp (tmpname);
- *slash = c;
}
else
{
tmpname = xmalloc (sizeof (template));
strcpy (tmpname, template);
- mktemp (tmpname);
}
+
+ if (isdir)
+ {
+ if (mkdtemp (tmpname) != (char *) NULL)
+ tmpname = NULL;
+ }
+ else
+ {
+ int fd;
+
+ fd = mkstemp (tmpname);
+ if (fd == -1)
+ tmpname = NULL;
+ else
+ close (fd);
+ }
+ if (slash != (char *) NULL)
+ *slash = c;
+
return tmpname;
}

View File

@ -0,0 +1,11 @@
--- binutils/bucomm.h.orig Sun Jul 29 02:31:43 2001
+++ binutils/bucomm.h Sat Apr 6 22:09:51 2002
@@ -168,7 +168,7 @@ void list_supported_architectures PARAMS
void print_arelt_descr PARAMS ((FILE *file, bfd *abfd, boolean verbose));
-char *make_tempname PARAMS ((char *));
+char *make_tempname PARAMS ((char *, int));
bfd_vma parse_vma PARAMS ((const char *, const char *));

View File

@ -0,0 +1,38 @@
--- binutils/objcopy.c.orig Sun Feb 10 23:57:17 2002
+++ binutils/objcopy.c Sat Apr 6 22:09:52 2002
@@ -1292,7 +1292,7 @@ copy_archive (ibfd, obfd, output_target)
} *list, *l;
bfd **ptr = &obfd->archive_head;
bfd *this_element;
- char *dir = make_tempname (bfd_get_filename (obfd));
+ char *dir = make_tempname (bfd_get_filename (obfd), 1);
/* Make a temp directory to hold the contents. */
if (MKDIR (dir, 0700) != 0)
@@ -1324,7 +1324,7 @@ copy_archive (ibfd, obfd, output_target)
/* If the file already exists, make another temp dir. */
if (stat (output_name, &buf) >= 0)
{
- output_name = make_tempname (output_name);
+ output_name = make_tempname (output_name, 1);
if (MKDIR (output_name, 0700) != 0)
{
fatal (_("cannot mkdir %s for archive copying (error: %s)"),
@@ -2078,7 +2078,7 @@ strip_main (argc, argv)
if (output_file != NULL)
tmpname = output_file;
else
- tmpname = make_tempname (argv[i]);
+ tmpname = make_tempname (argv[i], 0);
status = 0;
copy_file (argv[i], tmpname, input_target, output_target);
@@ -2587,7 +2587,7 @@ copy_main (argc, argv)
if (output_filename == (char *) NULL)
{
- char *tmpname = make_tempname (input_filename);
+ char *tmpname = make_tempname (input_filename, 0);
copy_file (input_filename, tmpname, input_target, output_target);
if (status == 0)

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-config_guess,v 1.1.1.1 2002/04/21 21:39:52 fgsch Exp $
--- config.guess.orig Sat Feb 23 21:02:46 2002
+++ config.guess Sat Apr 6 22:09:52 2002
@@ -187,11 +187,17 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
macppc:OpenBSD:*:*)
echo powerpc-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
+ macppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
mvme68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvme88k:OpenBSD:*:*)
echo m88k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvmeppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvmeppc:OpenBSD:*:*)
echo powerpc-unknown-openbsd${UNAME_RELEASE}

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-configure_in,v 1.1.1.1 2002/04/21 21:39:52 fgsch Exp $
--- configure.in.orig Fri Mar 8 16:45:10 2002
+++ configure.in Sat Apr 6 22:09:53 2002
@@ -722,6 +722,7 @@ case "${target}" in
hppa*-*-*elf* | \
hppa*-*-linux-gnu* | \
hppa*-*-lites* | \
+ hppa*-*-openbsd* | \
hppa*64*-*-*)
# Do configure ld/binutils/gas for this case.
;;

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-gas_Makefile_am,v 1.1.1.1 2002/04/21 21:39:52 fgsch Exp $
--- gas/Makefile.am.orig Fri Feb 8 03:32:16 2002
+++ gas/Makefile.am Sat Apr 6 22:09:54 2002
@@ -370,6 +370,7 @@ TARG_ENV_HFILES = \
config/te-macos.h \
config/te-nbsd.h \
config/te-nbsd532.h \
+ config/te-obsd.h \
config/te-pc532mach.h \
config/te-pe.h \
config/te-ppcnw.h \

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-gas_config_tc-i386_c,v 1.1.1.1 2002/04/21 21:39:52 fgsch Exp $
--- gas/config/tc-i386.c.orig Fri Feb 15 11:21:07 2002
+++ gas/config/tc-i386.c Sat Apr 6 22:09:55 2002
@@ -271,6 +271,9 @@ static char stackop_size = '\0';
/* Non-zero to quieten some warnings. */
static int quiet_warnings = 0;
+/* Non-zero if we are generating PIC code. */
+static int i386_pic_code = 0;
+
/* CPU name. */
static const char *cpu_arch_name = NULL;
@@ -4595,6 +4598,9 @@ md_parse_option (c, arg)
/* -k: Ignore for FreeBSD compatibility. */
case 'k':
+#ifdef OBJ_AOUT
+ i386_pic_code = 1;
+#endif
break;
case 's':

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-gas_config_tc-i386_h,v 1.1.1.1 2002/04/21 21:39:56 fgsch Exp $
--- gas/config/tc-i386.h.orig Thu Nov 15 18:28:55 2001
+++ gas/config/tc-i386.h Sat Apr 6 22:09:56 2002
@@ -497,7 +497,11 @@ arch_entry;
/* The name of the global offset table generated by the compiler. Allow
this to be overridden if need be. */
#ifndef GLOBAL_OFFSET_TABLE_NAME
+#ifdef OBJ_ELF
#define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_"
+#else
+#define GLOBAL_OFFSET_TABLE_NAME "__GLOBAL_OFFSET_TABLE_"
+#endif
#endif
#ifdef BFD_ASSEMBLER

View File

@ -0,0 +1,10 @@
$OpenBSD: patch-gas_config_te-obsd_h,v 1.1.1.1 2002/04/21 21:39:52 fgsch Exp $
--- gas/config/te-obsd.h.orig Thu Feb 14 18:37:15 2002
+++ gas/config/te-obsd.h Thu Feb 14 18:38:15 2002
@@ -0,0 +1,6 @@
+#define TE_OpenBSD 1
+
+/* We want [0-9][bf] style local temporary labels. */
+#define LOCAL_LABELS_FB 1
+
+#include "obj-format.h"

View File

@ -0,0 +1,37 @@
$OpenBSD: patch-gas_configure_in,v 1.1.1.1 2002/04/21 21:39:52 fgsch Exp $
--- gas/configure.in.orig Tue Feb 26 07:35:27 2002
+++ gas/configure.in Sat Apr 6 22:09:58 2002
@@ -180,7 +180,7 @@ changequote([,])dnl
alpha*-*-*vms*) fmt=evax ;;
alpha*-*-netware*) fmt=ecoff ;;
- alpha*-*-openbsd*) fmt=ecoff ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
alpha*-*-osf*) fmt=ecoff ;;
alpha*-*-linuxecoff*) fmt=ecoff ;;
alpha*-*-linux-gnu*) fmt=elf em=linux ;;
@@ -224,6 +224,7 @@ changequote([,])dnl
hppa-*-*elf*) fmt=elf em=hppa ;;
hppa-*-lites*) fmt=elf em=hppa ;;
hppa-*-netbsd*) fmt=elf em=nbsd ;;
+ hppa-*-openbsd*) fmt=elf em=hppa ;;
hppa-*-osf*) fmt=som em=hppa ;;
hppa-*-rtems*) fmt=elf em=hppa ;;
hppa-*-hpux11*) case ${cpu} in
@@ -453,7 +454,15 @@ changequote([,])dnl
sparc64) fmt=elf ;;
esac
;;
- sparc-*-openbsd*) fmt=aout em=nbsd ;;
+ sparc-*-openbsd*) em=nbsd bfd_gas=yes
+ case ${cpu} in
+ sparc) case ${os} in
+ *elf*) fmt=elf ;;
+ *) fmt=aout ;;
+ esac ;;
+ sparc64) fmt=elf ;;
+ esac
+ ;;
strongarm-*-coff) fmt=coff ;;
strongarm-*-elf) fmt=elf ;;

View File

@ -0,0 +1,14 @@
--- include/libiberty.h.orig Thu Jun 7 00:21:38 2001
+++ include/libiberty.h Sun Mar 10 02:28:37 2002
@@ -48,6 +48,11 @@ extern "C" {
#include <stdarg.h>
#endif
+/* Make temporary file name */
+
+extern int mkstemp PARAMS ((char *));
+extern char *mkdtemp PARAMS ((char *));
+
/* Build an argument vector from a string. Allocates memory using
malloc. Use freeargv to free the vector. */

View File

@ -0,0 +1,76 @@
$OpenBSD: patch-ld_Makefile_am,v 1.1.1.1 2002/04/21 21:39:56 fgsch Exp $
--- ld/Makefile.am.orig Wed Feb 20 03:56:00 2002
+++ ld/Makefile.am Sat Apr 6 22:09:59 2002
@@ -188,6 +188,7 @@ ALL_EMULATIONS = \
ehppaelf.o \
ehppalinux.o \
ehppanbsd.o \
+ ehppaobsd.o \
ei386aout.o \
ei386beos.o \
ei386bsd.o \
@@ -199,6 +200,7 @@ ALL_EMULATIONS = \
ei386moss.o \
ei386msdos.o \
ei386nbsd.o \
+ ei386obsd.o \
ei386nw.o \
ei386pe.o \
ei386pe_posix.o \
@@ -216,6 +218,7 @@ ALL_EMULATIONS = \
em68klinux.o \
em68klynx.o \
em68knbsd.o \
+ em68kobsd.o \
em68kpsos.o \
em88kbcs.o \
emcorepe.o \
@@ -254,6 +257,7 @@ ALL_EMULATIONS = \
esparclinux.o \
esparclynx.o \
esparcnbsd.o \
+ esparcobsd.o \
est2000.o \
esun3.o \
esun4.o \
@@ -709,6 +713,10 @@ ehppanbsd.c: $(srcdir)/emulparams/hppanb
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/hppaelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} hppanbsd "$(tdir_hppanbsd)"
+ehppaobsd.c: $(srcdir)/emulparams/hppaobsd.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/hppaelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} hppaobsd "$(tdir_hppaobsd)"
ehppa64linux.c: $(srcdir)/emulparams/hppa64linux.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} hppa64linux "$(tdir_hppa64linux)"
@@ -745,6 +753,9 @@ ei386msdos.c: $(srcdir)/emulparams/i386m
ei386nbsd.c: $(srcdir)/emulparams/i386nbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} i386nbsd "$(tdir_i386nbsd)"
+ei386obsd.c: $(srcdir)/emulparams/i386obsd.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} i386obsd "$(tdir_i386obsd)"
ei386nw.c: $(srcdir)/emulparams/i386nw.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
${GENSCRIPTS} i386nw "$(tdir_i386nw)"
@@ -799,6 +810,9 @@ em68klynx.c: $(srcdir)/emulparams/m68kly
em68knbsd.c: $(srcdir)/emulparams/m68knbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68knbsd "$(tdir_m68knbsd)"
+em68kobsd.c: $(srcdir)/emulparams/m68kobsd.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m68kobsd "$(tdir_m68kobsd)"
em68kpsos.c: $(srcdir)/emulparams/m68kpsos.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/psos.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68kpsos "$(tdir_m68kpsos)"
@@ -937,6 +951,9 @@ esparclynx.c: $(srcdir)/emulparams/sparc
esparcnbsd.c: $(srcdir)/emulparams/sparcnbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} sparcnbsd "$(tdir_sparcnbsd)"
+esparcobsd.c: $(srcdir)/emulparams/sparcobsd.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} sparcobsd "$(tdir_sparcobsd)"
est2000.c: $(srcdir)/emulparams/st2000.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/st2000.sc ${GEN_DEPENDS}
${GENSCRIPTS} st2000 "$(tdir_st2000)"

View File

@ -0,0 +1,55 @@
$OpenBSD: patch-ld_configure_tgt,v 1.1.1.1 2002/04/21 21:39:56 fgsch Exp $
--- ld/configure.tgt.orig Wed Feb 20 02:26:22 2002
+++ ld/configure.tgt Sat Apr 6 22:09:59 2002
@@ -72,8 +72,10 @@ sparc*-*-lynxos*) targ_emul=sparclynx ;;
sparc64-*-netbsd*) targ_emul=elf64_sparc
targ_extra_emuls="elf32_sparc"
;;
+sparc64-*-openbsd*) targ_emul=elf64_sparc ;;
sparc*-*-netbsd*elf*) targ_emul=elf32_sparc ;;
sparc*-*-netbsd*) targ_emul=sparcnbsd ;;
+sparc*-*-openbsd*) targ_emul=sparcobsd ;;
sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
targ_emul=elf32_sparc ;;
sparc-*-solaris2*) targ_emul=elf32_sparc
@@ -161,6 +163,7 @@ i[3456]86-*-netbsdelf*) targ_emul=elf_i3
i[3456]86-*-netbsd*) targ_emul=i386nbsd
targ_extra_emuls=elf_i386
;;
+i[3456]86-*-openbsd*) targ_emul=i386obsd ;;
x86_64-*-netbsd*) targ_emul=elf_x86_64
targ_extra_emuls="elf_i386 i386nbsd"
tdir_elf_i386=`echo ${targ_alias} | \
@@ -305,6 +308,7 @@ m68*-*-netbsdelf*) targ_emul=m68kelfnbsd
m68*-*-netbsdaout* | m68*-*-netbsd*)
targ_emul=m68knbsd
targ_extra_emuls="m68kelfnbsd m68k4knbsd" ;;
+m68*-*-openbsd*) targ_emul=m68kobsd ;;
m68*-*-psos*) targ_emul=m68kpsos ;;
m68*-*-rtemscoff*) targ_emul=m68kcoff ;;
m68*-*-rtems*) targ_emul=m68kelf ;;
@@ -314,6 +318,7 @@ hppa*-*-linux-gnu*) targ_emul=hppalinux
hppa*-*-*elf*) targ_emul=hppaelf ;;
hppa*-*-lites*) targ_emul=hppaelf ;;
hppa*-*-netbsd*) targ_emul=hppanbsd ;;
+hppa*-*-openbsd*) targ_emul=hppaobsd ;;
hppa*-*-rtems*) targ_emul=hppaelf ;;
vax-dec-ultrix* | vax-dec-bsd*) targ_emul=vax ;;
mips*-*-pe) targ_emul=mipspe ;
@@ -374,6 +379,7 @@ alpha*-*-osf*) targ_emul=alpha ;;
alpha*-*-gnu*) targ_emul=elf64alpha ;;
alpha*-*-netware*) targ_emul=alpha ;;
alpha*-*-netbsd*) targ_emul=elf64alpha_nbsd ;;
+alpha*-*-openbsd*) targ_emul=elf64alpha ;;
z8k-*-coff) targ_emul=z8002; targ_extra_emuls=z8001 ;;
ns32k-pc532-mach* | ns32k-pc532-ux*) targ_emul=pc532macha ;;
ns32k-pc532-netbsd* | ns32k-pc532-lites*) targ_emul=ns32knbsd ;;
@@ -406,7 +412,7 @@ powerpc*le-*-elf* | powerpc*le-*-eabi* |
targ_extra_emuls="elf32ppcsim" ;;
esac ;;
powerpc*-*-elf* | powerpc*-*-eabi* | powerpc*-*-sysv* \
- | powerpc*-*-netbsd* | powerpc*-*-vxworks*)
+ | powerpc*-*-netbsd* | powerpc*-*-openbsd* | powerpc*-*-vxworks*)
case "${targ}" in
*64*) targ_emul=elf64ppc
targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim" ;;

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-ld_emulparams_hppaobsd_sh,v 1.1.1.1 2002/04/21 21:39:56 fgsch Exp $
--- ld/emulparams/hppaobsd.sh.orig Wed Feb 13 23:19:24 2002
+++ ld/emulparams/hppaobsd.sh Wed Feb 13 23:19:24 2002
@@ -0,0 +1,17 @@
+SCRIPT_NAME=elf
+ELFSIZE=32
+OUTPUT_FORMAT="elf32-hppa"
+TEXT_START_ADDR=0x10000
+TARGET_PAGE_SIZE=0x10000
+MAXPAGESIZE=0x10000
+ARCH=hppa
+MACHINE=hppa1.1 # We use 1.1 specific features.
+NOP=0x08000240
+START="_start"
+OTHER_READONLY_SECTIONS="
+ .PARISC.unwind ${RELOCATING-0} : { *(.PARISC.unwind) }"
+DATA_START_SYMBOLS='PROVIDE ($global$ = .);'
+DATA_PLT=
+GENERATE_SHLIB_SCRIPT=yes
+TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=hppaelf

View File

@ -0,0 +1,10 @@
$OpenBSD: patch-ld_emulparams_i386obsd_sh,v 1.1.1.1 2002/04/21 21:39:56 fgsch Exp $
--- ld/emulparams/i386obsd.sh.orig Wed Feb 13 23:19:25 2002
+++ ld/emulparams/i386obsd.sh Wed Feb 13 23:19:25 2002
@@ -0,0 +1,6 @@
+SCRIPT_NAME=aout
+TEXT_START_ADDR=0x1020
+OUTPUT_FORMAT="a.out-i386-netbsd"
+TARGET_PAGE_SIZE=0x1000
+ARCH=i386
+EXECUTABLE_SYMBOLS='__DYNAMIC = 0;'

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-ld_emulparams_m68kobsd_sh,v 1.1.1.1 2002/04/21 21:39:56 fgsch Exp $
--- ld/emulparams/m68kobsd.sh.orig Wed Feb 13 23:19:25 2002
+++ ld/emulparams/m68kobsd.sh Wed Feb 13 23:19:25 2002
@@ -0,0 +1,7 @@
+SCRIPT_NAME=aout
+TEXT_START_ADDR=0x2020
+NONPAGED_TEXT_START_ADDR=0x2000
+OUTPUT_FORMAT="a.out-m68k-netbsd"
+TARGET_PAGE_SIZE=0x2000
+ARCH=m68k
+EXECUTABLE_SYMBOLS='__DYNAMIC = 0;'

View File

@ -0,0 +1,9 @@
$OpenBSD: patch-ld_emulparams_sparcobsd_sh,v 1.1.1.1 2002/04/21 21:39:56 fgsch Exp $
--- ld/emulparams/sparcobsd.sh.orig Wed Feb 13 23:19:25 2002
+++ ld/emulparams/sparcobsd.sh Wed Feb 13 23:19:25 2002
@@ -0,0 +1,5 @@
+SCRIPT_NAME=aout
+TEXT_START_ADDR=0x1020
+OUTPUT_FORMAT="a.out-sparc-netbsd"
+TARGET_PAGE_SIZE=0x1000
+ARCH=sparc

View File

@ -0,0 +1,187 @@
$OpenBSD: patch-ld_emultempl_elf32_em,v 1.1.1.1 2002/04/21 21:39:56 fgsch Exp $
--- ld/emultempl/elf32.em.orig Tue Feb 5 03:52:17 2002
+++ ld/emultempl/elf32.em Sat Apr 6 22:10:03 2002
@@ -86,6 +86,155 @@ static char *gld${EMULATION_NAME}_get_sc
PARAMS ((int *isfile));
EOF
+case ${target} in
+ *-*-openbsd*)
+ cat >>e${EMULATION_NAME}.c <<EOF
+#include <sys/types.h>
+#include <dirent.h>
+
+/* Search a directory for a .so file. */
+
+static char *
+gld${EMULATION_NAME}_search_dir (dirname, filename)
+ const char *dirname;
+ const char *filename;
+{
+ int force_maj, force_min;
+ const char *dot;
+ unsigned int len;
+ char *alc;
+ char *found;
+ int max_maj, max_min;
+ DIR *dir;
+ struct dirent *entry;
+ unsigned int dirnamelen;
+ char *full_path;
+ int statval;
+ struct stat st;
+
+ force_maj = -1;
+ force_min = -1;
+ dot = strchr (filename, '.');
+ if (dot == NULL)
+ {
+ len = strlen (filename);
+ alc = NULL;
+ }
+ else
+ {
+ force_maj = atoi (dot + 1);
+
+ len = dot - filename;
+ alc = (char *) xmalloc (len + 1);
+ strncpy (alc, filename, len);
+ alc[len] = '\0';
+ filename = alc;
+
+ dot = strchr (dot + 1, '.');
+ if (dot != NULL)
+ force_min = atoi (dot + 1);
+ }
+
+ found = NULL;
+ max_maj = max_min = 0;
+
+ dir = opendir (dirname);
+ if (dir == NULL)
+ return NULL;
+ dirnamelen = strlen (dirname);
+
+ while ((entry = readdir (dir)) != NULL)
+ {
+ const char *s;
+ char *eptr, *eptr1;
+ int found_maj, found_min;
+
+ if (strncmp (entry->d_name, "lib", 3) != 0
+ || strncmp (entry->d_name + 3, filename, len) != 0)
+ continue;
+
+ /* We accept libfoo.so without a version number, even though the
+ native linker does not. This is more convenient for packages
+ which just generate .so files for shared libraries, as on ELF
+ systems. */
+ if (strncmp (entry->d_name + 3 + len, ".so", 3) != 0)
+ continue;
+
+ if (entry->d_name[6 + len] == '\0')
+ ;
+ else if (entry->d_name[6 + len] == '.'
+ && isdigit ((unsigned char) entry->d_name[7 + len]))
+ ;
+ else
+ continue;
+
+ for (s = entry->d_name + 6 + len; *s != '\0'; s++)
+ if (*s != '.' && ! isdigit ((unsigned char) *s))
+ break;
+ if (*s != '\0')
+ continue;
+
+ /* We've found a .so file. Work out the major and minor
+ version numbers. */
+ found_maj = -1;
+ found_min = -1;
+
+ /* do allow libN.so */
+ if (entry->d_name[6 + len] == '.') {
+ found_maj = strtoul (entry->d_name + 7 + len, &eptr, 10);
+
+ /* do not support libN.so. or libN.so.X */
+ if (*eptr != '.' || ((entry->d_name + 3 + len) == eptr))
+ continue;
+
+ found_min = strtoul (eptr+1, &eptr1, 10);
+
+ /* do not support libN.so.X. or libN.so.X.Y.[anything] */
+ if (*eptr1 != '\0' || (eptr+1 == eptr1))
+ continue;
+ }
+
+ if ((force_maj != -1 && force_maj != found_maj)
+ || (force_min != -1 && force_min != found_min))
+ continue;
+
+ /* Make sure the file really exists (ignore broken symlinks). */
+ full_path = xmalloc (dirnamelen + 1 + strlen (entry->d_name) + 1);
+ sprintf (full_path, "%s/%s", dirname, entry->d_name);
+ statval = stat (full_path, &st);
+ free (full_path);
+ if (statval != 0)
+ continue;
+
+ /* We've found a match for the name we are searching for. See
+ if this is the version we should use. */
+ if (found == NULL
+ || (found_maj > max_maj)
+ || (found_maj == max_maj
+ && (found_min > max_min)))
+ {
+ if (found != NULL)
+ free (found);
+ found = (char *) xmalloc (dirnamelen + strlen (entry->d_name) + 2);
+ sprintf (found, "%s/%s", dirname, entry->d_name);
+ max_maj = found_maj;
+ max_min = found_min;
+ }
+ }
+
+ closedir (dir);
+
+ if (alc != NULL)
+ free (alc);
+
+ return found;
+}
+
+EOF
+ ;;
+esac
+cat >>e${EMULATION_NAME}.c <<EOF
+EOF
# Import any needed special functions and/or overrides.
#
@@ -925,7 +1074,15 @@ gld${EMULATION_NAME}_open_dynamic_archiv
return false;
filename = entry->filename;
-
+EOF
+case ${target} in
+ *-*-openbsd*)
+ cat >>e${EMULATION_NAME}.c <<EOF
+ string = gld${EMULATION_NAME}_search_dir(search->name, filename);
+EOF
+ ;;
+ *)
+ cat >>e${EMULATION_NAME}.c <<EOF
/* This allocates a few bytes too many when EXTRA_SHLIB_EXTENSION
is defined, but it does not seem worth the headache to optimize
away those two bytes of space. */
@@ -939,6 +1096,10 @@ gld${EMULATION_NAME}_open_dynamic_archiv
sprintf (string, "%s/lib%s%s.so", search->name, filename, arch);
+EOF
+ ;;
+esac
+cat >>e${EMULATION_NAME}.c <<EOF
#ifdef EXTRA_SHLIB_EXTENSION
/* Try the .so extension first. If that fails build a new filename
using EXTRA_SHLIB_EXTENSION. */

View File

@ -0,0 +1,20 @@
$OpenBSD: patch-ld_genscripts_sh,v 1.1.1.1 2002/04/21 21:39:56 fgsch Exp $
--- ld/genscripts.sh.orig Sun Apr 21 06:01:29 2002
+++ ld/genscripts.sh Sun Apr 21 06:01:47 2002
@@ -52,15 +52,12 @@ if [ "x${LIB_PATH}" = "x" ] ; then
case " $EMULATION_LIBPATH " in
*" ${EMULATION_NAME} "*)
# Native, and default or emulation requesting LIB_PATH.
- LIB_PATH=/lib:/usr/lib
+ LIB_PATH=/usr/lib
if [ -n "${NATIVE_LIB_DIRS}" ]; then
LIB_PATH=${LIB_PATH}:${NATIVE_LIB_DIRS}
fi
if [ "${libdir}" != /usr/lib ]; then
LIB_PATH=${LIB_PATH}:${libdir}
- fi
- if [ "${libdir}" != /usr/local/lib ] ; then
- LIB_PATH=${LIB_PATH}:/usr/local/lib
fi
esac
fi

View File

@ -0,0 +1,26 @@
The GNU Binutils are a collection of binary tools. The main ones are:
* ld - the GNU linker.
* as - the GNU assembler.
But they also include:
* addr2line - Converts addresses into filenames and line numbers.
* ar - A utility for creating, modifying and extracting from
archives.
* c++filt - Filter to demangle encoded C++ symbols.
* gprof - Displays profiling information.
* nlmconv - Converts object code into an NLM.
* nm - Lists symbols from object files.
* objcopy - Copys and translates object files.
* objdump - Displays information from object files.
* ranlib - Generates an index to the contents of an archive.
* readelf - Displays information from any ELF format object file.
* size - Lists the section sizes of an object or archive file.
* strings - Lists printable strings from files.
* strip - Discards symbols.
* windres - A compiler for Windows resource files.
Most of these programs use BFD, the Binary File Descriptor library, to
do low-level manipulation. Many of them also use the opcodes library
to assemble and disassemble machine instructions.
WWW: ${HOMEPAGE}

View File

@ -0,0 +1,25 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2002/04/21 21:39:52 fgsch Exp $
${TARGET_ARCH}-unknown-openbsd${OSREV}/bin/ar
${TARGET_ARCH}-unknown-openbsd${OSREV}/bin/as
${TARGET_ARCH}-unknown-openbsd${OSREV}/bin/gprof
${TARGET_ARCH}-unknown-openbsd${OSREV}/bin/ld
${TARGET_ARCH}-unknown-openbsd${OSREV}/bin/nm
${TARGET_ARCH}-unknown-openbsd${OSREV}/bin/objdump
${TARGET_ARCH}-unknown-openbsd${OSREV}/bin/ranlib
${TARGET_ARCH}-unknown-openbsd${OSREV}/bin/size
${TARGET_ARCH}-unknown-openbsd${OSREV}/bin/strings
${TARGET_ARCH}-unknown-openbsd${OSREV}/bin/strip
${TARGET_ARCH}-unknown-openbsd${OSREV}/man/man1/ar.1
${TARGET_ARCH}-unknown-openbsd${OSREV}/man/man1/as.1
${TARGET_ARCH}-unknown-openbsd${OSREV}/man/man1/gprof.1
${TARGET_ARCH}-unknown-openbsd${OSREV}/man/man1/ld.1
${TARGET_ARCH}-unknown-openbsd${OSREV}/man/man1/nm.1
${TARGET_ARCH}-unknown-openbsd${OSREV}/man/man1/objdump.1
${TARGET_ARCH}-unknown-openbsd${OSREV}/man/man1/ranlib.1
${TARGET_ARCH}-unknown-openbsd${OSREV}/man/man1/size.1
${TARGET_ARCH}-unknown-openbsd${OSREV}/man/man1/strings.1
${TARGET_ARCH}-unknown-openbsd${OSREV}/man/man1/strip.1
@dirrm ${TARGET_ARCH}-unknown-openbsd${OSREV}/man/man1
@dirrm ${TARGET_ARCH}-unknown-openbsd${OSREV}/man
@dirrm ${TARGET_ARCH}-unknown-openbsd${OSREV}/bin
@dirrm ${TARGET_ARCH}-unknown-openbsd${OSREV}