-# $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 $
+# $OpenBSD: Makefile,v 1.7 1996/04/23 00:15:44 niklas Exp $
+# $NetBSD: Makefile,v 1.35 1996/04/03 21:20:52 chuck Exp $
SUBDIR+= bc cpio cvs dc diff diff3 gawk grep groff
SUBDIR+= gzip rcs sdiff send-pr sort tar texinfo
bzero (zeros_512, 512);
}
-void
+int
main (argc, argv)
int argc;
char *argv[];
.I path\c
\&\|]
.RB "[\|" \-k "\|]"
+.RB "[\|" \-K "\|]"
.RB "[\|" \-L "\|]"
.RB "[\|" \-o
.I objfile\c
.B \-k
Handle position independent code, generated by gcc -fpic.
.TP
+.B \-K
+Handle position independent code, generated by gcc -fPIC.
+This is currently handled identically to `\|\c
+.B \-k\c
+\&\|', on all architectures except the
+.I ns32k\c
+\&\.
+.TP
.B \-L
Keep (in symbol table) local symbols, starting with `\|\c
.B L\c
+/* $OpenBSD: as.c,v 1.2 1996/04/23 00:15:50 niklas Exp $ */
+
/* as.c - GAS main program.
Copyright (C) 1987, 1990, 1991, 1992 Free Software Foundation, Inc.
*
*/
#ifndef lint
-static char rcsid[] = "$Id: as.c,v 1.1.1.1 1995/10/18 08:38:57 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: as.c,v 1.2 1996/04/23 00:15:50 niklas Exp $";
#endif
#include <stdio.h>
break;
}
-#if 00000
- case 'k':
- break;
-#endif
-
case 'L': /* -L means keep L* symbols */
break;
*/
*work_argv = NULL; /* NULL means 'not a file-name' */
}
+#ifdef PIC
+ if (flagseen['K'] || flagseen['k'])
+ picmode = 1;
+#endif
#ifdef DONTDEF
if (gdb_begin(gdb_symbol_file_name) == 0)
flagseen['G'] = 0; /* Don't do any gdbsym stuff. */
+/* $OpenBSD: as.h,v 1.2 1996/04/23 00:15:51 niklas Exp $ */
+
/* as.h - global header file
Copyright (C) 1987, 1990, 1991, 1992 Free Software Foundation, Inc.
along with GAS; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-/*
- * $Id: as.h,v 1.1.1.1 1995/10/18 08:38:57 deraadt Exp $
- */
-
#define GAS 1
/* #include <ansidecl.h> */
#include "host.h"
COMMON int need_pass_2; /* TRUE if we need a second pass. */
+COMMON int picmode; /* TRUE if "-k" or "-K" seen. */
+
typedef struct {
char * poc_name; /* assembler mnemonic, lower case, no '.' */
void (*poc_handler)(); /* Do the work */
-# $Id: Makefile.ns32k,v 1.1.1.1 1995/10/18 08:39:01 deraadt Exp $
+# $OpenBSD: Makefile.ns32k,v 1.2 1996/04/23 00:15:57 niklas Exp $
CFLAGS+= -DPIC -DNS32532 -DNS32381
-SRCS+= tc-ns32k.c atof-ns32k.c
+SRCS+= tc-ns32k.c atof-ieee.c
|| (S_GET_NAME(symbolP)[0] != '\001' &&
(flagseen['L'] || ! S_LOCAL_NAME(symbolP))
#ifdef PIC
- || (flagseen['k'] && symbolP->sy_forceout)
+ || (picmode && symbolP->sy_forceout)
#endif
)
)
#ifdef PIC
- && (!flagseen['k'] ||
+ && (!picmode ||
symbolP != GOT_symbol || got_referenced != 0
)
#endif
* some its terms may not have had their final values
* set. We defer this until `obj_emit_symbols()'
*/
- if (flagseen['k'] &&
+ if (picmode &&
S_GET_TYPE(symbolP) != N_SIZE &&
#ifndef GRACE_PERIOD_EXPIRED
/*Can be enabled when no more old ld's around*/
} else {
if ((S_IS_EXTERNAL(symbolP) || !S_IS_DEFINED(symbolP))
#ifdef PIC
- && (!flagseen['k'] ||
+ && (!picmode ||
symbolP != GOT_symbol || got_referenced != 0
)
#endif
+/* $OpenBSD: obj-aout.h,v 1.2 1996/04/23 00:15:59 niklas Exp $ */
+
/* obj-aout.h, a.out object file format for gas, the assembler.
Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
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: obj-aout.h,v 1.1.1.1 1995/10/18 08:39:02 deraadt Exp $
*/
#define EX_DYNAMIC 0x20
#define EX_PIC 0x10
#undef AOUT_FLAGS
-#define AOUT_FLAGS (flagseen['k'] ? EX_PIC : 0)
+#define AOUT_FLAGS (picmode ? EX_PIC : 0)
#define H_GET_DYNAMIC(h) (H_GET_FLAGS(h) & EX_DYNAMIC)
-/* $OpenBSD: tc-i386.c,v 1.3 1996/03/30 15:29:36 niklas Exp $ */
+/* $OpenBSD: tc-i386.c,v 1.4 1996/04/23 00:16:00 niklas Exp $ */
/* i386.c -- Assemble code for the Intel 80386
Copyright (C) 1989, 1991, 1992 Free Software Foundation.
*/
#ifndef lint
-#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
+static char rcsid[] = "$OpenBSD: tc-i386.c,v 1.4 1996/04/23 00:16:00 niklas Exp $";
#endif
#include "as.h"
* into a temporary buffer...
*/
register char *cp;
- if (flagseen['k'] &&
+ if (picmode &&
(cp = strchr(input_line_pointer,'@'))) {
char tmpbuf[BUFSIZ];
/* XXX - oops, the JMP_TBL relocation info should have percolated through
* here, define a field in frag to this?
*/
- (flagseen['k'] && S_GET_SEGMENT(fragP->fr_symbol) == SEG_UNKNOWN)?
+ (picmode && S_GET_SEGMENT(fragP->fr_symbol) == SEG_UNKNOWN)?
RELOC_JMP_TBL :
#endif
NO_RELOC, (symbolS *)0);
(symbolS *) 0,
fragP->fr_offset, 1,
#ifdef PIC
-/*XXX*/ (flagseen['k'] && S_GET_SEGMENT(fragP->fr_symbol) == SEG_UNKNOWN)?
+/*XXX*/ (picmode && S_GET_SEGMENT(fragP->fr_symbol) == SEG_UNKNOWN)?
RELOC_JMP_TBL :
#endif
NO_RELOC, (symbolS *)0);
switch (**argP) {
#ifdef PIC
case 'k':
+ case 'K':
#if 00
char *tmp = xmalloc(3+1+strlen(operand_special_chars));
strcpy(tmp, operand_special_chars);
case NO_RELOC:
break;
case RELOC_32:
- if (!flagseen['k'] || !S_IS_EXTERNAL(fixP->fx_addsy))
+ if (!picmode || !S_IS_EXTERNAL(fixP->fx_addsy))
break;
r_symbolnum = fixP->fx_addsy->sy_number;
extrn_bit = 1;
-/* $OpenBSD: tc-m68k.c,v 1.2 1996/03/30 15:29:47 niklas Exp $ */
+/* $OpenBSD: tc-m68k.c,v 1.3 1996/04/23 00:16:02 niklas Exp $ */
/* tc-m68k.c All the m68020 specific stuff in one convenient, huge,
slow to compile, easy to find file.
#ifdef PIC
case ' ':
/* this operand is just here to indicate a jump-table branch */
- if (!flagseen['k'])
+ if (!picmode)
losing++;
break;
#endif /* PIC */
#ifdef PIC
/* Use GLOB_DAT for operand references in PIC mode */
- if (flagseen['k'])
+ if (picmode)
reloc_type = RELOC_GLOB_DAT;
else
#endif /* PIC */
__GLOBAL_OFFSET_TABLE_ is turned into a pc-relative
reference to __GLOBAL_OFFSET_TABLE_ - 6,
for the sake of Sun compatibility. */
- if (s[1] == 'l' && flagseen['k'] && gots(opP->con1)) {
+ if (s[1] == 'l' && picmode && gots(opP->con1)) {
offs(opP->con1) -= 6;
add_fix(s[1], opP->con1, 1, NO_RELOC);
} else
#ifdef PIC
/* If we have the optional kludgey 2nd operand,
make this go via the jump table. */
- if (flagseen['k'] && s[2] == ' ') {
+ if (picmode && s[2] == ' ') {
the_ins.opcode[the_ins.numo-1] |= 0xFF;
add_fix('l', opP->con1, 1, RELOC_JMP_TBL);
addword(0);
(symbolS *) 0, fragP->fr_offset, 1,
#ifdef PIC
/* With -k, make all external branches go via the jump table. */
- (flagseen['k']? RELOC_JMP_TBL: NO_RELOC), NULL
+ (picmode ? RELOC_JMP_TBL : NO_RELOC), NULL
#else
NO_RELOC
#endif
case NO_RELOC:
break;
case RELOC_32:
- if (flagseen['k'] && S_IS_EXTERNAL(fixP->fx_addsy)) {
+ if (picmode && S_IS_EXTERNAL(fixP->fx_addsy)) {
r_symbolnum = fixP->fx_addsy->sy_number;
r_flags |= 0x10; /* set extern bit */
}
#ifdef PIC
case 'k':
+ case 'K':
/* Predefine GOT symbol */
GOT_symbol = symbol_find_or_make("__GLOBAL_OFFSET_TABLE_");
break;
-/* $OpenBSD: tc-ns32k.c,v 1.2 1996/03/30 15:29:50 niklas Exp $ */
+/* $OpenBSD: tc-ns32k.c,v 1.3 1996/04/23 00:16:04 niklas Exp $ */
/* ns32k.c -- Assemble on the National Semiconductor 32k series
Copyright (C) 1987, 1992 Free Software Foundation, Inc.
#ifdef PIC
int reloc_mode;
if ((i == 4 || i == 6)
- && flagseen['k']
+ && picmode
&& (iif.iifP[i].addr_mode == 18 || iif.iifP[i].addr_mode == 26))
reloc_mode = RELOC_GLOB_DAT;
else
int prec;
LITTLENUM_TYPE words[MAX_LITTLENUMS];
LITTLENUM_TYPE *wordP;
- extern char *atof_ns32k();
+ extern char *atof_ieee();
char *t;
switch (type) {
*sizeP = 0;
return "Bad call to MD_ATOF()";
}
- t = atof_ns32k(input_line_pointer, type, words);
+ t = atof_ieee(input_line_pointer, type, words);
if (t)
input_line_pointer=t;
*sizeP = prec * sizeof(LITTLENUM_TYPE);
- for (wordP = words +prec; prec--;) {
+ for (wordP = words + prec; prec--;) {
md_number_to_chars(litP, (long)(*--wordP), sizeof(LITTLENUM_TYPE));
litP+=sizeof(LITTLENUM_TYPE);
}
| ((!S_IS_DEFINED(fixP->fx_addsy)
&& fixP->fx_pcrel
&& fixP->fx_addsy != got_symbol
- && flagseen['k']) ? 0x10 : 0)
+ && picmode) ? 0x10 : 0)
#endif
| (fixP->fx_im_disp & 3) << 5;
case NO_RELOC:
break;
case RELOC_32:
- if (flagseen['k'] && S_IS_EXTERNAL(fixP->fx_addsy)) {
+ if (picmode && S_IS_EXTERNAL(fixP->fx_addsy)) {
r_symbolnum = fixP->fx_addsy->sy_number;
r_flags |= 8; /* set extern bit */
}
+/* $OpenBSD: tc-sparc.c,v 1.2 1996/04/23 00:16:06 niklas Exp $ */
+
/* tc-sparc.c -- Assemble for the SPARC
Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef lint
-static char rcsid[] = "$Id: tc-sparc.c,v 1.1.1.1 1995/10/18 08:39:06 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: tc-sparc.c,v 1.2 1996/04/23 00:16:06 niklas Exp $";
#endif
#define cypress 1234
toHex[i] = i + 10 - 'A';
#if 0
- if (flagseen['k'])
+ if (picmode)
GOT_symbol = symbol_find_or_make("__GLOBAL_OFFSET_TABLE_");
#endif
} /* md_begin() */
case 'L': /* 30 bit immediate */
the_insn.reloc =
#ifdef PIC
- flagseen['k']?RELOC_JMP_TBL:
+ picmode ? RELOC_JMP_TBL :
#endif
RELOC_WDISP30;
the_insn.pcrel = 1;
}
}
- if (flagseen['k'] && the_insn.exp.X_add_symbol) {
+ if (picmode && the_insn.exp.X_add_symbol) {
switch (the_insn.reloc) {
case RELOC_LO10:
the_insn.reloc = RELOC_BASE10;
buf[2] = val >> 18;
buf[3] = val >> 10;
} else {
- if (flagseen['k'] && fixP->fx_r_type == RELOC_HI22)
+ if (picmode && fixP->fx_r_type == RELOC_HI22)
as_warn("non-PIC access to %s",
S_GET_NAME(fixP->fx_addsy));
buf[2]=0;
buf[2] |= (val >> 8) & 0x03;
buf[3] = val & 0xff;
} else {
- if (flagseen['k'] && fixP->fx_r_type == RELOC_LO10)
+ if (picmode && fixP->fx_r_type == RELOC_LO10)
as_warn("non-PIC access to %s",
S_GET_NAME(fixP->fx_addsy));
buf[3]=0;
r_extern = 0;
r_index = S_GET_TYPE(fixP->fx_addsy);
#ifdef PIC
- if (flagseen['k']) {
+ if (picmode) {
switch (fixP->fx_r_type) {
case RELOC_BASE10:
case RELOC_BASE13:
architecture_requested = 1;
}
#ifdef PIC
- } else if (**argP == 'k') {
+ } else if (**argP == 'k' || **argP == 'K') {
/* Predefine GOT symbol */
GOT_symbol = symbol_find_or_make("__GLOBAL_OFFSET_TABLE_");
#endif
+/* $OpenBSD: expr.c,v 1.2 1996/04/23 00:15:52 niklas Exp $ */
+
/* expr.c -operands, expressions-
Copyright (C) 1987, 1990, 1991, 1992 Free Software Foundation, Inc.
*/
#ifndef lint
-static char rcsid[] = "$Id: expr.c,v 1.1.1.1 1995/10/18 08:38:57 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: expr.c,v 1.2 1996/04/23 00:15:52 niklas Exp $";
#endif
#include <ctype.h>
/* likewise for the b's. xoxorich. */
if ((c == 'f' || c == 'b' || c == 'B')
&& (!*input_line_pointer ||
- (!strchr("+-.0123456789",*input_line_pointer) &&
+ (!strchr("+-.0123456789iInN",*input_line_pointer) &&
!strchr(EXP_CHARS,*input_line_pointer)))) {
maxdig = radix = 10;
too_many_digits = 11;
+/* $OpenBSD: read.c,v 1.2 1996/04/23 00:15:53 niklas Exp $ */
+
/* read.c - read a source file -
Copyright (C) 1986, 1987, 1990, 1991, 1992 Free Software Foundation, Inc.
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef lint
-static char rcsid[] = "$Id: read.c,v 1.1.1.1 1995/10/18 08:38:59 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: read.c,v 1.2 1996/04/23 00:15:53 niklas Exp $";
#endif
#define MASK_CHAR (0xFF) /* If your chars aren't 8 bits, you will
if (temp > max_alignment) {
as_bad("Alignment too large: %d. assumed.", temp = max_alignment);
}
-
+
/*
* For the sparc, `.align (1<<n)' actually means `.align n'
* so we have to convert it.
as_bad("Alignment not a power of 2");
temp = i;
+
if (*input_line_pointer == ',') {
input_line_pointer ++;
temp_fill = get_absolute_expression();
+/* $OpenBSD: write.c,v 1.2 1996/04/23 00:15:55 niklas Exp $ */
+
/* write.c - emit .o file
Copyright (C) 1986, 1987, 1990, 1991, 1992 Free Software Foundation, Inc.
/* This thing should be set up to do byteordering correctly. But... */
#ifndef lint
-static char rcsid[] = "$Id: write.c,v 1.1.1.1 1995/10/18 08:39:00 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: write.c,v 1.2 1996/04/23 00:15:55 niklas Exp $";
#endif
#include "as.h"
offset = lie->add->sy_frag->fr_address+ S_GET_VALUE(lie->add) + lie->addnum -
(lie->sub->sy_frag->fr_address+ S_GET_VALUE(lie->sub));
if (offset <= -32768 || offset >= 32767) {
+#if 0
if (flagseen['K'])
as_warn(".word %s-%s+%ld didn't fit",
S_GET_NAME(lie->add),
S_GET_NAME(lie->sub),
lie->addnum);
+#endif
lie->added=1;
if (fragP->fr_subtype == 0) {
fragP->fr_subtype++;
}
#endif /* TC_I960 */
#ifdef PIC
- if (flagseen['k'] &&
+ if (picmode &&
S_IS_EXTERNAL(add_symbolP)) {
as_bad("Can't reduce difference of external symbols in PIC code");
}
* Do not fixup refs to global data
* even if defined here.
*/
- if (!flagseen['k'] ||
+ if (!picmode ||
#ifdef TC_NS32K
fixP->fx_pcrel ||
#endif
return s;
}
-void
+int
main (argc, argv)
int argc;
char *argv[];
+/* $OpenBSD: list.c,v 1.2 1996/04/23 00:16:09 niklas Exp $ */
+
/* List a tar archive.
Copyright (C) 1988, 1992, 1993 Free Software Foundation
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef lint
-static char rcsid[] = "$Id: list.c,v 1.1.1.1 1995/10/18 08:41:09 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: list.c,v 1.2 1996/04/23 00:16:09 niklas Exp $";
#endif /* not lint */
/*
st->st_ctime = from_oct (1 + 12, header->header.ctime);
}
- if (0 == strcmp (header->header.magic, TMAGIC))
+ /* just match against "ustar" */
+ if (0 == strncmp (header->header.magic, TMAGIC, 5))
{
/* Unix Standard tar archive */
*stdp = 1;
+/* $OpenBSD: tar.c,v 1.2 1996/04/23 00:16:11 niklas Exp $ */
+
/* Tar -- a tape archiver.
Copyright (C) 1988, 1992, 1993 Free Software Foundation
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef lint
-static char rcsid[] = "$Id: tar.c,v 1.1.1.1 1995/10/18 08:41:10 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: tar.c,v 1.2 1996/04/23 00:16:11 niklas Exp $";
#endif /* not lint */
/*
/*
* Main routine for tar.
*/
-void
+int
main (argc, argv)
int argc;
char **argv;