summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2003-04-17 03:44:31 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2003-04-17 03:44:31 +0000
commit8d448c84f4408180c1dc578461dc115e26727b44 (patch)
tree8b9fe01f4838bdd8c31d48724795ce064e45e01d /gnu/usr.bin/binutils
parent6bb480fd6df5d8e084142751e0b25183459561d6 (diff)
Switch i386 to new binutils, i386 tools now do ELF.
RODATA_* align macros to preserve current behavior on other archs and allow for 1G sep between beginning of exe and beginning of data DARPA funded work.
Diffstat (limited to 'gnu/usr.bin/binutils')
-rw-r--r--gnu/usr.bin/binutils/Makefile.bsd-wrapper4
-rw-r--r--gnu/usr.bin/binutils/bfd/config.bfd4
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-i386.c4
-rw-r--r--gnu/usr.bin/binutils/gas/configure2
-rw-r--r--gnu/usr.bin/binutils/gas/configure.in2
-rw-r--r--gnu/usr.bin/binutils/gdb/config/i386/nm-obsd.h61
-rw-r--r--gnu/usr.bin/binutils/ld/configure.tgt2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32_sparc.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32ppc.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64_sparc.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64alpha.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf_i386.sh6
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/hppaobsd.sh5
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/elf.sc12
14 files changed, 95 insertions, 15 deletions
diff --git a/gnu/usr.bin/binutils/Makefile.bsd-wrapper b/gnu/usr.bin/binutils/Makefile.bsd-wrapper
index b3a1735ae98..ff151a1c49d 100644
--- a/gnu/usr.bin/binutils/Makefile.bsd-wrapper
+++ b/gnu/usr.bin/binutils/Makefile.bsd-wrapper
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile.bsd-wrapper,v 1.50 2003/02/16 15:09:03 espie Exp $
+# $OpenBSD: Makefile.bsd-wrapper,v 1.51 2003/04/17 03:44:21 drahn Exp $
-NEW_BINUTILS=alpha mips powerpc hppa sparc64 sparc
+NEW_BINUTILS=alpha hppa i386 mips powerpc sparc sparc64
SUBDIRS= opcodes bfd
ALL_X11_MODULES=
diff --git a/gnu/usr.bin/binutils/bfd/config.bfd b/gnu/usr.bin/binutils/bfd/config.bfd
index 59cbe66a777..da1d5c1c074 100644
--- a/gnu/usr.bin/binutils/bfd/config.bfd
+++ b/gnu/usr.bin/binutils/bfd/config.bfd
@@ -347,11 +347,11 @@ case "${targ}" in
targ_defvec=bfd_elf32_i386_vec
targ_selvecs=i386coff_vec
;;
- i[3456]86-*-netbsdelf*)
+ i[3456]86-*-netbsdelf* | i386-*-openbsd*)
targ_defvec=bfd_elf32_i386_vec
targ_selvecs=i386netbsd_vec
;;
- i[3456]86-*-netbsdaout* | i[3456]86-*-netbsd* | i[3456]86-*-openbsd*)
+ i[3456]86-*-netbsdaout* | i[3456]86-*-netbsd*)
targ_defvec=i386netbsd_vec
targ_selvecs="bfd_elf32_i386_vec i386bsd_vec"
targ_underscore=yes
diff --git a/gnu/usr.bin/binutils/gas/config/tc-i386.c b/gnu/usr.bin/binutils/gas/config/tc-i386.c
index c23541382b4..65be0f0833d 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-i386.c
+++ b/gnu/usr.bin/binutils/gas/config/tc-i386.c
@@ -157,7 +157,7 @@ const char extra_symbol_chars[] = "*%-(";
/* This array holds the chars that always start a comment. If the
pre-processor is disabled, these aren't very useful. */
-#if defined (TE_I386AIX) || ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) && ! defined (TE_LINUX) && !defined(TE_FreeBSD))
+#if defined (TE_I386AIX) || ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) && ! defined (TE_LINUX) && !defined(TE_FreeBSD) && !defined(__OpenBSD__))
/* Putting '/' here makes it impossible to use the divide operator.
However, we need it for compatibility with SVR4 systems. */
const char comment_chars[] = "#/";
@@ -175,7 +175,7 @@ const char comment_chars[] = "#";
#NO_APP at the beginning of its output.
Also note that comments started like this one will always work if
'/' isn't otherwise defined. */
-#if defined (TE_I386AIX) || ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) && ! defined (TE_LINUX) && !defined(TE_FreeBSD))
+#if defined (TE_I386AIX) || ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) && ! defined (TE_LINUX) && !defined(TE_FreeBSD) && !defined(__OpenBSD__))
const char line_comment_chars[] = "";
#else
const char line_comment_chars[] = "/";
diff --git a/gnu/usr.bin/binutils/gas/configure b/gnu/usr.bin/binutils/gas/configure
index 6f31376108b..919a621f8bd 100644
--- a/gnu/usr.bin/binutils/gas/configure
+++ b/gnu/usr.bin/binutils/gas/configure
@@ -2348,7 +2348,7 @@ for this_target in $target $canon_targets ; do
i386-*-bsd*) fmt=aout em=386bsd ;;
i386-*-netbsd0.8) fmt=aout em=386bsd ;;
i386-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes;;
- i386-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes;;
+ i386-*-openbsd*) fmt=elf em=nbsd;;
i386-*-linux*aout* | i386-*-linux*oldld) fmt=aout em=linux ;;
i386-*-linux*coff*) fmt=coff em=linux ;;
i386-*-linux-gnu*) fmt=elf em=linux bfd_gas=yes ;;
diff --git a/gnu/usr.bin/binutils/gas/configure.in b/gnu/usr.bin/binutils/gas/configure.in
index 03a245b6c6f..0ff9767cf44 100644
--- a/gnu/usr.bin/binutils/gas/configure.in
+++ b/gnu/usr.bin/binutils/gas/configure.in
@@ -243,7 +243,7 @@ changequote([,])dnl
i386-*-bsd*) fmt=aout em=386bsd ;;
i386-*-netbsd0.8) fmt=aout em=386bsd ;;
i386-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes;;
- i386-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes;;
+ i386-*-openbsd*) fmt=elf em=nbsd;;
i386-*-linux*aout* | i386-*-linux*oldld) fmt=aout em=linux ;;
i386-*-linux*coff*) fmt=coff em=linux ;;
i386-*-linux-gnu*) fmt=elf em=linux bfd_gas=yes ;;
diff --git a/gnu/usr.bin/binutils/gdb/config/i386/nm-obsd.h b/gnu/usr.bin/binutils/gdb/config/i386/nm-obsd.h
index 953eedb64ac..9a06dec2572 100644
--- a/gnu/usr.bin/binutils/gdb/config/i386/nm-obsd.h
+++ b/gnu/usr.bin/binutils/gdb/config/i386/nm-obsd.h
@@ -17,8 +17,69 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+#define SVR4_SHARED_LIBS
+
/* Get generic OpenBSD native definitions. */
+
#include "nm-obsd.h"
#define FLOAT_INFO extern i386_float_info (); \
i386_float_info ()
+
+
+#include "solib.h" /* Support for shared libraries. */
+
+/* The Net- and OpenBSD link.h structure definitions have different names
+ than the SunOS version, but the structures are very similar,
+ so we can use solib.c by defining the SunOS names. */
+#define link_object sod
+#define lo_name sod_name
+#define lo_library sod_library
+#define lo_unused sod_reserved
+#define lo_major sod_major
+#define lo_minor sod_minor
+#define lo_next sod_next
+
+#define l_addr som_addr
+#define l_name som_path
+#define l_next som_next
+#define lm_lop som_sod
+#define lm_lob som_sodbase
+#define l_prev som_sodbase
+#define lm_rwt som_write
+#define lm_ld som_dynamic
+#define lm_lpd som_spd
+
+#define link_dynamic_2 section_dispatch_table
+#define ld_loaded sdt_loaded
+#define ld_need sdt_sods
+#define ld_rules sdt_rules
+#define ld_got sdt_got
+#define ld_plt sdt_plt
+#define ld_rel sdt_rel
+#define ld_hash sdt_hash
+#define ld_stab sdt_nzlist
+#define ld_stab_hash sdt_filler2
+#define ld_buckets sdt_buckets
+#define ld_symbols sdt_strings
+#define ld_symb_size sdt_str_sz
+#define ld_text sdt_text_sz
+#define ld_plt_sz sdt_plt_sz
+
+#define rtc_symb rt_symbol
+#define rtc_sp rt_sp
+#define rtc_next rt_next
+
+#define r_debug so_debug
+#define ldd_version dd_version
+#define ldd_in_debugger dd_in_debugger
+#define ldd_sym_loaded dd_sym_loaded
+#define ldd_bp_addr dd_bpt_addr
+#define ldd_bp_inst dd_bpt_shadow
+#define ldd_cp dd_cc
+
+#define link_dynamic _dynamic
+#define ld_version d_version
+#define ldd d_debug
+#define ld_un d_un
+#define ld_2 d_sdt
diff --git a/gnu/usr.bin/binutils/ld/configure.tgt b/gnu/usr.bin/binutils/ld/configure.tgt
index a31fd0e6c8b..1a04f96b28c 100644
--- a/gnu/usr.bin/binutils/ld/configure.tgt
+++ b/gnu/usr.bin/binutils/ld/configure.tgt
@@ -147,7 +147,7 @@ i[3456]86-*-solaris2*) targ_emul=elf_i386 ;;
i[3456]86-*-unixware) targ_emul=elf_i386 ;;
i[3456]86-*-solaris*) targ_emul=elf_i386 ;;
i[3456]86-*-netbsd*) targ_emul=i386nbsd ;;
-i[3456]86-*-openbsd*) targ_emul=i386nbsd ;;
+i[3456]86-*-openbsd*) targ_emul=elf_i386 ;;
i[3456]86-*-netware) targ_emul=i386nw ;;
i[3456]86-*-elf*) targ_emul=elf_i386 ;;
i[3456]86-*-freebsdaout* | i[3456]86-*-freebsd[12].* | i[3456]86-*-freebsd[12])
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32_sparc.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32_sparc.sh
index fc23bb59c5e..eab69a77956 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32_sparc.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32_sparc.sh
@@ -9,6 +9,8 @@ MACHINE=
TEMPLATE_NAME=elf32
DATA_PLT=
PAD_RO=
+RODATA_PADSIZE=${MAXPAGESIZE}
+RODATA_ALIGN=". = ALIGN(${RODATA_PADSIZE}) + (. & (${RODATA_PADSIZE} - 1))"
PAD_PLT=
PAD_GOT=
GENERATE_SHLIB_SCRIPT=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32ppc.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32ppc.sh
index 0fbbf68c7ec..75c9c97bc73 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32ppc.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32ppc.sh
@@ -10,6 +10,8 @@ ARCH=powerpc
MACHINE=
BSS_PLT=
PAD_RO=
+RODATA_PADSIZE=${MAXPAGESIZE}
+RODATA_ALIGN=". = ALIGN(${RODATA_PADSIZE}) + (. & (${RODATA_PADSIZE} - 1))"
PAD_GOT=
PAD_PLT=
EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc.sh
index 091824d5cf5..fe6e88163a5 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc.sh
@@ -7,6 +7,8 @@ ARCH="sparc:v9"
MACHINE=
DATA_PLT=
PAD_RO=
+RODATA_PADSIZE=${MAXPAGESIZE}
+RODATA_ALIGN=". = ALIGN(${RODATA_PADSIZE}) + (. & (${RODATA_PADSIZE} - 1))"
PAD_GOT=
PAD_PLT=
GENERATE_SHLIB_SCRIPT=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64alpha.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64alpha.sh
index 0abe219f84a..9755ca7bf08 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf64alpha.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64alpha.sh
@@ -11,6 +11,8 @@ MACHINE=
GENERATE_SHLIB_SCRIPT=yes
DATA_PLT=
PAD_RO=
+RODATA_PADSIZE=${MAXPAGESIZE}
+RODATA_ALIGN=". = ALIGN(${RODATA_PADSIZE}) + (. & (${RODATA_PADSIZE} - 1))"
PAD_GOT=
PAD_PLT=
NOP=0x47ff041f
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf_i386.sh b/gnu/usr.bin/binutils/ld/emulparams/elf_i386.sh
index aca49bcbaf6..317475babbc 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf_i386.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf_i386.sh
@@ -1,12 +1,16 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-i386"
-TEXT_START_ADDR=0x08048000
+TEXT_START_ADDR=0x00001000
MAXPAGESIZE=0x1000
NONPAGED_TEXT_START_ADDR=0x08048000
ARCH=i386
MACHINE=
NOP=0x9090
PAD_RO=
+RODATA_PADSIZE=0x40000000
+RODATA_ALIGN=". = ALIGN(${RODATA_PADSIZE})"
+RODATA_ALIGN_ADD="${TEXT_START_ADDR}"
+
PAD_GOT=
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/hppaobsd.sh b/gnu/usr.bin/binutils/ld/emulparams/hppaobsd.sh
index 68fbae0292c..9337f576a5c 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/hppaobsd.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/hppaobsd.sh
@@ -11,6 +11,11 @@ ENTRY="__start"
OTHER_READONLY_SECTIONS='.PARISC.unwind : { *(.PARISC.unwind) } '
DATA_START_SYMBOLS='PROVIDE ($global$ = .);'
DATA_PLT=
+PAD_RO=
+RODATA_PADSIZE=${MAXPAGESIZE}
+RODATA_ALIGN=". = ALIGN(${RODATA_PADSIZE}) + (. & (${RODATA_PADSIZE} - 1))"
+PAD_GOT=
+PAD_PLT=
GENERATE_SHLIB_SCRIPT=yes
TEMPLATE_NAME=elf32
EXTRA_EM_FILE=hppaelf
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/elf.sc b/gnu/usr.bin/binutils/ld/scripttempl/elf.sc
index 8d47b4ad17b..72da419b6eb 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/elf.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/elf.sc
@@ -70,11 +70,13 @@ DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }"
RODATA=".rodata ${RELOCATING-0} : { *(.rodata) ${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.gnu.linkonce.r.*)} }"
SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2) ${RELOCATING+*(.sbss2.*)} ${RELOCATING+*(.gnu.linkonce.sb2.*)} }"
SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2) ${RELOCATING+*(.sdata2.*)} ${RELOCATING+*(.gnu.linkonce.s2.*)} }"
-test "$LD_FLAG" = "N" || test "$LD_FLAG" = "Z" || PAD_RO0="${RELOCATING+. = ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1));}"
-test "$LD_FLAG" = "N" || test "$LD_FLAG" = "Z" || PAD_PLT0="${RELOCATING+. = ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1));} .pltpad0 ${RELOCATING-0} : { ${RELOCATING+__plt_start = .;} }"
-test "$LD_FLAG" = "N" || test "$LD_FLAG" = "Z" || PAD_PLT1=".pltpad1 ${RELOCATING-0} : { ${RELOCATING+__plt_end = .;}} ${RELOCATING+. = ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1));}"
-test "$LD_FLAG" = "N" || test "$LD_FLAG" = "Z" || PAD_GOT0="${RELOCATING+. = ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1));} .gotpad0 ${RELOCATING-0} : { ${RELOCATING+__got_start = .;} }"
-test "$LD_FLAG" = "N" || test "$LD_FLAG" = "Z" || PAD_GOT1=".gotpad1 ${RELOCATING-0} : { ${RELOCATING+__got_end = .;}} ${RELOCATING+. = ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1));}"
+RODATA_ALIGN_ADD_VAL="${CREATE_SHLIB-${RODATA_ALIGN_ADD:-0}} ${CREATE_SHLIB+0}"
+test "$LD_FLAG" = "n" || test "$LD_FLAG" = "N" || test "$LD_FLAG" = "Z" || NO_PAD="y"
+test "$NO_PAD" = "y" && PAD_RO0="${RELOCATING+${RODATA_ALIGN} + ${RODATA_ALIGN_ADD_VAL};}"
+test "$NO_PAD" = "y" && PAD_PLT0="${RELOCATING+. = ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1));} .pltpad0 ${RELOCATING-0} : { ${RELOCATING+__plt_start = .;} }"
+test "$NO_PAD" = "y" && PAD_PLT1=".pltpad1 ${RELOCATING-0} : { ${RELOCATING+__plt_end = .;}} ${RELOCATING+. = ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1));}"
+test "$NO_PAD" = "y" && PAD_GOT0="${RELOCATING+. = ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1));} .gotpad0 ${RELOCATING-0} : { ${RELOCATING+__got_start = .;} }"
+test "$NO_PAD" = "y" && PAD_GOT1=".gotpad1 ${RELOCATING-0} : { ${RELOCATING+__got_end = .;}} ${RELOCATING+. = ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1));}"
CTOR=".ctors ${CONSTRUCTING-0} :
{