From: niklas Date: Tue, 21 Jan 1997 10:33:02 +0000 (+0000) Subject: Clone NetBSD config for us, add handling of temporary local labels X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2a93a4fa22c4d7d45f2f2bdad249440bda49433e;p=openbsd Clone NetBSD config for us, add handling of temporary local labels --- diff --git a/gnu/usr.bin/binutils/gas/as.c b/gnu/usr.bin/binutils/gas/as.c index d4be4ff7484..c768de6863f 100644 --- a/gnu/usr.bin/binutils/gas/as.c +++ b/gnu/usr.bin/binutils/gas/as.c @@ -519,7 +519,7 @@ the GNU General Public License. This program has absolutely no warranty.\n"); /* -X means treat warnings as errors */ break; -#ifdef TE_NetBSD +#if defined (TE_NetBSD) || defined (TE_OpenBSD) case 'k': flag_pic = 1; break; diff --git a/gnu/usr.bin/binutils/gas/config/obj-aout.c b/gnu/usr.bin/binutils/gas/config/obj-aout.c index 36519d58b54..af780bb6f5c 100644 --- a/gnu/usr.bin/binutils/gas/config/obj-aout.c +++ b/gnu/usr.bin/binutils/gas/config/obj-aout.c @@ -388,7 +388,7 @@ obj_aout_weak (ignore) demand_empty_rest_of_line (); } -/* Handle .type. On NetBSD, this is used to set the n_other field, +/* Handle .type. On {Net,Open}BSD, this is used to set the n_other field, which is then apparently used when doing dynamic linking. Older versions ogas ignored the .type pseudo-op, so we also ignore it if we can't parse it. */ @@ -477,8 +477,8 @@ obj_crawl_symbol_chain (headers) * symbols with no name (stabd's?) * symbols with debug info in their N_TYPE - * symbols marked "forceout" (to force out local `L' symbols in NetBSD - PIC code) + * symbols marked "forceout" (to force out local `L' symbols in Net- + or OpenBSD PIC code) Symbols that don't are: * symbols that are registers @@ -497,11 +497,11 @@ obj_crawl_symbol_chain (headers) || S_IS_EXTERNAL (symbolP) || (S_GET_NAME (symbolP)[0] != '\001' && (flag_keep_locals || !S_LOCAL_NAME (symbolP)) -#ifdef TE_NetBSD +#if defined(TE_NetBSD) || defined(TE_OpenBSD) || (flag_pic && symbolP->sy_forceout) #endif )) -#ifdef TE_NetBSD +#if defined(TE_NetBSD) || defined(TE_OpenBSD) && (!flag_pic || symbolP != GOT_symbol || got_referenced != 0) #endif ) @@ -523,7 +523,7 @@ obj_crawl_symbol_chain (headers) else { if (S_IS_EXTERNAL (symbolP) || !S_IS_DEFINED (symbolP) -#ifdef TE_NetBSD +#if defined(TE_NetBSD) || TE_OpenBSD) && (!flag_pic || symbolP != GOT_symbol || got_referenced != 0) #endif ) diff --git a/gnu/usr.bin/binutils/gas/config/tc-i386.h b/gnu/usr.bin/binutils/gas/config/tc-i386.h index 9f9cd6d2f9f..b347bc1ce1d 100644 --- a/gnu/usr.bin/binutils/gas/config/tc-i386.h +++ b/gnu/usr.bin/binutils/gas/config/tc-i386.h @@ -62,7 +62,7 @@ #define TARGET_BYTES_BIG_ENDIAN 0 #ifdef OBJ_AOUT -#ifdef TE_NetBSD +#if defined(TE_NetBSD) || defined(TE_OpenBSD) #define TARGET_FORMAT "a.out-i386-netbsd" #endif #ifdef TE_386BSD diff --git a/gnu/usr.bin/binutils/gas/config/tc-m68k.h b/gnu/usr.bin/binutils/gas/config/tc-m68k.h index 5ae82056137..e9c03874633 100644 --- a/gnu/usr.bin/binutils/gas/config/tc-m68k.h +++ b/gnu/usr.bin/binutils/gas/config/tc-m68k.h @@ -27,7 +27,7 @@ #ifdef TE_SUN3 #define TARGET_FORMAT "a.out-sunos-big" #endif -#ifdef TE_NetBSD +#if defined(TE_NetBSD) || defined(TE_OpenBSD) #define TARGET_FORMAT "a.out-m68k-netbsd" #endif #ifdef TE_LINUX diff --git a/gnu/usr.bin/binutils/gas/config/tc-sparc.h b/gnu/usr.bin/binutils/gas/config/tc-sparc.h index 33574d88db8..356747b3480 100644 --- a/gnu/usr.bin/binutils/gas/config/tc-sparc.h +++ b/gnu/usr.bin/binutils/gas/config/tc-sparc.h @@ -28,7 +28,7 @@ #define TARGET_BYTES_BIG_ENDIAN 1 #ifdef OBJ_AOUT -#ifdef TE_NetBSD +#if defined(TE_NetBSD) || defined(TE_OpenBSD) #define TARGET_FORMAT "a.out-sparc-netbsd" #else #ifdef TE_SPARCAOUT diff --git a/gnu/usr.bin/binutils/gas/config/te-obsd.h b/gnu/usr.bin/binutils/gas/config/te-obsd.h new file mode 100644 index 00000000000..04205ecfd3e --- /dev/null +++ b/gnu/usr.bin/binutils/gas/config/te-obsd.h @@ -0,0 +1,25 @@ +/* te-obsd.h -- OpenBSD target environment declarations. + Copyright (C) 1996 Free Software Foundation, Inc. + + This file is part of GAS, the GNU Assembler. + + GAS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GAS is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GAS; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define TE_OpenBSD 1 + +/* We want [0-9][bf] style local temporary labels. */ +#define LOCAL_LABELS_FB 1 + +#include "obj-format.h" diff --git a/gnu/usr.bin/binutils/gas/config/te-obsd532.h b/gnu/usr.bin/binutils/gas/config/te-obsd532.h new file mode 100644 index 00000000000..e85134176ae --- /dev/null +++ b/gnu/usr.bin/binutils/gas/config/te-obsd532.h @@ -0,0 +1,21 @@ +/* + * This file is te-obsd532.h + * + * Written by Ian Dall + * + * 19-Jun-94 + * + */ + +#define TARGET_FORMAT "a.out-ns32k-netbsd" + +#define LOCAL_LABELS_FB 1 + +#include "obj-format.h" + +/* Maybe these should be more like TC_NS32532 and TC_NS32381 in case + * of conflicts. NS32381 is used in opcode/ns32k.h and that is also + * used by GDB. Need to check. + */ +#define NS32532 +#define NS32381 diff --git a/gnu/usr.bin/binutils/gas/configure b/gnu/usr.bin/binutils/gas/configure index a374899fe77..7ad68d81fcc 100644 --- a/gnu/usr.bin/binutils/gas/configure +++ b/gnu/usr.bin/binutils/gas/configure @@ -787,7 +787,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=aout em=obsd bfd_gas=yes;; i386-*-linux*aout* | i386-*-linuxoldld) fmt=aout em=linux ;; i386-*-linux*coff*) fmt=coff em=linux targ=i386coff ;; @@ -834,7 +834,7 @@ for this_target in $target $canon_targets ; do m68k-*-lynxos*) fmt=coff targ=m68kcoff em=lynx ;; m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;; - m68k-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;; + m68k-*-openbsd*) fmt=aout em=obsd bfd_gas=yes ;; m68k-apple-aux*) fmt=coff targ=m68kcoff em=aux ;; m68k-*-psos*) fmt=elf em=psos;; @@ -919,7 +919,7 @@ for this_target in $target $canon_targets ; do ns32k-pc532-mach* | ns32k-pc532-ux*) fmt=aout em=pc532mach ;; ns32k-pc532-netbsd* | ns32k-pc532-lites*) fmt=aout em=nbsd532 ;; - ns32k-pc532-openbsd*) fmt=aout em=nbsd532 ;; + ns32k-pc532-openbsd*) fmt=aout em=obsd532 ;; sparc-*-rtems*) fmt=aout ;; sparc-*-sunos4*) fmt=aout em=sun3 ;; @@ -931,7 +931,7 @@ for this_target in $target $canon_targets ; do sparc-*-elf | sparc-*-sysv4* | sparc-*-solaris*) fmt=elf ;; sparc-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;; - sparc-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;; + sparc-*-openbsd*) fmt=aout em=obsd bfd_gas=yes ;; v850-*-*) fmt=elf bfd_gas=yes ;; diff --git a/gnu/usr.bin/binutils/gas/struc-symbol.h b/gnu/usr.bin/binutils/gas/struc-symbol.h index b408201d0c8..5b1a9b43a14 100644 --- a/gnu/usr.bin/binutils/gas/struc-symbol.h +++ b/gnu/usr.bin/binutils/gas/struc-symbol.h @@ -98,7 +98,7 @@ struct symbol typedef struct symbol symbolS; -#ifdef TE_NetBSD +#if defined(TE_NetBSD) || defined(TE_OpenBSD) symbolS *GOT_symbol; /* Pre-defined "__GLOBAL_OFFSET_TABLE" */ int got_referenced; #endif diff --git a/gnu/usr.bin/binutils/gas/write.h b/gnu/usr.bin/binutils/gas/write.h index f4175e2651a..f1ca147d65e 100644 --- a/gnu/usr.bin/binutils/gas/write.h +++ b/gnu/usr.bin/binutils/gas/write.h @@ -90,7 +90,7 @@ struct fix /* NULL or Symbol whose value we subtract. */ symbolS *fx_subsy; -#ifdef TE_NetBSD +#if defined(TE_NetBSD) || defined (TE_OpenBSD) /* NULL or __GLOBAL_OFFSET_TABLE_ . */ symbolS *fx_gotsy; #endif