From 831ba350c5b2c888db8b37331d0bd6c5077d71f0 Mon Sep 17 00:00:00 2001 From: niklas Date: Sat, 30 Mar 1996 15:29:23 +0000 Subject: [PATCH] From NetBSD: merge of 960317 --- gnu/usr.bin/Makefile | 21 +++------ gnu/usr.bin/gas/config/atof-ns32k.c | 11 +++-- gnu/usr.bin/gas/config/tc-a29k.c | 8 ++-- gnu/usr.bin/gas/config/tc-h8300.c | 4 +- gnu/usr.bin/gas/config/tc-i386.c | 10 +++- gnu/usr.bin/gas/config/tc-i860.c | 4 +- gnu/usr.bin/gas/config/tc-i960.c | 6 ++- gnu/usr.bin/gas/config/tc-m68k.c | 4 +- gnu/usr.bin/gas/config/tc-ns32k.c | 4 +- gnu/usr.bin/gas/tc.h | 8 ++-- gnu/usr.bin/gdb/gdb/arch/i386/i386b-nat.c | 6 +-- gnu/usr.bin/gdb/gdb/arch/m68k/m68k-nat.c | 19 ++++---- gnu/usr.bin/ld/ld.c | 57 +++++++++++++++++++---- gnu/usr.bin/ld/ld.h | 9 ++-- gnu/usr.bin/ld/ns32k/md.h | 3 +- gnu/usr.bin/send-pr/send-pr.man | 7 ++- gnu/usr.bin/tar/tar.1 | 9 ++-- 17 files changed, 122 insertions(+), 68 deletions(-) diff --git a/gnu/usr.bin/Makefile b/gnu/usr.bin/Makefile index 55da28aa408..bb5064b7914 100644 --- a/gnu/usr.bin/Makefile +++ b/gnu/usr.bin/Makefile @@ -1,24 +1,15 @@ -# $NetBSD: Makefile,v 1.27 1995/12/07 07:26:32 phil Exp $ +# $OpenBSD: Makefile,v 1.6 1996/03/30 15:29:23 niklas Exp $ +# $NetBSD: Makefile,v 1.34 1996/02/18 12:28:15 pk Exp $ -SUBDIR+= bc cpio cvs dc diff diff3 gawk gcc grep groff +SUBDIR+= bc cpio cvs dc diff diff3 gawk grep groff SUBDIR+= gzip rcs sdiff send-pr sort tar texinfo # some ports don't use the tool chain in /usr/src -.if (${MACHINE_ARCH} != "alpha") && (${MACHINE_ARCH} != "mips") && \ - (${MACHINE_ARCH} != "vax") && (${MACHINE_ARCH} != "ns32k") +.if (${MACHINE_ARCH} != "alpha") && (${MACHINE_ARCH} != "mips") SUBDIR+= gas gdb ld .endif - -# ns32k and vax wants newer gcc -.if (${MACHINE_ARCH} == "ns32k") || (${MACHINE_ARCH} == "vax") -SUBDIR+= gas gcc gdb ld -.endif - -# XXX alpha still needs the /usr/bin/cpp script. -.if (${MACHINE_ARCH} == "alpha") -afterinstall: - install -c -o $(BINOWN) -g $(BINGRP) -m $(BINMODE) \ - $(.CURDIR)/gcc2/cpp/usr.bin.cpp.sh $(DESTDIR)/usr/bin/cpp +.if ${MACHINE_ARCH} != "alpha" +SUBDIR+= gcc .endif .include diff --git a/gnu/usr.bin/gas/config/atof-ns32k.c b/gnu/usr.bin/gas/config/atof-ns32k.c index cadeec08af7..658578406f4 100644 --- a/gnu/usr.bin/gas/config/atof-ns32k.c +++ b/gnu/usr.bin/gas/config/atof-ns32k.c @@ -1,3 +1,5 @@ +/* $OpenBSD: atof-ns32k.c,v 1.2 1996/03/30 15:29:30 niklas Exp $ */ + /* atof_ns32k.c - turn a Flonum into a ns32k floating point number Copyright (C) 1987 Free Software Foundation, Inc. @@ -132,10 +134,11 @@ static void make_invalid_floating_point_number (words) LITTLENUM_TYPE * words; { - words[0]= ((unsigned)-1)>>1; /* Zero the leftmost bit */ - words[1]= -1; - words[2]= -1; - words[3]= -1; + /* Zero the leftmost bit */ + words[0]= (LITTLENUM_TYPE) ((unsigned)-1)>>1; + words[1]= (LITTLENUM_TYPE) -1; + words[2]= (LITTLENUM_TYPE) -1; + words[3]= (LITTLENUM_TYPE) -1; } /***********************************************************************\ diff --git a/gnu/usr.bin/gas/config/tc-a29k.c b/gnu/usr.bin/gas/config/tc-a29k.c index 84ec97a6caa..96ca6e22722 100644 --- a/gnu/usr.bin/gas/config/tc-a29k.c +++ b/gnu/usr.bin/gas/config/tc-a29k.c @@ -1,3 +1,5 @@ +/* $OpenBSD: tc-a29k.c,v 1.2 1996/03/30 15:29:32 niklas Exp $ */ + /* tc-a29k.c -- Assemble for the AMD 29000. Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. @@ -86,12 +88,12 @@ int md_short_jump_size = 4; int md_long_jump_size = 4; #if defined(BFD_HEADERS) #ifdef RELSZ -int md_reloc_size = RELSZ; /* Coff headers */ +const int md_reloc_size = RELSZ; /* Coff headers */ #else -int md_reloc_size = 12; /* something else headers */ +const int md_reloc_size = 12; /* something else headers */ #endif #else -int md_reloc_size = 12; /* Not bfdized*/ +const int md_reloc_size = 12; /* Not bfdized*/ #endif /* This array holds the chars that always start a comment. If the diff --git a/gnu/usr.bin/gas/config/tc-h8300.c b/gnu/usr.bin/gas/config/tc-h8300.c index db4786bbfac..26e42a3e1b5 100644 --- a/gnu/usr.bin/gas/config/tc-h8300.c +++ b/gnu/usr.bin/gas/config/tc-h8300.c @@ -1,3 +1,5 @@ +/* $OpenBSD: tc-h8300.c,v 1.2 1996/03/30 15:29:34 niklas Exp $ */ + /* tc-h8300.c -- Assemble code for the Hitachi H8/300 Copyright (C) 1991, 1992 Free Software Foundation. @@ -47,7 +49,7 @@ const pseudo_typeS md_pseudo_table[] = { { 0,0,0 } }; -int md_reloc_size ; +const int md_reloc_size ; const char EXP_CHARS[] = "eE"; diff --git a/gnu/usr.bin/gas/config/tc-i386.c b/gnu/usr.bin/gas/config/tc-i386.c index 7e16d7a8867..0eef54a9e73 100644 --- a/gnu/usr.bin/gas/config/tc-i386.c +++ b/gnu/usr.bin/gas/config/tc-i386.c @@ -1,3 +1,5 @@ +/* $OpenBSD: tc-i386.c,v 1.3 1996/03/30 15:29:36 niklas Exp $ */ + /* i386.c -- Assemble code for the Intel 80386 Copyright (C) 1989, 1991, 1992 Free Software Foundation. @@ -25,7 +27,11 @@ */ #ifndef lint -static char rcsid[] = "$Id: tc-i386.c,v 1.2 1996/01/29 06:49:46 deraadt Exp $"; +#if 0 +static char rcsid[] = "$Id: tc-i386.c,v 1.3 1996/03/30 15:29:36 niklas Exp $"; +#else +static char rcsid[] = "$OpenBSD: tc-i386.c,v 1.3 1996/03/30 15:29:36 niklas Exp $"; +#endif #endif #include "as.h" @@ -1871,7 +1877,7 @@ register fragS * fragP; int md_short_jump_size = 2; /* size of byte displacement jmp */ int md_long_jump_size = 5; /* size of dword displacement jmp */ -int md_reloc_size = 8; /* Size of relocation record */ +const int md_reloc_size = 8; /* Size of relocation record */ void md_create_short_jump(ptr, from_addr, to_addr, frag, to_symbol) char *ptr; diff --git a/gnu/usr.bin/gas/config/tc-i860.c b/gnu/usr.bin/gas/config/tc-i860.c index a4698f86601..cb7cd179728 100644 --- a/gnu/usr.bin/gas/config/tc-i860.c +++ b/gnu/usr.bin/gas/config/tc-i860.c @@ -1,3 +1,5 @@ +/* $OpenBSD: tc-i860.c,v 1.3 1996/03/30 15:29:39 niklas Exp $ */ + /* tc-i860.c -- Assemble for the I860 Copyright (C) 1989, 1992 Free Software Foundation, Inc. @@ -1157,7 +1159,7 @@ relax_addressT segment_address_in_file; */ -int md_reloc_size = 12; +const int md_reloc_size = 12; void tc_aout_fix_to_chars(where, fixP, segment_address_in_file) char *where; diff --git a/gnu/usr.bin/gas/config/tc-i960.c b/gnu/usr.bin/gas/config/tc-i960.c index 8f9091ce5f0..09e39c13ae3 100644 --- a/gnu/usr.bin/gas/config/tc-i960.c +++ b/gnu/usr.bin/gas/config/tc-i960.c @@ -1,3 +1,5 @@ +/* $OpenBSD: tc-i960.c,v 1.2 1996/03/30 15:29:42 niklas Exp $ */ + /* tc-i960.c - All the i80960-specific stuff Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. @@ -87,9 +89,9 @@ extern struct hash_control *po_hash; extern char *next_object_file_charP; #ifdef OBJ_COFF -int md_reloc_size = sizeof(struct reloc); +const int md_reloc_size = sizeof(struct reloc); #else /* OBJ_COFF */ -int md_reloc_size = sizeof(struct relocation_info); +const int md_reloc_size = sizeof(struct relocation_info); #endif /* OBJ_COFF */ /*************************** diff --git a/gnu/usr.bin/gas/config/tc-m68k.c b/gnu/usr.bin/gas/config/tc-m68k.c index 1aed016c7ee..1a1e56e88ee 100644 --- a/gnu/usr.bin/gas/config/tc-m68k.c +++ b/gnu/usr.bin/gas/config/tc-m68k.c @@ -1,3 +1,5 @@ +/* $OpenBSD: tc-m68k.c,v 1.2 1996/03/30 15:29:47 niklas Exp $ */ + /* tc-m68k.c All the m68020 specific stuff in one convenient, huge, slow to compile, easy to find file. @@ -64,7 +66,7 @@ const char FLT_CHARS[] = "rRsSfFdDxXeEpP"; but nothing is ideal around here. */ -int md_reloc_size = 8; /* Size of relocation record */ +const int md_reloc_size = 8; /* Size of relocation record */ /* Its an arbitrary name: This means I don't approve of it */ /* See flames below */ diff --git a/gnu/usr.bin/gas/config/tc-ns32k.c b/gnu/usr.bin/gas/config/tc-ns32k.c index 5843fe594a2..17390ab402b 100644 --- a/gnu/usr.bin/gas/config/tc-ns32k.c +++ b/gnu/usr.bin/gas/config/tc-ns32k.c @@ -1,3 +1,5 @@ +/* $OpenBSD: tc-ns32k.c,v 1.2 1996/03/30 15:29:50 niklas Exp $ */ + /* ns32k.c -- Assemble on the National Semiconductor 32k series Copyright (C) 1987, 1992 Free Software Foundation, Inc. @@ -1824,7 +1826,7 @@ segT segment; int md_short_jump_size = 3; int md_long_jump_size = 5; -int md_reloc_size = 8; /* Size of relocation record */ +const int md_reloc_size = 8; /* Size of relocation record */ void md_create_short_jump(ptr,from_addr,to_addr,frag,to_symbol) diff --git a/gnu/usr.bin/gas/tc.h b/gnu/usr.bin/gas/tc.h index 4b4687ded4d..771e76a00c4 100644 --- a/gnu/usr.bin/gas/tc.h +++ b/gnu/usr.bin/gas/tc.h @@ -1,3 +1,5 @@ +/* $OpenBSD: tc.h,v 1.2 1996/03/30 15:29:27 niklas Exp $ */ + /* tc.h - target cpu dependent Copyright (C) 1987, 1990, 1991, 1992 Free Software Foundation, Inc. @@ -17,10 +19,6 @@ 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, 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* - * $Id: tc.h,v 1.1.1.1 1995/10/18 08:39:00 deraadt Exp $ - */ - /* In theory (mine, at least!) the machine dependent part of the assembler should only have to include one file. This one. -- JF */ @@ -42,7 +40,7 @@ relax_typeS; extern const relax_typeS md_relax_table[]; /* Define it in MACHINE.c */ -extern int md_reloc_size; /* Size of a relocation record */ +extern const int md_reloc_size; /* Size of a relocation record */ extern void (*md_emit_relocations)(); diff --git a/gnu/usr.bin/gdb/gdb/arch/i386/i386b-nat.c b/gnu/usr.bin/gdb/gdb/arch/i386/i386b-nat.c index 3fde9914787..4b8acab37da 100644 --- a/gnu/usr.bin/gdb/gdb/arch/i386/i386b-nat.c +++ b/gnu/usr.bin/gdb/gdb/arch/i386/i386b-nat.c @@ -1,3 +1,5 @@ +/* $OpenBSD: i386b-nat.c,v 1.5 1996/03/30 15:29:53 niklas Exp $ */ + /* Native-dependent code for BSD Unix running on i386's, for GDB. Copyright 1988, 1989, 1991, 1992 Free Software Foundation, Inc. @@ -16,8 +18,6 @@ GNU General Public License for more details. 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., 675 Mass Ave, Cambridge, MA 02139, USA. - - $Id: i386b-nat.c,v 1.4 1995/12/14 03:42:37 deraadt Exp $ */ #include @@ -343,7 +343,7 @@ fetch_kcore_registers(pcb) * get the register values out of the sys pcb and * store them where `read_register' will find them. */ - if (target_read_memory(pcb->pcb_tss.tss_esp+4, regs, sizeof regs, 0)) + if (target_read_memory(pcb->pcb_tss.tss_esp+4, regs, sizeof regs)) error("Cannot read ebx, esi, and edi."); for (i = 0, regno = 0; regno < 3; regno++) supply_register(regno, (char *)&i); diff --git a/gnu/usr.bin/gdb/gdb/arch/m68k/m68k-nat.c b/gnu/usr.bin/gdb/gdb/arch/m68k/m68k-nat.c index 2d4aa1c6ab5..05fca448f5a 100644 --- a/gnu/usr.bin/gdb/gdb/arch/m68k/m68k-nat.c +++ b/gnu/usr.bin/gdb/gdb/arch/m68k/m68k-nat.c @@ -1,3 +1,5 @@ +/* $OpenBSD: m68k-nat.c,v 1.2 1996/03/30 15:29:56 niklas Exp $ */ + /* Native-dependent code for BSD Unix running on i386's, for GDB. Copyright 1988, 1989, 1991, 1992 Free Software Foundation, Inc. @@ -16,8 +18,6 @@ GNU General Public License for more details. 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., 675 Mass Ave, Cambridge, MA 02139, USA. - - $Id: m68k-nat.c,v 1.1.1.1 1995/10/18 08:40:07 deraadt Exp $ */ #include @@ -85,15 +85,12 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, ignore) core_reg = (struct md_core *)core_reg_sect; - if (which == 0) { - /* Integer registers */ - memcpy(®isters[REGISTER_BYTE (0)], - &core_reg->intreg, sizeof(struct reg)); - } else if (which == 2) { - /* Floating point registers */ - memcpy(®isters[REGISTER_BYTE (FP0_REGNUM)], - &core_reg->freg, sizeof(struct fpreg)); - } + /* Integer registers */ + memcpy(®isters[REGISTER_BYTE (0)], + &core_reg->intreg, sizeof(struct reg)); + /* Floating point registers */ + memcpy(®isters[REGISTER_BYTE (FP0_REGNUM)], + &core_reg->freg, sizeof(struct fpreg)); } /* Get registers from a kernel crash dump. */ diff --git a/gnu/usr.bin/ld/ld.c b/gnu/usr.bin/ld/ld.c index be17bcb6314..92536dca65d 100644 --- a/gnu/usr.bin/ld/ld.c +++ b/gnu/usr.bin/ld/ld.c @@ -1,3 +1,5 @@ +/* $OpenBSD: ld.c,v 1.3 1996/03/30 15:29:59 niklas Exp $ */ + /*- * This code is derived from software copyrighted by the Free Software * Foundation. @@ -8,7 +10,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)ld.c 6.10 (Berkeley) 5/22/91"; +#endif #endif /* not lint */ /* Linker `ld' for GNU @@ -31,10 +35,6 @@ static char sccsid[] = "@(#)ld.c 6.10 (Berkeley) 5/22/91"; /* Written by Richard Stallman with some help from Eric Albert. Set, indirect, and warning symbol features added by Randy Smith. */ -/* - * $Id: ld.c,v 1.2 1995/12/30 08:13:47 deraadt Exp $ - */ - /* Define how to initialize system-dependent header fields. */ #include @@ -1891,7 +1891,14 @@ digest_pass1() } } - if (sp->defined) { + /* + * If this symbol has acquired final definition, we're done. + * Commons must be allowed to bind to shared object data + * definitions. + */ + if (sp->defined && + (sp->common_size == 0 || + relocatable_output || building_shared_object)) { if ((sp->defined & N_TYPE) == N_SETV) /* Allocate zero entry in set vector */ setv_fill_count++; @@ -1924,7 +1931,7 @@ digest_pass1() continue; } - spsave=sp; + spsave=sp; /*XXX*/ again: for (lsp = sp->sorefs; lsp; lsp = lsp->next) { register struct nlist *p = &lsp->nzlist.nlist; @@ -1933,6 +1940,27 @@ digest_pass1() if ((type & N_EXT) && type != (N_UNDF | N_EXT) && (type & N_TYPE) != N_FN) { /* non-common definition */ + if (sp->common_size) { + /* + * This common has an so defn; switch + * to it iff defn is: data, first-class + * and not weak. + */ + if (N_AUX(p) != AUX_OBJECT || + N_ISWEAK(p) || + (lsp->entry->flags & E_SECONDCLASS)) + continue; + + /* + * Change common to so ref. First, + * downgrade common to undefined. + */ + sp->common_size = 0; + sp->defined = 0; + common_defined_global_count--; + undefined_global_sym_count++; + } + sp->def_lsp = lsp; sp->so_defined = type; sp->aux = N_AUX(p); @@ -1952,9 +1980,9 @@ printf("pass1: SO definition for %s, type %x in %s at %#x\n", sp->def_lsp->nzlist.nz_value); #endif sp->def_lsp->entry->flags |= E_SYMBOLS_USED; - if (sp->flags & GS_REFERENCED) + if (sp->flags & GS_REFERENCED) { undefined_global_sym_count--; - else + } else sp->flags |= GS_REFERENCED; if (undefined_global_sym_count < 0) errx(1, "internal error: digest_pass1,2: " @@ -1965,8 +1993,19 @@ printf("pass1: SO definition for %s, type %x in %s at %#x\n", sp = sp->alias; goto again; } + } else if (sp->defined) { + if (sp->common_size == 0) + errx(1, "internal error: digest_pass1,3: " + "%s: not a common: %x", + sp->name, sp->defined); + /* + * Common not bound to shared object data; treat + * it now like other defined symbols were above. + */ + if (!sp->alias) + defined_global_sym_count++; } - sp=spsave; + sp=spsave; /*XXX*/ } END_EACH_SYMBOL; if (setv_fill_count != set_sect_size/sizeof(long)) diff --git a/gnu/usr.bin/ld/ld.h b/gnu/usr.bin/ld/ld.h index b6a27f58bd2..e973f5e75e3 100644 --- a/gnu/usr.bin/ld/ld.h +++ b/gnu/usr.bin/ld/ld.h @@ -1,6 +1,5 @@ -/* - * $Id: ld.h,v 1.1.1.1 1995/10/18 08:40:55 deraadt Exp $ - */ +/* $OpenBSD: ld.h,v 1.2 1996/03/30 15:30:02 niklas Exp $ */ + /*- * This code is derived from software copyrighted by the Free Software * Foundation. @@ -157,8 +156,10 @@ extern int netzmagic; #define RELOC_PIC_TYPE(r) ((r)->r_baserel? \ PIC_TYPE_LARGE:PIC_TYPE_NONE) -#define RELOC_INIT_SEGMENT_RELOC(r) +#endif +#ifndef RELOC_INIT_SEGMENT_RELOC +#define RELOC_INIT_SEGMENT_RELOC(r) #endif #ifndef MAX_GOTOFF diff --git a/gnu/usr.bin/ld/ns32k/md.h b/gnu/usr.bin/ld/ns32k/md.h index ae726abe5fd..3ad30c921c5 100644 --- a/gnu/usr.bin/ld/ns32k/md.h +++ b/gnu/usr.bin/ld/ns32k/md.h @@ -1,4 +1,4 @@ -/* $NetBSD: md.h,v 1.2 1994/11/30 06:20:43 phil Exp $ */ +/* $NetBSD: md.h,v 1.3 1996/02/22 00:20:06 pk Exp $ */ /* * - ns32k dependent definitions @@ -29,6 +29,7 @@ #define RELOC_STATICS_THROUGH_GOT_P(r) (1) #define JMPSLOT_NEEDS_RELOC (0) +#define RELOC_INIT_SEGMENT_RELOC(r) ((r)->r_disp = 2) #define md_got_reloc(r) (0) diff --git a/gnu/usr.bin/send-pr/send-pr.man b/gnu/usr.bin/send-pr/send-pr.man index 3717ebd90c1..c865e8df964 100644 --- a/gnu/usr.bin/send-pr/send-pr.man +++ b/gnu/usr.bin/send-pr/send-pr.man @@ -1,4 +1,7 @@ .\" -*- nroff -*- +.\" +.\" $OpenBSD: send-pr.man,v 1.2 1996/03/30 15:30:07 niklas Exp $ +.\" .\" --------------------------------------------------------------------------- .\" man page for send-pr (by Heinz G. Seidl, hgs@cygnus.com) .\" updated Feb 1993 for GNATS 3.00 by Jeffrey Osier, jeffrey@cygnus.com @@ -50,7 +53,7 @@ send-pr \- send problem report (PR) to a central support site .B \-\-request-id ] [ -.B \-v +.B \-V ] .SH DESCRIPTION .B send-pr @@ -149,7 +152,7 @@ use a of .BR net \|'. .TP -.B \-v +.B \-V Display the .B send-pr version number. diff --git a/gnu/usr.bin/tar/tar.1 b/gnu/usr.bin/tar/tar.1 index 3be7a32ef31..13e97c00c50 100644 --- a/gnu/usr.bin/tar/tar.1 +++ b/gnu/usr.bin/tar/tar.1 @@ -1,10 +1,10 @@ +.\" $OpenBSD: tar.1,v 1.2 1996/03/30 15:30:10 niklas Exp $ +.\" .\" Copyright (c) 1991, 1992, 1993 Free Software Foundation -*- nroff -*- .\" See section COPYING for conditions for redistribution .\" .\" Written by John F. Woods .\" -.\" $Id: tar.1,v 1.1.1.1 1995/10/18 08:41:09 deraadt Exp $ -.\" .Dd 6 August 1994 .Os NetBSD .Dt TAR 1 @@ -173,7 +173,7 @@ Ignore blocks of zeroes in archive (usually means End-Of-File). .It Fl -ignore-failed-read Don't exit with non-zero status on unreadable files. .It Fl k --It Fl -keep-old-files +.It Fl -keep-old-files Keep files which already exist on disk; don't overwrite them from the archive. .It Fl K Ar file .It Fl -starting-file Ar file @@ -212,6 +212,9 @@ Extract all protection information. .It Fl -preserve Has the effect of .Fl p s. +.It Fl P +.It Fl -absolute-paths +Don't strip leading `/'s from file names. .It Fl R .It Fl -record-number Show record number within archive with each message. -- 2.20.1