summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/as/config
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/as/config')
-rw-r--r--gnu/usr.bin/as/config/aout.h24
-rw-r--r--gnu/usr.bin/as/config/atof-ieee.c86
-rw-r--r--gnu/usr.bin/as/config/atof-tahoe.c20
-rw-r--r--gnu/usr.bin/as/config/atof-vax.c82
-rw-r--r--gnu/usr.bin/as/config/coff.h64
-rw-r--r--gnu/usr.bin/as/config/cplus-dem.c90
-rw-r--r--gnu/usr.bin/as/config/ho-ansi.h8
-rw-r--r--gnu/usr.bin/as/config/ho-decstation.h8
-rw-r--r--gnu/usr.bin/as/config/ho-generic.h8
-rw-r--r--gnu/usr.bin/as/config/ho-hpux.h8
-rw-r--r--gnu/usr.bin/as/config/ho-i386.h10
-rw-r--r--gnu/usr.bin/as/config/ho-i386aix.h8
-rw-r--r--gnu/usr.bin/as/config/ho-rs6000.h8
-rw-r--r--gnu/usr.bin/as/config/ho-sunos.h8
-rw-r--r--gnu/usr.bin/as/config/ho-sysv.h8
-rw-r--r--gnu/usr.bin/as/config/ho-vax.h8
-rw-r--r--gnu/usr.bin/as/config/ho-vms.h8
-rw-r--r--gnu/usr.bin/as/config/obj-aout.c102
-rw-r--r--gnu/usr.bin/as/config/obj-aout.h12
-rw-r--r--gnu/usr.bin/as/config/obj-bfd-sunos.c12
-rw-r--r--gnu/usr.bin/as/config/obj-bfd-sunos.h8
-rw-r--r--gnu/usr.bin/as/config/obj-bout.c96
-rw-r--r--gnu/usr.bin/as/config/obj-bout.h12
-rw-r--r--gnu/usr.bin/as/config/obj-coff.c440
-rw-r--r--gnu/usr.bin/as/config/obj-coff.h28
-rw-r--r--gnu/usr.bin/as/config/obj-coffbfd.c846
-rw-r--r--gnu/usr.bin/as/config/obj-coffbfd.h32
-rw-r--r--gnu/usr.bin/as/config/obj-generic.c10
-rw-r--r--gnu/usr.bin/as/config/obj-generic.h12
-rw-r--r--gnu/usr.bin/as/config/obj-ieee.c146
-rw-r--r--gnu/usr.bin/as/config/obj-ieee.h10
-rw-r--r--gnu/usr.bin/as/config/obj-vms.c20
-rw-r--r--gnu/usr.bin/as/config/obj-vms.h2
-rw-r--r--gnu/usr.bin/as/config/tc-a29k.c214
-rw-r--r--gnu/usr.bin/as/config/tc-a29k.h10
-rw-r--r--gnu/usr.bin/as/config/tc-generic.h8
-rw-r--r--gnu/usr.bin/as/config/tc-h8300.c430
-rw-r--r--gnu/usr.bin/as/config/tc-h8300.h10
-rw-r--r--gnu/usr.bin/as/config/tc-i386.c298
-rw-r--r--gnu/usr.bin/as/config/tc-i386.h32
-rw-r--r--gnu/usr.bin/as/config/tc-i860.c238
-rw-r--r--gnu/usr.bin/as/config/tc-i960.c458
-rw-r--r--gnu/usr.bin/as/config/tc-i960.h18
-rw-r--r--gnu/usr.bin/as/config/tc-m68851.h96
-rw-r--r--gnu/usr.bin/as/config/tc-m68k.c634
-rw-r--r--gnu/usr.bin/as/config/tc-m68k.h12
-rw-r--r--gnu/usr.bin/as/config/tc-m68kmote.h16
-rw-r--r--gnu/usr.bin/as/config/tc-m88k.c54
-rw-r--r--gnu/usr.bin/as/config/tc-m88k.h6
-rw-r--r--gnu/usr.bin/as/config/tc-ns32k.c136
-rw-r--r--gnu/usr.bin/as/config/tc-ns32k.h8
-rw-r--r--gnu/usr.bin/as/config/tc-sparc.c318
-rw-r--r--gnu/usr.bin/as/config/tc-sparc.h10
-rw-r--r--gnu/usr.bin/as/config/tc-tahoe.c84
-rw-r--r--gnu/usr.bin/as/config/tc-tahoe.h8
-rw-r--r--gnu/usr.bin/as/config/tc-vax.c282
-rw-r--r--gnu/usr.bin/as/config/te-ic960.h8
-rw-r--r--gnu/usr.bin/as/config/te-sun3.h14
-rw-r--r--gnu/usr.bin/as/config/vax-inst.h8
59 files changed, 2827 insertions, 2827 deletions
diff --git a/gnu/usr.bin/as/config/aout.h b/gnu/usr.bin/as/config/aout.h
index fcc6a0e..9856cb0 100644
--- a/gnu/usr.bin/as/config/aout.h
+++ b/gnu/usr.bin/as/config/aout.h
@@ -1,19 +1,19 @@
/* This file is aout.h
Copyright (C) 1987-1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -56,10 +56,10 @@ enum reloc_type {
RELOC_WDISP19,
RELOC_HHI22,
RELOC_HLO10,
-
+
/* 29K relocation types */
RELOC_JUMPTARG, RELOC_CONST, RELOC_CONSTH,
-
+
RELOC_WDISP14, RELOC_WDISP21,
#endif /* not TC_SPARC */
NO_RELOC,
@@ -186,7 +186,7 @@ enum machine_type {
#ifndef N_SEGSIZE
#define N_SEGSIZE(x) SEGMENT_SIZE
#endif
-
+
/* This complexity is for encapsulated COFF support */
#ifndef _N_HDROFF
#define _N_HDROFF(x) (N_SEGSIZE(x) - sizeof (struct exec))
@@ -223,7 +223,7 @@ enum machine_type {
#ifndef N_TXTADDR
#define N_TXTADDR(x) 0
#endif
-
+
#ifndef N_DATADDR
#define N_DATADDR(x) \
(N_MAGIC(x) == OMAGIC? (N_TXTADDR(x)+(x).a_text) \
@@ -263,7 +263,7 @@ struct nlist {
/* The following type indicates the definition of a symbol as being
an indirect reference to another symbol. The other symbol
appears as an undefined reference, immediately following this symbol.
-
+
Indirection is asymmetrical. The other symbol's value will be used
to satisfy requests for the indirect symbol, but not vice versa.
If the other symbol does not have a definition, libraries will
@@ -279,7 +279,7 @@ struct nlist {
Space is allocated for the set in the text section, and each set
element's value is stored into one word of the space.
The first word of the space is the length of the set (number of elements).
-
+
The address of the set is made into an N_SETV symbol
whose name is the same as the name of the set.
This symbol acts like a N_DATA global symbol
@@ -308,7 +308,7 @@ struct nlist {
/* The following enum and struct were borrowed from SunOS's
/usr/include/sun4/a.out.h and extended to handle
other machines. It is currently used on SPARC and AMD 29000.
-
+
reloc_ext_bytes is how it looks on disk. reloc_info_extended is
how we might process it on a native host. */
@@ -353,7 +353,7 @@ struct reloc_info_extended
# define r_symbolnum r_index
unsigned r_extern:1;
unsigned :2;
- /* RS/6000 compiler does not support enum bitfield
+ /* RS/6000 compiler does not support enum bitfield
enum reloc_type r_type:5; */
enum reloc_type r_type;
long int r_addend;
diff --git a/gnu/usr.bin/as/config/atof-ieee.c b/gnu/usr.bin/as/config/atof-ieee.c
index 18941cc..7040f11 100644
--- a/gnu/usr.bin/as/config/atof-ieee.c
+++ b/gnu/usr.bin/as/config/atof-ieee.c
@@ -1,24 +1,24 @@
/* atof_ieee.c - turn a Flonum into an IEEE floating point number
Copyright (C) 1987, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef lint
-static char rcsid[] = "$Id: atof-ieee.c,v 1.3 1993/10/02 20:58:25 pk Exp $";
+static char rcsid[] = "$Id: atof-ieee.c,v 1.2 1993/11/03 00:53:04 paul Exp $";
#endif
#include "as.h"
@@ -86,14 +86,14 @@ static int
int number_of_bits;
{
int return_value;
-
+
if (!littlenums_left)
return(0);
if (number_of_bits >= bits_left_in_littlenum) {
return_value = mask[bits_left_in_littlenum] & *littlenum_pointer;
number_of_bits -= bits_left_in_littlenum;
return_value <<= number_of_bits;
-
+
if (--littlenums_left) {
bits_left_in_littlenum = LITTLENUM_NUMBER_OF_BITS - number_of_bits;
--littlenum_pointer;
@@ -161,27 +161,27 @@ LITTLENUM_TYPE *words; /* Build the binary here. */
int precision; /* Number of 16-bit words in the format. */
long exponent_bits;
FLONUM_TYPE save_gen_flonum;
-
+
/* We have to save the generic_floating_point_number because it
contains storage allocation about the array of LITTLENUMs
where the value is actually stored. We will allocate our
own array of littlenums below, but have to restore the global
one on exit. */
save_gen_flonum = generic_floating_point_number;
-
+
return_value = str;
generic_floating_point_number.low = bits + MAX_PRECISION;
generic_floating_point_number.high = NULL;
generic_floating_point_number.leader = NULL;
generic_floating_point_number.exponent = NULL;
generic_floating_point_number.sign = '\0';
-
+
/* Use more LittleNums than seems */
/* necessary: the highest flonum may have */
/* 15 leading 0 bits, so could be useless. */
-
+
memset(bits, '\0', sizeof(LITTLENUM_TYPE) * MAX_PRECISION);
-
+
switch (what_kind) {
case 'f':
case 'F':
@@ -190,7 +190,7 @@ LITTLENUM_TYPE *words; /* Build the binary here. */
precision = F_PRECISION;
exponent_bits = 8;
break;
-
+
case 'd':
case 'D':
case 'r':
@@ -198,7 +198,7 @@ LITTLENUM_TYPE *words; /* Build the binary here. */
precision = D_PRECISION;
exponent_bits = 11;
break;
-
+
case 'x':
case 'X':
case 'e':
@@ -206,32 +206,32 @@ LITTLENUM_TYPE *words; /* Build the binary here. */
precision = X_PRECISION;
exponent_bits = 15;
break;
-
+
case 'p':
case 'P':
-
+
precision = P_PRECISION;
exponent_bits = -1;
break;
-
+
default:
make_invalid_floating_point_number(words);
return(NULL);
}
-
+
generic_floating_point_number.high = generic_floating_point_number.low + precision - 1 + GUARD;
-
+
if (atof_generic(&return_value, ".", EXP_CHARS, &generic_floating_point_number)) {
/* as_bad("Error converting floating point number (Exponent overflow?)"); */
make_invalid_floating_point_number(words);
return(NULL);
}
gen_to_words(words, precision, exponent_bits);
-
+
/* Restore the generic_floating_point_number's storage alloc
(and everything else). */
generic_floating_point_number = save_gen_flonum;
-
+
return(return_value);
}
@@ -242,7 +242,7 @@ int precision;
long exponent_bits;
{
int return_value = 0;
-
+
long exponent_1;
long exponent_2;
long exponent_3;
@@ -250,7 +250,7 @@ long exponent_bits;
int exponent_skippage;
LITTLENUM_TYPE word1;
LITTLENUM_TYPE *lp;
-
+
if (generic_floating_point_number.low > generic_floating_point_number.leader) {
/* 0.0e0 seen. */
if (generic_floating_point_number.sign == '+')
@@ -260,7 +260,7 @@ long exponent_bits;
memset(&words[1], '\0', sizeof(LITTLENUM_TYPE) * (precision - 1));
return(return_value);
}
-
+
/* NaN: Do the right thing */
if (generic_floating_point_number.sign == 0) {
if (precision == F_PRECISION) {
@@ -322,23 +322,23 @@ long exponent_bits;
/* Forget leading zeros, forget 1st bit. */
exponent_4 = exponent_3 + ((1 << (exponent_bits - 1)) - 2);
/* Offset exponent. */
-
+
lp = words;
-
+
/* Word 1. Sign, exponent and perhaps high bits. */
word1 = (generic_floating_point_number.sign == '+') ? 0 : (1 << (LITTLENUM_NUMBER_OF_BITS - 1));
-
+
/* Assume 2's complement integers. */
if (exponent_4 < 1 && exponent_4 >= -62) {
int prec_bits;
int num_bits;
-
+
unget_bits(1);
num_bits = -exponent_4;
prec_bits = LITTLENUM_NUMBER_OF_BITS * precision - (exponent_bits + 1 + num_bits);
if (precision == X_PRECISION && exponent_bits == 15)
prec_bits -= LITTLENUM_NUMBER_OF_BITS + 1;
-
+
if (num_bits >= LITTLENUM_NUMBER_OF_BITS - exponent_bits) {
/* Bigger than one littlenum */
num_bits -= (LITTLENUM_NUMBER_OF_BITS - 1) - exponent_bits;
@@ -378,14 +378,14 @@ long exponent_bits;
}
while (lp < words + precision)
*lp++ = next_bits(LITTLENUM_NUMBER_OF_BITS);
-
+
/* Round the mantissa up, but don't change the number */
if (next_bits(1)) {
--lp;
if (prec_bits > LITTLENUM_NUMBER_OF_BITS) {
int n = 0;
int tmp_bits;
-
+
n = 0;
tmp_bits = prec_bits;
while (tmp_bits > LITTLENUM_NUMBER_OF_BITS) {
@@ -396,7 +396,7 @@ long exponent_bits;
}
if (tmp_bits > LITTLENUM_NUMBER_OF_BITS || (lp[n] & mask[tmp_bits]) != mask[tmp_bits]) {
unsigned long carry;
-
+
for (carry = 1; carry && (lp >= words); lp --) {
carry = *lp + carry;
*lp = carry;
@@ -406,13 +406,13 @@ long exponent_bits;
} else if ((*lp & mask[prec_bits]) != mask[prec_bits])
lp++;
}
-
+
return return_value;
} else if (exponent_4 & ~ mask[exponent_bits]) {
/*
* Exponent overflow. Lose immediately.
*/
-
+
/*
* We leave return_value alone: admit we read the
* number, but return a floating exception
@@ -424,20 +424,20 @@ long exponent_bits;
word1 |= (exponent_4 << ((LITTLENUM_NUMBER_OF_BITS - 1) - exponent_bits))
| next_bits ((LITTLENUM_NUMBER_OF_BITS - 1) - exponent_bits);
}
-
+
*lp++ = word1;
-
+
/* X_PRECISION is special: it has 16 bits of zero in the middle,
followed by a 1 bit. */
if (exponent_bits == 15 && precision == X_PRECISION) {
*lp++ = 0;
*lp++ = 1 << (LITTLENUM_NUMBER_OF_BITS) | next_bits(LITTLENUM_NUMBER_OF_BITS - 1);
}
-
+
/* The rest of the words are just mantissa bits. */
while (lp < words + precision)
*lp++ = next_bits(LITTLENUM_NUMBER_OF_BITS);
-
+
if (next_bits(1)) {
unsigned long carry;
/*
@@ -448,7 +448,7 @@ long exponent_bits;
* highest-order bit of the lowest-order word flips.
* Is that clear?
*/
-
+
/* #if (sizeof(carry)) < ((sizeof(bits[0]) * BITS_PER_CHAR) + 2)
Please allow at least 1 more bit in carry than is in a LITTLENUM.
We need that extra bit to hold a carry during a LITTLENUM carry
@@ -484,7 +484,7 @@ long x;
{
char buf[20];
char *bufp;
-
+
sprintf(buf,"%ld",x);
bufp = &buf[0];
if (atof_generic(&bufp, ".", EXP_CHARS, &generic_floating_point_number))
@@ -501,7 +501,7 @@ FLONUM_TYPE *gen;
double dv;
float fv;
static char sbuf[40];
-
+
if (gen) {
f = generic_floating_point_number;
generic_floating_point_number = *gen;
@@ -512,11 +512,11 @@ FLONUM_TYPE *gen;
gen_to_words(&arr[0], 2, 8);
memcpy(&fv, &arr[0], sizeof(float));
sprintf(sbuf + strlen(sbuf), "%x %x %.12g\n", arr[0], arr[1], fv);
-
+
if (gen) {
generic_floating_point_number = f;
}
-
+
return(sbuf);
}
#endif
diff --git a/gnu/usr.bin/as/config/atof-tahoe.c b/gnu/usr.bin/as/config/atof-tahoe.c
index 6425e93..64d00ea 100644
--- a/gnu/usr.bin/as/config/atof-tahoe.c
+++ b/gnu/usr.bin/as/config/atof-tahoe.c
@@ -253,7 +253,7 @@ flonum_gen2tahoe (format_letter, f, words)
* So we need: number of bits of exponent, number of bits of
* mantissa.
*/
-
+
bits_left_in_littlenum = LITTLENUM_NUMBER_OF_BITS;
littlenum_pointer = f -> leader;
littlenum_end = f->low;
@@ -271,15 +271,15 @@ flonum_gen2tahoe (format_letter, f, words)
/* Forget leading zeros, forget 1st bit. */
exponent_4 = exponent_3 + (1 << (exponent_bits - 1));
/* Offset exponent. */
-
+
if (exponent_4 & ~ mask [exponent_bits])
{
/*
* Exponent overflow. Lose immediately.
*/
-
+
make_invalid_floating_point_number (words);
-
+
/*
* We leave return_value alone: admit we read the
* number, but return a floating exception
@@ -289,20 +289,20 @@ flonum_gen2tahoe (format_letter, f, words)
else
{
lp = words;
-
+
/* Word 1. Sign, exponent and perhaps high bits. */
/* Assume 2's complement integers. */
word1 = ((exponent_4 & mask [exponent_bits]) << (15 - exponent_bits))
| ((f -> sign == '+') ? 0 : 0x8000)
| next_bits (15 - exponent_bits);
* lp ++ = word1;
-
+
/* The rest of the words are just mantissa bits. */
for (; lp < words + precision; lp++)
{
* lp = next_bits (LITTLENUM_NUMBER_OF_BITS);
}
-
+
if (next_bits (1))
{
/*
@@ -313,9 +313,9 @@ flonum_gen2tahoe (format_letter, f, words)
* highest-order bit of the lowest-order word flips.
* Is that clear?
*/
-
+
unsigned long int carry;
-
+
/*
#if (sizeof(carry)) < ((sizeof(bits[0]) * BITS_PER_CHAR) + 2)
Please allow at least 1 more bit in carry than is in a LITTLENUM.
@@ -333,7 +333,7 @@ flonum_gen2tahoe (format_letter, f, words)
* lp = carry;
carry >>= LITTLENUM_NUMBER_OF_BITS;
}
-
+
if ( (word1 ^ *words) & (1 << (LITTLENUM_NUMBER_OF_BITS - 1)) )
{
make_invalid_floating_point_number (words);
diff --git a/gnu/usr.bin/as/config/atof-vax.c b/gnu/usr.bin/as/config/atof-vax.c
index 8a69502..56ad35a 100644
--- a/gnu/usr.bin/as/config/atof-vax.c
+++ b/gnu/usr.bin/as/config/atof-vax.c
@@ -1,18 +1,18 @@
/* atof_vax.c - turn a Flonum into a VAX floating point number
Copyright (C) 1987, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -45,7 +45,7 @@ int /* Number of chars in flonum type 'letter'. */
char letter;
{
int return_value;
-
+
/*
* Permitting uppercase letters is probably a bad idea.
* Please use only lower-cased letters in case the upper-cased
@@ -57,19 +57,19 @@ char letter;
case 'F':
return_value = 4;
break;
-
+
case 'd':
case 'D':
case 'g':
case 'G':
return_value = 8;
break;
-
+
case 'h':
case 'H':
return_value = 16;
break;
-
+
default:
return_value = 0;
break;
@@ -124,7 +124,7 @@ static int
int number_of_bits;
{
int return_value;
-
+
if (littlenum_pointer<littlenum_end)
return 0;
if (number_of_bits >= bits_left_in_littlenum)
@@ -159,7 +159,7 @@ int * precisionP; /* Number of 16-bit words in the float. */
long * exponent_bitsP; /* Number of exponent bits. */
{
int retval; /* 0: OK. */
-
+
retval = 0;
switch (letter)
{
@@ -167,22 +167,22 @@ long * exponent_bitsP; /* Number of exponent bits. */
* precisionP = F_PRECISION;
* exponent_bitsP = 8;
break;
-
+
case 'd':
* precisionP = D_PRECISION;
* exponent_bitsP = 8;
break;
-
+
case 'g':
* precisionP = G_PRECISION;
* exponent_bitsP = 11;
break;
-
+
case 'h':
* precisionP = H_PRECISION;
* exponent_bitsP = 15;
break;
-
+
default:
retval = 69;
break;
@@ -213,14 +213,14 @@ LITTLENUM_TYPE *words; /* Build the binary here. */
char *return_value;
int precision; /* Number of 16-bit words in the format. */
long exponent_bits;
-
+
return_value = str;
f.low = bits + MAX_PRECISION;
f.high = NULL;
f.leader = NULL;
f.exponent = NULL;
f.sign = '\0';
-
+
if (what_kind_of_float (what_kind, & precision, & exponent_bits)) {
return_value = NULL; /* We lost. */
make_invalid_floating_point_number (words);
@@ -228,12 +228,12 @@ LITTLENUM_TYPE *words; /* Build the binary here. */
if (return_value) {
memset(bits, '\0', sizeof(LITTLENUM_TYPE) * MAX_PRECISION);
-
+
/* Use more LittleNums than seems */
/* necessary: the highest flonum may have */
/* 15 leading 0 bits, so could be useless. */
f.high = f.low + precision - 1 + GUARD;
-
+
if (atof_generic (& return_value, ".", "eE", & f)) {
make_invalid_floating_point_number (words);
return_value = NULL; /* we lost */
@@ -261,9 +261,9 @@ LITTLENUM_TYPE *words; /* Deliver answer here. */
int precision;
long exponent_bits;
int return_value; /* 0 == OK. */
-
+
return_value = what_kind_of_float(format_letter, &precision, &exponent_bits);
-
+
if (return_value != 0) {
make_invalid_floating_point_number (words);
} else {
@@ -277,7 +277,7 @@ memset(words, '\0', sizeof(LITTLENUM_TYPE) * precision);
long exponent_4;
int exponent_skippage;
LITTLENUM_TYPE word1;
-
+
/* JF: Deal with new Nan, +Inf and -Inf codes */
if (f->sign != '-' && f->sign != '+') {
make_invalid_floating_point_number(words);
@@ -298,7 +298,7 @@ memset(words, '\0', sizeof(LITTLENUM_TYPE) * precision);
* So we need: number of bits of exponent, number of bits of
* mantissa.
*/
-
+
#ifdef NEVER /******* This zeroing seems redundant - Dean 3may86 **********/
/*
* No matter how few bits we got back from the atof()
@@ -314,7 +314,7 @@ memset(words, '\0', sizeof(LITTLENUM_TYPE) * precision);
}
}
#endif
-
+
bits_left_in_littlenum = LITTLENUM_NUMBER_OF_BITS;
littlenum_pointer = f->leader;
littlenum_end = f->low;
@@ -322,7 +322,7 @@ memset(words, '\0', sizeof(LITTLENUM_TYPE) * precision);
for (exponent_skippage = 0;
! next_bits(1);
exponent_skippage ++) ;;
-
+
exponent_1 = f->exponent + f->leader + 1 - f->low;
/* Radix LITTLENUM_RADIX, point just higher than f->leader. */
exponent_2 = exponent_1 * LITTLENUM_NUMBER_OF_BITS;
@@ -331,14 +331,14 @@ memset(words, '\0', sizeof(LITTLENUM_TYPE) * precision);
/* Forget leading zeros, forget 1st bit. */
exponent_4 = exponent_3 + (1 << (exponent_bits - 1));
/* Offset exponent. */
-
+
if (exponent_4 & ~mask[exponent_bits]) {
/*
* Exponent overflow. Lose immediately.
*/
-
+
make_invalid_floating_point_number (words);
-
+
/*
* We leave return_value alone: admit we read the
* number, but return a floating exception
@@ -346,19 +346,19 @@ memset(words, '\0', sizeof(LITTLENUM_TYPE) * precision);
*/
} else {
lp = words;
-
+
/* Word 1. Sign, exponent and perhaps high bits. */
/* Assume 2's complement integers. */
word1 = (((exponent_4 &mask[exponent_bits]) << (15 - exponent_bits))
| ((f->sign == '+') ? 0 : 0x8000)
| next_bits(15 - exponent_bits));
*lp++ = word1;
-
+
/* The rest of the words are just mantissa bits. */
for (; lp < words + precision; lp++) {
*lp = next_bits(LITTLENUM_NUMBER_OF_BITS);
}
-
+
if (next_bits (1)) {
/*
* Since the NEXT bit is a 1, round UP the mantissa.
@@ -368,9 +368,9 @@ memset(words, '\0', sizeof(LITTLENUM_TYPE) * precision);
* highest-order bit of the lowest-order word flips.
* Is that clear?
*/
-
+
unsigned long carry;
-
+
/*
#if (sizeof(carry)) < ((sizeof(bits[0]) * BITS_PER_CHAR) + 2)
Please allow at least 1 more bit in carry than is in a LITTLENUM.
@@ -387,7 +387,7 @@ memset(words, '\0', sizeof(LITTLENUM_TYPE) * precision);
*lp = carry;
carry >>= LITTLENUM_NUMBER_OF_BITS;
}
-
+
if ((word1 ^ *words) & (1 << (LITTLENUM_NUMBER_OF_BITS - 1))) {
make_invalid_floating_point_number(words);
/*
@@ -435,36 +435,36 @@ int * sizeP;
register char kind_of_float;
register int number_of_chars;
register LITTLENUM_TYPE * littlenum_pointer;
-
+
switch (what_statement_type)
{
case 'F': /* .float */
case 'f': /* .ffloat */
kind_of_float = 'f';
break;
-
+
case 'D': /* .double */
case 'd': /* .dfloat */
kind_of_float = 'd';
break;
-
+
case 'g': /* .gfloat */
kind_of_float = 'g';
break;
-
+
case 'h': /* .hfloat */
kind_of_float = 'h';
break;
-
+
default:
kind_of_float = 0;
break;
};
-
+
if (kind_of_float)
{
register LITTLENUM_TYPE * limit;
-
+
input_line_pointer = atof_vax (input_line_pointer,
kind_of_float,
words);
@@ -489,7 +489,7 @@ int * sizeP;
{
number_of_chars = 0;
};
-
+
* sizeP = number_of_chars;
return (kind_of_float ? "" : "Bad call to md_atof()");
} /* md_atof() */
diff --git a/gnu/usr.bin/as/config/coff.h b/gnu/usr.bin/as/config/coff.h
index bcbb343..a54f35b 100644
--- a/gnu/usr.bin/as/config/coff.h
+++ b/gnu/usr.bin/as/config/coff.h
@@ -1,18 +1,18 @@
/* coff.h
Copyright (C) 1987, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -69,7 +69,7 @@ struct filehdr {
/*
* Intel 80960 (I960) processor flags.
- * F_I960TYPE == mask for processor type field.
+ * F_I960TYPE == mask for processor type field.
*/
#define F_I960TYPE (0xf000)
@@ -105,7 +105,7 @@ struct filehdr {
# define I386MAGIC 0x14c
# define I386BADMAG(x) (((x).f_magic != I386MAGIC))
#endif /* not TE_I386AIX */
-
+
#define FILHDR struct filehdr
#define FILHSZ sizeof(FILHDR)
@@ -137,7 +137,7 @@ typedef struct {
#define PAGEMAGIC3 (0415) /* (?) like ZMAGIC, but address zero mapped. */
#define A_MAGIC5 (0437) /* (?) "system overlay, separated I&D" */
/* intended for non-unix cross development */
-#define SASMAGIC (010000) /* Single Address Space */
+#define SASMAGIC (010000) /* Single Address Space */
#define MASMAGIC (020000) /* (?) "Multiple (separate I & D) Address Spaces" */
typedef struct aouthdr {
@@ -242,7 +242,7 @@ struct scnhdr {
unsigned short s_nreloc; /* number of relocation entries */
unsigned short s_nlnno; /* number of line number entries */
long s_flags; /* flags */
-
+
#ifdef TC_I960
unsigned long s_align; /* section alignment */
#endif /* TC_I960 */
@@ -324,7 +324,7 @@ struct lineno {
};
#define LINENO struct lineno
-#define LINESZ sizeof(LINENO)
+#define LINESZ sizeof(LINENO)
/********************** SYMBOLS **********************/
@@ -344,23 +344,23 @@ struct syment {
} _n;
long n_value; /* value of symbol */
short n_scnum; /* section number */
-
+
#ifdef TC_I960
/* This isn't yet used on the i960. In some formats this
is two bytes of padding. In others, it is missing entirely. */
unsigned short n_flags; /* copy of flags from filhdr */
#endif /* TC_I960 */
-
+
#ifdef TC_A29K
unsigned short n_type; /* type and derived type */
#else /* TC_A29K */
/* at least i960 uses long */
unsigned long n_type; /* type and derived type */
#endif /* TC_A29K */
-
+
char n_sclass; /* storage class */
char n_numaux; /* number of aux. entries */
-
+
#ifndef TC_A29K
char pad2[2]; /* force alignment */
#endif /* TC_A29K */
@@ -373,12 +373,12 @@ struct syment {
#define n_ptr _n._n_nptr[1]
#define n_zeroes _n._n_n._n_zeroes
#define n_offset _n._n_n._n_offset
-
+
/*
* Relocatable symbols have number of the section in which they are defined,
* or one of the following:
*/
-
+
#define N_SCNUM ((short) 1-65535) /* section num where symbol defined */
#define N_UNDEF ((short)0) /* undefined symbol */
#define N_ABS ((short)-1) /* value of symbol is absolute */
@@ -463,7 +463,7 @@ union auxent {
} x_fcnary;
unsigned short x_tvndx; /* tv index */
} x_sym;
-
+
/* This was just a struct x_file with x_fname only in a29k. xoxorich. */
union {
char x_fname[FILNMLEN];
@@ -472,21 +472,21 @@ union auxent {
long x_offset;
} x_n;
} x_file;
-
+
struct {
long x_scnlen; /* section length */
unsigned short x_nreloc; /* # relocation entries */
unsigned short x_nlinno; /* # line numbers */
} x_scn;
-
+
struct {
long x_tvfill; /* tv fill value */
unsigned short x_tvlen; /* length of .tv */
-
+
/* This field was typo'd x_tvrna on a29k. xoxorich. */
unsigned short x_tvran[2]; /* tv range */
} x_tv; /* info about .tv section (in auxent of symbol .tv)) */
-
+
#ifdef TC_I960
/******************************************
* I960-specific *2nd* aux. entry formats
@@ -496,16 +496,16 @@ union auxent {
#define x_stdindx x_stindx
long x_stindx; /* sys. table entry */
} x_sc; /* system call entry */
-
+
struct {
unsigned long x_balntry; /* BAL entry point */
} x_bal; /* BAL-callable function */
-
+
struct {
unsigned long x_timestamp; /* time stamp */
char x_idstring[20]; /* producer identity string */
} x_ident; /* Producer ident info */
-
+
char a[sizeof(struct syment)]; /* force auxent/syment sizes to match */
#endif /* TC_I960 */
};
@@ -592,7 +592,7 @@ struct reloc {
/*
* X86 generic
* 8-bit offset reference in 8-bits
- * 8-bit offset reference in 16-bits
+ * 8-bit offset reference in 16-bits
* 12-bit segment reference
* auxiliary relocation entry
*/
@@ -625,7 +625,7 @@ struct reloc {
#define R_IND24 015
#define R_IND32 016
-/*
+/*
* XL generics
* 10-bit direct reference
* 10-bit "relative" reference
@@ -646,7 +646,7 @@ struct reloc {
* 32-bit direct reference with bytes swapped
*/
#define R_DIR32S 012
-
+
#endif /* TC_I386 */
#if defined(TE_I386AIX)
@@ -710,7 +710,7 @@ typedef struct ksigmask {
struct corehdr {
char cd_magic[4]; /* COR_MAGIC = "core" */
-
+
/* general information about the dump itself */
struct dumpseg { /* table of contents for dump */
long cs_type; /* seg. type; see below */
@@ -718,7 +718,7 @@ struct corehdr {
long cs_offset; /* offset (in dump) of segment */
long cs_address; /* address segment had in mem */
} cd_segs[MAX_CORE_SEGS];
-
+
/* general information about the process */
char cd_comm[CD_NAMELEN]; /* command being run */
char cd_mach[CD_NAMELEN]; /* type of machine it ran on */
@@ -728,24 +728,24 @@ struct corehdr {
char cd_dptrsize; /* sizeof(char *) */
char cd_tptrsize; /* sizeof(int (*)()) */
char cd_unused;
-
+
/* user-mode program state */
long cd_regs[NUM_REGS]; /* user-mode general registers */
struct env387 cd_fpregs; /* user-mode floating-point state */
-
+
/* kernel-mode program state */
int (*cd_sig[NSIG])(); /* disposition of signals */
ksigmask_t cd_sigmask; /* signals to be blocked */
ksigmask_t cd_sigpend; /* signals currently pending */
long cd_cursig; /* signal that caused the dump */
-
+
long cd_pid; /* process ID of the corpse */
long cd_ppid; /* parent process ID of corpse */
short cd_uid; /* process effective user ID */
short cd_ruid; /* process real user ID */
short cd_gid; /* process effective group ID */
short cd_rgid; /* process real group ID */
-
+
uinfo_t cd_uinfo; /* buffer of user information */
char cd_locname[32]; /* name of /local */
char cd_uvers[CD_NAMELEN]; /* user version string */
diff --git a/gnu/usr.bin/as/config/cplus-dem.c b/gnu/usr.bin/as/config/cplus-dem.c
index e3819bc..79d3279 100644
--- a/gnu/usr.bin/as/config/cplus-dem.c
+++ b/gnu/usr.bin/as/config/cplus-dem.c
@@ -1,17 +1,17 @@
-/* Demangler for GNU C++
+/* Demangler for GNU C++
Copyright (C) 1989, 1992 Free Software Foundation, Inc.
written by James Clark (jjc@jclark.uucp)
-
+
This program 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.
-
+
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -20,39 +20,39 @@
require changes for any other version. */
/* This file exports one function
-
+
char *cplus_demangle (const char *name)
-
+
If `name' is a mangled function name produced by g++, then
a pointer to a malloced string giving a C++ representation
of the name will be returned; otherwise NULL will be returned.
It is the caller's responsibility to free the string which
is returned.
-
+
For example,
-
+
cplus_demangle ("_foo__1Ai")
-
+
returns
-
+
"A::foo(int)"
-
+
This file imports xmalloc and xrealloc, which are like malloc and
realloc except that they generate a fatal error if there is no
available memory. */
/* #define nounderscore 1 /* define this is names don't start with _ */
-
+
#include <stdio.h>
#include <string.h>
#include <ctype.h>
-
+
#if !defined(sequent) && !defined(NeXT)
#include <memory.h>
#else
-#define memcpy(s1, s2, n) strncpy(s1, s2, n)
+#define memcpy(s1, s2, n) strncpy(s1, s2, n)
#define memcmp(s1, s2, n) strncmp(s1, s2, n)
-#define strchr(s, c) index(s, c)
+#define strchr(s, c) index(s, c)
#endif
#if __STDC__ != 1
@@ -170,7 +170,7 @@ const char *type;
int const_flag = 0;
int i;
const char *p;
-
+
if (type == NULL || *type == '\0')
return NULL;
#ifndef nounderscore
@@ -205,9 +205,9 @@ const char *type;
}
return NULL;
}
-
+
string_init (&decl);
-
+
if (p == type)
{
if (!isdigit (p[2]))
@@ -223,7 +223,7 @@ const char *type;
munge_function_name (&decl);
}
p += 2;
-
+
switch (*p)
{
case 'C':
@@ -280,7 +280,7 @@ const char *type;
success = do_args (&p, &decl);
break;
}
-
+
for (i = 0; i < ntypes; i++)
if (typevec[i] != NULL)
free (typevec[i]);
@@ -291,7 +291,7 @@ const char *type;
typevec = NULL;
typevec_size = 0;
}
-
+
if (success)
{
string_appendn (&decl, "", 1);
@@ -318,12 +318,12 @@ int *count;
{
const char *p = *type;
int n = *count;
- do
+ do
{
n *= 10;
n += *p - '0';
p += 1;
- }
+ }
while (isdigit (*p));
if (*p == '_')
{
@@ -347,10 +347,10 @@ string *result;
int success;
string decl;
const char *remembered_type;
-
+
string_init (&decl);
string_init (result);
-
+
done = 0;
success = 1;
while (success && !done)
@@ -362,12 +362,12 @@ string *result;
*type += 1;
string_prepend (&decl, "*");
break;
-
+
case 'R':
*type += 1;
string_prepend (&decl, "&");
break;
-
+
case 'T':
*type += 1;
if (!get_count (type, &n) || n >= ntypes)
@@ -378,7 +378,7 @@ string *result;
type = &remembered_type;
}
break;
-
+
case 'F':
*type += 1;
if (!string_empty (&decl) && decl.b[0] == '*')
@@ -391,13 +391,13 @@ string *result;
else
*type += 1;
break;
-
+
case 'M':
case 'O':
{
int constp = 0;
int volatilep = 0;
-
+
member = **type == 'M';
*type += 1;
if (!isdigit (**type))
@@ -411,7 +411,7 @@ string *result;
n *= 10;
n += **type - '0';
*type += 1;
- }
+ }
while (isdigit (**type));
if (strlen (*type) < n)
{
@@ -465,7 +465,7 @@ string *result;
}
break;
}
-
+
case 'C':
if ((*type)[1] == 'P')
{
@@ -475,14 +475,14 @@ string *result;
string_prepend (&decl, "const");
break;
}
-
+
/* fall through */
default:
done = 1;
break;
}
}
-
+
done = 0;
non_empty = 0;
while (success && !done)
@@ -518,7 +518,7 @@ string *result;
break;
}
}
-
+
if (success)
switch (**type)
{
@@ -613,7 +613,7 @@ string *result;
success = 0;
break;
}
-
+
if (success)
{
if (!string_empty (&decl))
@@ -643,7 +643,7 @@ string *result;
int len;
const char *start;
const char *end;
-
+
start = *type;
if (!do_type (type, result))
return 0;
@@ -679,9 +679,9 @@ string *decl;
{
string arg;
int need_comma = 0;
-
+
string_append (decl, "(");
-
+
while (**type != '_' && **type != '\0' && **type != 'e' && **type != 'v')
{
if (**type == 'N')
@@ -714,7 +714,7 @@ string *decl;
need_comma = 1;
}
}
-
+
if (**type == 'v')
*type += 1;
else if (**type == 'e')
@@ -724,7 +724,7 @@ string *decl;
string_append (decl, ",");
string_append (decl, "...");
}
-
+
string_append (decl, ")");
return 1;
}
@@ -733,7 +733,7 @@ static void
munge_function_name (name)
string *name;
{
- if (!string_empty (name) && name->p - name->b >= 3
+ if (!string_empty (name) && name->p - name->b >= 3
&& name->b[0] == 'o' && name->b[1] == 'p' && name->b[2] == '$')
{
int i;
@@ -760,7 +760,7 @@ string *name;
for (i = 0; i < sizeof (optable)/sizeof (optable[0]); i++)
{
int len = name->p - name->b - 3;
- if (strlen (optable[i].in) == len
+ if (strlen (optable[i].in) == len
&& memcmp (optable[i].in, name->b + 3, len) == 0)
{
string_clear (name);
@@ -832,7 +832,7 @@ string *s;
s->b = s->p = s->e = NULL;
}
-static void
+static void
string_clear (s)
string *s;
{
@@ -914,7 +914,7 @@ const char *s;
int n;
{
char *q;
-
+
if (n == 0)
return;
string_need (p, n);
diff --git a/gnu/usr.bin/as/config/ho-ansi.h b/gnu/usr.bin/as/config/ho-ansi.h
index 2af0341..bd2d909 100644
--- a/gnu/usr.bin/as/config/ho-ansi.h
+++ b/gnu/usr.bin/as/config/ho-ansi.h
@@ -1,18 +1,18 @@
/* ho-ansi.h Host-specific header file for generic ansi environments.
Copyright (C) 1987, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
diff --git a/gnu/usr.bin/as/config/ho-decstation.h b/gnu/usr.bin/as/config/ho-decstation.h
index 1cab4d5..69a4699 100644
--- a/gnu/usr.bin/as/config/ho-decstation.h
+++ b/gnu/usr.bin/as/config/ho-decstation.h
@@ -1,18 +1,18 @@
/* ho-pmax.h Host-specific header file for decstation 3100.
Copyright (C) 1987, 1990, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
diff --git a/gnu/usr.bin/as/config/ho-generic.h b/gnu/usr.bin/as/config/ho-generic.h
index 493cfc6..7c7129f 100644
--- a/gnu/usr.bin/as/config/ho-generic.h
+++ b/gnu/usr.bin/as/config/ho-generic.h
@@ -1,18 +1,18 @@
/* ho-generic.h Generic host-specific header file.
Copyright 1987, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
diff --git a/gnu/usr.bin/as/config/ho-hpux.h b/gnu/usr.bin/as/config/ho-hpux.h
index d5ff31a..ebea9e2 100644
--- a/gnu/usr.bin/as/config/ho-hpux.h
+++ b/gnu/usr.bin/as/config/ho-hpux.h
@@ -1,18 +1,18 @@
/* ho-hpux.h -- Header to compile the assembler under HP-UX
Copyright (C) 1988, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
diff --git a/gnu/usr.bin/as/config/ho-i386.h b/gnu/usr.bin/as/config/ho-i386.h
index 6941b7e..04de366 100644
--- a/gnu/usr.bin/as/config/ho-i386.h
+++ b/gnu/usr.bin/as/config/ho-i386.h
@@ -1,23 +1,23 @@
/* ho-i386.h i386 specific header file.
Copyright (C) 1987, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
/*
- * $Id: ho-i386.h,v 1.1 1993/10/02 20:58:36 pk Exp $
+ * $Id: ho-i386.h,v 1.1 1993/11/03 00:53:21 paul Exp $
*/
diff --git a/gnu/usr.bin/as/config/ho-i386aix.h b/gnu/usr.bin/as/config/ho-i386aix.h
index d31b51a..d439f74 100644
--- a/gnu/usr.bin/as/config/ho-i386aix.h
+++ b/gnu/usr.bin/as/config/ho-i386aix.h
@@ -1,18 +1,18 @@
/* ho-386aix.h AIX PS/2 i386 specific header file.
Copyright (C) 1987, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
diff --git a/gnu/usr.bin/as/config/ho-rs6000.h b/gnu/usr.bin/as/config/ho-rs6000.h
index fe57e8e..ed49484 100644
--- a/gnu/usr.bin/as/config/ho-rs6000.h
+++ b/gnu/usr.bin/as/config/ho-rs6000.h
@@ -1,18 +1,18 @@
/* ho-rs6000.h Rs6000 host-specific header file.
Copyright (C) 1987, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
diff --git a/gnu/usr.bin/as/config/ho-sunos.h b/gnu/usr.bin/as/config/ho-sunos.h
index 1193b1b..9c6cc01 100644
--- a/gnu/usr.bin/as/config/ho-sunos.h
+++ b/gnu/usr.bin/as/config/ho-sunos.h
@@ -1,18 +1,18 @@
/* This file is ho-sunos.h
Copyright (C) 1987-1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
diff --git a/gnu/usr.bin/as/config/ho-sysv.h b/gnu/usr.bin/as/config/ho-sysv.h
index 443fe3b..5407e5d 100644
--- a/gnu/usr.bin/as/config/ho-sysv.h
+++ b/gnu/usr.bin/as/config/ho-sysv.h
@@ -1,18 +1,18 @@
/* ho-sysv.h System V specific header file.
Copyright (C) 1987, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
diff --git a/gnu/usr.bin/as/config/ho-vax.h b/gnu/usr.bin/as/config/ho-vax.h
index eee0553..ea77e81 100644
--- a/gnu/usr.bin/as/config/ho-vax.h
+++ b/gnu/usr.bin/as/config/ho-vax.h
@@ -1,18 +1,18 @@
/* ho-vax.h Intended for vax ultrix
Copyright (C) 1987, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
diff --git a/gnu/usr.bin/as/config/ho-vms.h b/gnu/usr.bin/as/config/ho-vms.h
index 4b6680e..63f448e 100644
--- a/gnu/usr.bin/as/config/ho-vms.h
+++ b/gnu/usr.bin/as/config/ho-vms.h
@@ -1,18 +1,18 @@
/* ho-vax.h Intended for vax vms
Copyright (C) 1987, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
diff --git a/gnu/usr.bin/as/config/obj-aout.c b/gnu/usr.bin/as/config/obj-aout.c
index ceca490..146f346 100644
--- a/gnu/usr.bin/as/config/obj-aout.c
+++ b/gnu/usr.bin/as/config/obj-aout.c
@@ -1,18 +1,18 @@
/* a.out object file format
Copyright (C) 1989, 1990, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -87,7 +87,7 @@ const pseudo_typeS obj_pseudo_table[] = {
{ "stabn", obj_aout_stab, 'n' }, /* stabs */
{ "stabs", obj_aout_stab, 's' }, /* stabs */
#endif /* IGNORE_DEBUG */
-
+
/* coff debug pseudos (ignored) */
{ "def", s_ignore, 0 },
{ "dim", s_ignore, 0 },
@@ -101,13 +101,13 @@ const pseudo_typeS obj_pseudo_table[] = {
{ "type", s_type, 0 },
{ "val", s_ignore, 0 },
{ "version", s_ignore, 0 },
-
+
/* stabs-in-coff (?) debug pseudos (ignored) */
{ "optim", s_ignore, 0 }, /* For sun386i cc (?) */
-
+
/* other stuff */
{ "ABORT", s_abort, 0 },
-
+
{ NULL} /* end sentinel */
}; /* obj_pseudo_table */
@@ -130,7 +130,7 @@ relax_addressT segment_address_in_file;
*where += md_reloc_size;
} /* if there is an add symbol */
} /* for each fix */
-
+
return;
} /* obj_emit_relocations() */
@@ -169,7 +169,7 @@ object_headers *headers;
md_number_to_chars(*where, headers->header.a_trsize, 4); *where += 4;
md_number_to_chars(*where, headers->header.a_drsize, 4); *where += 4;
-
+
#ifdef TE_SEQUENT
memset(*where, '\0', 3 * 2 * 4); *where += 3 * 2 * 4; /* global descriptor table? */
md_number_to_chars(*where, 0, 4); *where += 4; /* shdata - length of initialized shared data */
@@ -206,7 +206,7 @@ symbolS *symbolP;
md_number_to_chars((char *)&(S_GET_OFFSET(symbolP)), S_GET_OFFSET(symbolP), sizeof(S_GET_OFFSET(symbolP)));
md_number_to_chars((char *)&(S_GET_DESC(symbolP)), S_GET_DESC(symbolP), sizeof(S_GET_DESC(symbolP)));
md_number_to_chars((char *)&(S_GET_VALUE(symbolP)), S_GET_VALUE(symbolP), sizeof(S_GET_VALUE(symbolP)));
-
+
append(where, (char *)&symbolP->sy_symbol, sizeof(obj_symbol_type));
} /* obj_symbol_to_chars() */
@@ -215,7 +215,7 @@ char **where;
symbolS *symbol_rootP;
{
symbolS * symbolP;
-
+
/*
* Emit all symbols left in the symbol chain.
*/
@@ -223,10 +223,10 @@ symbolS *symbol_rootP;
/* Used to save the offset of the name. It is used to point
to the string in memory but must be a file offset. */
register char *temp;
-
+
temp = S_GET_NAME(symbolP);
S_SET_OFFSET(symbolP, symbolP->sy_name_offset);
-
+
/*
* Put aux info in lower four bits of `n_other' field
* Do this only now, because things like S_IS_DEFINED()
@@ -238,7 +238,7 @@ symbolS *symbol_rootP;
/* Any symbol still undefined and is not a dbg symbol is made N_EXT. */
if (!S_IS_DEBUG(symbolP) && !S_IS_DEFINED(symbolP))
S_SET_EXTERNAL(symbolP);
-
+
if (S_GET_TYPE(symbolP) == N_SIZE) {
expressionS *exp = (expressionS*)symbolP->sy_sizexp;
long size = 0;
@@ -320,7 +320,7 @@ int what;
int length;
int goof; /* TRUE if we have aborted. */
long longint;
-
+
/*
* Enter with input_line_pointer pointing past .stabX and any following
* whitespace.
@@ -337,7 +337,7 @@ int what;
}
} else
string = "";
-
+
/*
* Input_line_pointer->after ','. String->symbol name.
*/
@@ -352,20 +352,20 @@ int what;
S_SET_VALUE(symbolP, obstack_next_free(&frags) - frag_now->fr_literal);
symbolP->sy_frag = frag_now;
break;
-
+
case 'n':
symbolP->sy_frag = &zero_address_frag;
break;
-
+
case 's':
symbolP->sy_frag = & zero_address_frag;
break;
-
+
default:
BAD_CASE(what);
break;
}
-
+
if (get_absolute_expression_and_terminator(&longint) == ',')
symbolP->sy_symbol.n_type = saved_type = longint;
else {
@@ -374,7 +374,7 @@ int what;
input_line_pointer --; /* Backup over a non-',' char. */
}
}
-
+
if (!goof) {
if (get_absolute_expression_and_terminator(&longint) == ',')
S_SET_OTHER(symbolP, longint);
@@ -384,7 +384,7 @@ int what;
input_line_pointer--; /* Backup over a non-',' char. */
}
}
-
+
if (!goof) {
S_SET_DESC(symbolP, get_absolute_expression());
if (what == 's' || what == 'n') {
@@ -396,27 +396,27 @@ int what;
}
}
}
-
+
if ((!goof) && (what == 's' || what == 'n')) {
pseudo_set(symbolP);
symbolP->sy_symbol.n_type = saved_type;
}
#ifndef NO_LISTING
- if (listing && !goof)
+ if (listing && !goof)
{
- if (symbolP->sy_symbol.n_type == N_SLINE)
+ if (symbolP->sy_symbol.n_type == N_SLINE)
{
-
+
listing_source_line(symbolP->sy_symbol.n_desc);
}
else if (symbolP->sy_symbol.n_type == N_SO
- || symbolP->sy_symbol.n_type == N_SOL)
+ || symbolP->sy_symbol.n_type == N_SOL)
{
listing_source_file(string);
- }
+ }
}
-#endif
-
+#endif
+
if (goof)
ignore_rest_of_line();
else
@@ -429,7 +429,7 @@ static void obj_aout_desc() {
register char *p;
register symbolS *symbolP;
register int temp;
-
+
/*
* Frob invented at RMS' request. Set the n_desc of a symbol.
*/
@@ -464,46 +464,46 @@ object_headers *headers;
symbolS *symbolP;
symbolS **symbolPP;
int symbol_number = 0;
-
+
/* JF deal with forward references first... */
for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next(symbolP)) {
if (symbolP->sy_forward) {
S_SET_VALUE(symbolP, S_GET_VALUE(symbolP)
+ S_GET_VALUE(symbolP->sy_forward)
+ symbolP->sy_forward->sy_frag->fr_address);
-
+
symbolP->sy_forward=0;
} /* if it has a forward reference */
} /* walk the symbol chain */
-
+
tc_crawl_symbol_chain(headers);
-
+
symbolPP = &symbol_rootP; /*->last symbol chain link. */
while ((symbolP = *symbolPP) != NULL) {
if (flagseen['R'] && (S_GET_SEGMENT(symbolP) == SEG_DATA)) {
S_SET_SEGMENT(symbolP, SEG_TEXT);
} /* if pusing data into text */
-
+
S_SET_VALUE(symbolP, S_GET_VALUE(symbolP) + symbolP->sy_frag->fr_address);
-
+
/* OK, here is how we decide which symbols go out into the
brave new symtab. Symbols that do are:
-
+
* symbols with no name (stabd's?)
* symbols with debug info in their N_TYPE
* symbols marked "forceout" (to force out local `L'
symbols in PIC code)
-
+
Symbols that don't are:
* symbols that are registers
* symbols with \1 as their 3rd character (numeric labels)
* "local labels" as defined by S_LOCAL_NAME(name)
if the -L switch was passed to gas.
-
+
All other symbols are output. We complain if a deleted
symbol was marked external. */
-
-
+
+
if (!S_IS_REGISTER(symbolP)
&& (!S_GET_NAME(symbolP)
|| S_IS_DEBUG(symbolP)
@@ -526,7 +526,7 @@ object_headers *headers;
#endif
) {
symbolP->sy_number = symbol_number++;
-
+
/* The + 1 after strlen account for the \0 at the
end of each string */
if (!S_IS_STABD(symbolP)) {
@@ -585,14 +585,14 @@ object_headers *headers;
) {
as_bad("Local symbol %s never defined.", decode_local_label_name(S_GET_NAME(symbolP)));
} /* oops. */
-
+
/* Unhook it from the chain */
*symbolPP = symbol_next(symbolP);
} /* if this symbol should be in the output */
} /* for each symbol */
-
+
H_SET_SYMBOL_TABLE_SIZE(headers, symbol_number);
-
+
return;
} /* obj_crawl_symbol_chain() */
@@ -604,7 +604,7 @@ void obj_emit_strings(where)
char **where;
{
symbolS *symbolP;
-
+
#ifdef CROSS_COMPILE
/* Gotta do md_ byte-ordering stuff for string_byte_count first - KWK */
md_number_to_chars(*where, string_byte_count, sizeof(string_byte_count));
@@ -612,13 +612,13 @@ char **where;
#else /* CROSS_COMPILE */
append (where, (char *)&string_byte_count, (unsigned long)sizeof(string_byte_count));
#endif /* CROSS_COMPILE */
-
+
for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next(symbolP)) {
if (S_GET_NAME(symbolP))
append(&next_object_file_charP, S_GET_NAME(symbolP),
(unsigned long)(strlen (S_GET_NAME(symbolP)) + 1));
} /* walk symbol chain */
-
+
return;
} /* obj_emit_strings() */
@@ -632,7 +632,7 @@ object_headers *headers;
AOUT_VERSION);
H_SET_ENTRY_POINT(headers, 0);
-
+
tc_aout_pre_write_hook(headers);
return;
} /* obj_pre_write_hook() */
diff --git a/gnu/usr.bin/as/config/obj-aout.h b/gnu/usr.bin/as/config/obj-aout.h
index 3925911..1ac0f5c 100644
--- a/gnu/usr.bin/as/config/obj-aout.h
+++ b/gnu/usr.bin/as/config/obj-aout.h
@@ -1,23 +1,23 @@
/* obj-aout.h, a.out object file format for gas, the assembler.
Copyright (C) 1989, 1990, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: obj-aout.h,v 1.2 1993/11/30 20:57:40 jkh Exp $
+ $Id: obj-aout.h,v 1.3 1994/12/23 22:37:34 nate Exp $
*/
@@ -271,7 +271,7 @@ typedef struct nlist obj_symbol_type; /* Symbol table entry */
#define H_SET_ENTRY_POINT(h,v) ((h)->header.a_entry = (v))
#define H_SET_STRING_SIZE(h,v) ((h)->string_table_size = (v))
-/*
+/*
* Current means for getting the name of a segment.
* This will change for infinite-segments support (e.g. COFF).
*/
diff --git a/gnu/usr.bin/as/config/obj-bfd-sunos.c b/gnu/usr.bin/as/config/obj-bfd-sunos.c
index 626516b..6db63de5 100644
--- a/gnu/usr.bin/as/config/obj-bfd-sunos.c
+++ b/gnu/usr.bin/as/config/obj-bfd-sunos.c
@@ -1,18 +1,18 @@
/* obj-bfd-sunos.c
Copyright (C) 1987, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -20,8 +20,8 @@
#include "as.h"
-static
-
+static
+
const short seg_N_TYPE[] = {
N_ABS,
N_TEXT,
diff --git a/gnu/usr.bin/as/config/obj-bfd-sunos.h b/gnu/usr.bin/as/config/obj-bfd-sunos.h
index 958d8a9..122594e 100644
--- a/gnu/usr.bin/as/config/obj-bfd-sunos.h
+++ b/gnu/usr.bin/as/config/obj-bfd-sunos.h
@@ -1,18 +1,18 @@
/*
Copyright (C) 1987, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
diff --git a/gnu/usr.bin/as/config/obj-bout.c b/gnu/usr.bin/as/config/obj-bout.c
index f6d9302..734f3a3 100644
--- a/gnu/usr.bin/as/config/obj-bout.c
+++ b/gnu/usr.bin/as/config/obj-bout.c
@@ -1,18 +1,18 @@
/* b.out object file format
Copyright (C) 1989, 1990, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -74,7 +74,7 @@ const pseudo_typeS obj_pseudo_table[] = {
{ "stabd", obj_bout_stab, 'd' }, /* stabs */
{ "stabn", obj_bout_stab, 'n' }, /* stabs */
{ "stabs", obj_bout_stab, 's' }, /* stabs */
-
+
/* coff debugging directives. Currently ignored silently */
{ "def", s_ignore, 0 },
{ "dim", s_ignore, 0 },
@@ -85,11 +85,11 @@ const pseudo_typeS obj_pseudo_table[] = {
{ "tag", s_ignore, 0 },
{ "type", s_ignore, 0 },
{ "val", s_ignore, 0 },
-
+
/* other stuff we don't handle */
{ "ABORT", s_ignore, 0 },
{ "ident", s_ignore, 0 },
-
+
{ NULL} /* end sentinel */
}; /* obj_pseudo_table */
@@ -111,7 +111,7 @@ relax_addressT segment_address_in_file;
*where += sizeof(struct relocation_info);
} /* if there's a symbol */
} /* for each fixup */
-
+
} /* emit_relocations() */
/* Aout file generation & utilities */
@@ -122,19 +122,19 @@ char **where;
object_headers *headers;
{
/* Always leave in host byte order */
-
+
headers->header.a_talign = section_alignment[SEG_TEXT];
-
+
if (headers->header.a_talign < 2){
headers->header.a_talign = 2;
} /* force to at least 2 */
-
+
headers->header.a_dalign = section_alignment[SEG_DATA];
headers->header.a_balign = section_alignment[SEG_BSS];
-
+
headers->header.a_tload = 0;
headers->header.a_dload = md_section_align(SEG_DATA, H_GET_TEXT_SIZE(headers));
-
+
append(where, (char *) &headers->header, sizeof(headers->header));
} /* a_header_append() */
@@ -151,7 +151,7 @@ char **where;
symbolS *symbol_rootP;
{
symbolS * symbolP;
-
+
/*
* Emit all symbols left in the symbol chain.
*/
@@ -159,13 +159,13 @@ symbolS *symbol_rootP;
/* Used to save the offset of the name. It is used to point
to the string in memory but must be a file offset. */
char *temp;
-
+
temp = S_GET_NAME(symbolP);
S_SET_OFFSET(symbolP, symbolP->sy_name_offset);
-
+
/* Any symbol still undefined and is not a dbg symbol is made N_EXT. */
if (!S_IS_DEBUG(symbolP) && !S_IS_DEFINED(symbolP)) S_SET_EXTERNAL(symbolP);
-
+
obj_symbol_to_chars(where, symbolP);
S_SET_NAME(symbolP,temp);
}
@@ -215,7 +215,7 @@ int what;
int length;
int goof; /* TRUE if we have aborted. */
long longint;
-
+
/*
* Enter with input_line_pointer pointing past .stabX and any following
* whitespace.
@@ -232,7 +232,7 @@ int what;
}
} else
string = "";
-
+
/*
* Input_line_pointer->after ','. String->symbol name.
*/
@@ -248,15 +248,15 @@ int what;
frag_now->fr_literal);
symbolP->sy_frag = frag_now;
break;
-
+
case 'n':
symbolP->sy_frag = &zero_address_frag;
break;
-
+
case 's':
symbolP->sy_frag = & zero_address_frag;
break;
-
+
default:
BAD_CASE(what);
break;
@@ -296,20 +296,20 @@ int what;
#ifndef NO_LISTING
{
extern int listing;
-
+
if (listing && !goof) {
if (symbolP->sy_symbol.n_type == N_SLINE) {
-
+
listing_source_line(symbolP->sy_symbol.n_desc);
} else if (symbolP->sy_symbol.n_type == N_SO
|| symbolP->sy_symbol.n_type == N_SOL) {
listing_source_file(string);
- }
+ }
}
}
-
-#endif
-
+
+#endif
+
if (goof)
ignore_rest_of_line ();
else
@@ -322,7 +322,7 @@ static void obj_bout_desc() {
register char *p;
register symbolS * symbolP;
register int temp;
-
+
/*
* Frob invented at RMS' request. Set the n_desc of a symbol.
*/
@@ -357,44 +357,44 @@ object_headers *headers;
symbolS **symbolPP;
symbolS *symbolP;
int symbol_number = 0;
-
+
/* JF deal with forward references first... */
for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next(symbolP)) {
if (symbolP->sy_forward) {
S_SET_VALUE(symbolP, S_GET_VALUE(symbolP)
+ S_GET_VALUE(symbolP->sy_forward)
+ symbolP->sy_forward->sy_frag->fr_address);
-
+
symbolP->sy_forward=0;
} /* if it has a forward reference */
} /* walk the symbol chain */
-
+
tc_crawl_symbol_chain(headers);
-
+
symbolPP = & symbol_rootP; /*->last symbol chain link. */
while ((symbolP = *symbolPP) != NULL) {
if (flagseen['R'] && (S_GET_SEGMENT(symbolP) == SEG_DATA)) {
S_SET_SEGMENT(symbolP, SEG_TEXT);
} /* if pusing data into text */
-
+
S_SET_VALUE(symbolP, S_GET_VALUE(symbolP) + symbolP->sy_frag->fr_address);
-
+
/* OK, here is how we decide which symbols go out into the
brave new symtab. Symbols that do are:
-
+
* symbols with no name (stabd's?)
* symbols with debug info in their N_TYPE
-
+
Symbols that don't are:
* symbols that are registers
* symbols with \1 as their 3rd character (numeric labels)
* "local labels" as defined by S_LOCAL_NAME(name)
if the -L switch was passed to gas.
-
+
All other symbols are output. We complain if a deleted
symbol was marked external. */
-
-
+
+
if (1
&& !S_IS_REGISTER(symbolP)
&& (!S_GET_NAME(symbolP)
@@ -406,7 +406,7 @@ object_headers *headers;
#endif /* TC_I960 */
|| (S_GET_NAME(symbolP)[0] != '\001' && (flagseen['L'] || ! S_LOCAL_NAME(symbolP))))) {
symbolP->sy_number = symbol_number++;
-
+
/* The + 1 after strlen account for the \0 at the
end of each string */
if (!S_IS_STABD(symbolP)) {
@@ -421,14 +421,14 @@ object_headers *headers;
if (S_IS_EXTERNAL(symbolP) || !S_IS_DEFINED(symbolP)) {
as_bad("Local symbol %s never defined", S_GET_NAME(symbolP));
} /* oops. */
-
+
/* Unhook it from the chain */
*symbolPP = symbol_next(symbolP);
} /* if this symbol should be in the output */
} /* for each symbol */
-
+
H_SET_SYMBOL_TABLE_SIZE(headers, symbol_number);
-
+
return;
} /* obj_crawl_symbol_chain() */
@@ -440,7 +440,7 @@ void obj_emit_strings(where)
char **where;
{
symbolS *symbolP;
-
+
#ifdef CROSS_COMPILE
/* Gotta do md_ byte-ordering stuff for string_byte_count first - KWK */
md_number_to_chars(*where, string_byte_count, sizeof(string_byte_count));
@@ -448,12 +448,12 @@ char **where;
#else /* CROSS_COMPILE */
append(where, (char *) &string_byte_count, (unsigned long) sizeof(string_byte_count));
#endif /* CROSS_COMPILE */
-
+
for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next(symbolP)) {
if (S_GET_NAME(symbolP))
append(where, S_GET_NAME(symbolP), (unsigned long)(strlen (S_GET_NAME(symbolP)) + 1));
} /* walk symbol chain */
-
+
return;
} /* obj_emit_strings() */
@@ -462,7 +462,7 @@ object_headers *headers;
{
H_SET_MAGIC_NUMBER(headers, BMAGIC);
H_SET_ENTRY_POINT(headers, 0);
-
+
return;
} /* obj_pre_write_hook() */
diff --git a/gnu/usr.bin/as/config/obj-bout.h b/gnu/usr.bin/as/config/obj-bout.h
index e28d435..6de818a 100644
--- a/gnu/usr.bin/as/config/obj-bout.h
+++ b/gnu/usr.bin/as/config/obj-bout.h
@@ -1,18 +1,18 @@
/* b.out object file format
Copyright (C) 1989, 1990, 1991, 1992 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, 675 Mass Ave, Cambridge, MA
@@ -94,7 +94,7 @@ struct exec {
unsigned long a_entry; /* Runtime start address */
unsigned long a_trsize; /* Length of text relocation info */
unsigned long a_drsize; /* Length of data relocation info */
-
+
/* Added for i960 */
unsigned long a_tload; /* Text runtime load address */
unsigned long a_dload; /* Data runtime load address */
@@ -277,7 +277,7 @@ struct relocation_info {
#define H_SET_VERSION(h,v) ((h)->header.a_version = (v))
#endif /* EXEC_VERSION */
-/*
+/*
* Current means for getting the name of a segment.
* This will change for infinite-segments support (e.g. COFF).
*/
diff --git a/gnu/usr.bin/as/config/obj-coff.c b/gnu/usr.bin/as/config/obj-coff.c
index 238e6c5..b57c6cd 100644
--- a/gnu/usr.bin/as/config/obj-coff.c
+++ b/gnu/usr.bin/as/config/obj-coff.c
@@ -1,18 +1,18 @@
/* coff object file format
Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
-
+
This file is part of GAS.
-
+
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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -132,10 +132,10 @@ const pseudo_typeS obj_pseudo_table[] = {
{ "type", s_ignore, 0 },
{ "val", s_ignore, 0 },
#endif /* ignore debug */
-
+
{ "ident", s_ignore, 0 }, /* we don't yet handle this. */
-
-
+
+
/* stabs aka a.out aka b.out directives for debug symbols.
Currently ignored silently. Except for .line at which
we guess from context. */
@@ -144,12 +144,12 @@ const pseudo_typeS obj_pseudo_table[] = {
{ "stabd", obj_coff_stab, 'd' }, /* stabs */
{ "stabn", obj_coff_stab, 'n' }, /* stabs */
{ "stabs", obj_coff_stab, 's' }, /* stabs */
-
+
/* stabs-in-coff (?) debug pseudos (ignored) */
{ "optim", s_ignore, 0 }, /* For sun386i cc (?) */
/* other stuff */
{ "ABORT", s_abort, 0 },
-
+
{ NULL} /* end sentinel */
}; /* obj_pseudo_table */
@@ -195,12 +195,12 @@ relax_addressT segment_address_in_file;
symbolS *symbolP;
int i, count;
fixS *p;
-
+
for (count = 0, p = fixP; p ; p = p->fx_next)
if (p->fx_addsy) count++;
if (!count)
return;
-
+
#ifdef BFD_HEADERS
ri_table = (struct internal_reloc *) calloc(sizeof(*ri_table),count);
#else
@@ -208,13 +208,13 @@ relax_addressT segment_address_in_file;
#endif
if (!ri_table)
as_fatal ("obj_emit_relocations: Could not malloc relocation table");
-
+
#ifdef TC_I960
callj_table = (char *)malloc (sizeof(char)*count);
if (!callj_table)
as_fatal ("obj_emit_relocations: Could not malloc callj table");
#endif
-
+
for (i = 0; fixP; fixP = fixP->fx_next) {
if (symbolP = fixP->fx_addsy) {
#if defined(TC_M68K)
@@ -242,7 +242,7 @@ relax_addressT segment_address_in_file;
callj_table[i] = fixP->fx_callj ? 1 : 0;
#elif defined(TC_A29K)
ri_table[i].r_type = tc_coff_fix2rtype(fixP);
-
+
#else
#error you lose
#endif /* TC_M68K || TC_I386 */
@@ -275,19 +275,19 @@ relax_addressT segment_address_in_file;
: ((SF_GET_LOCAL(symbolP)
? dot_bss_symbol->sy_number
: symbolP->sy_number)))); /* bss or undefined */
-
+
/* md_ri_to_chars((char *) &ri, ri); */ /* Last step : write md f */
-
+
i++;
} /* if there's a symbol */
} /* for each fixP */
-
+
/*
* AIX ld prefer to have the reloc table with r_vaddr sorted.
* But sorting it should not hurt any other ld.
*/
qsort (ri_table, count, sizeof(*ri_table), reloc_compare);
-
+
for (i = 0; i < count; i++)
{
#ifdef BFD_HEADERS
@@ -300,17 +300,17 @@ relax_addressT segment_address_in_file;
if (ri_table[i].r_type == R_IHIHALF)
{
/* now emit the second bit */
- ri_table[i].r_type = R_IHCONST;
+ ri_table[i].r_type = R_IHCONST;
ri_table[i].r_symndx = fixP->fx_addnumber;
*where += bfd_coff_swap_reloc_out(stdoutput, &ri_table[i],
*where);
}
# endif /* TC_A29K */
-
+
#else /* not BFD_HEADERS */
append(where, (char *) &ri_table[i], RELSZ);
#endif /* not BFD_HEADERS */
-
+
#ifdef TC_I960
if (callj_table[i])
{
@@ -324,12 +324,12 @@ relax_addressT segment_address_in_file;
} /* if it's a callj, do it again for the opcode */
#endif /* TC_I960 */
}
-
+
free (ri_table);
#ifdef TC_I960
free (callj_table);
#endif
-
+
return;
} /* obj_emit_relocations() */
@@ -348,7 +348,7 @@ object_headers *headers;
obj_coff_section_header_append(where, &text_section_header);
obj_coff_section_header_append(where, &data_section_header);
obj_coff_section_header_append(where, &bss_section_header);
-
+
}
#else
@@ -358,7 +358,7 @@ char **where;
object_headers *headers;
{
tc_headers_hook(headers);
-
+
#ifdef CROSS_COMPILE
/* Eventually swap bytes for cross compilation for file header */
md_number_to_chars(*where, headers->filehdr.f_magic, sizeof(headers->filehdr.f_magic));
@@ -375,7 +375,7 @@ object_headers *headers;
*where += sizeof(headers->filehdr.f_opthdr);
md_number_to_chars(*where, headers->filehdr.f_flags, sizeof(headers->filehdr.f_flags));
*where += sizeof(headers->filehdr.f_flags);
-
+
#ifndef OBJ_COFF_OMIT_OPTIONAL_HEADER
/* Eventually swap bytes for cross compilation for a.out header */
md_number_to_chars(*where, headers->aouthdr.magic, sizeof(headers->aouthdr.magic));
@@ -397,21 +397,21 @@ object_headers *headers;
md_number_to_chars(*where, headers->aouthdr.tagentries, sizeof(headers->aouthdr.tagentries));
*where += sizeof(headers->aouthdr.tagentries);
#endif /* OBJ_COFF_OMIT_OPTIONAL_HEADER */
-
+
#else /* CROSS_COMPILE */
-
+
append(where, (char *) &headers->filehdr, sizeof(headers->filehdr));
#ifndef OBJ_COFF_OMIT_OPTIONAL_HEADER
append(where, (char *) &headers->aouthdr, sizeof(headers->aouthdr));
#endif /* OBJ_COFF_OMIT_OPTIONAL_HEADER */
-
+
#endif /* CROSS_COMPILE */
-
+
/* Output the section headers */
obj_coff_section_header_append(where, &text_section_header);
obj_coff_section_header_append(where, &data_section_header);
obj_coff_section_header_append(where, &bss_section_header);
-
+
return;
} /* obj_header_append() */
#endif
@@ -422,14 +422,14 @@ symbolS *symbolP;
#ifdef BFD_HEADERS
unsigned int numaux = symbolP->sy_symbol.ost_entry.n_numaux;
unsigned int i;
-
+
if (S_GET_SEGMENT(symbolP) == SEG_REGISTER) {
S_SET_SEGMENT(symbolP, SEG_ABSOLUTE);
}
*where += bfd_coff_swap_sym_out(stdoutput, &symbolP->sy_symbol.ost_entry,
*where);
-
- for (i = 0; i < numaux; i++)
+
+ for (i = 0; i < numaux; i++)
{
*where += bfd_coff_swap_aux_out(stdoutput,
&symbolP->sy_symbol.ost_auxent[i],
@@ -437,13 +437,13 @@ symbolS *symbolP;
S_GET_STORAGE_CLASS(symbolP),
*where);
}
-
+
#else /* BFD_HEADERS */
SYMENT *syment = &symbolP->sy_symbol.ost_entry;
int i;
char numaux = syment->n_numaux;
unsigned short type = S_GET_DATA_TYPE(symbolP);
-
+
#ifdef CROSS_COMPILE
md_number_to_chars(*where, syment->n_value, sizeof(syment->n_value));
*where += sizeof(syment->n_value);
@@ -460,12 +460,12 @@ symbolS *symbolP;
#else /* CROSS_COMPILE */
append(where, (char *) syment, sizeof(*syment));
#endif /* CROSS_COMPILE */
-
+
/* Should do the following : if (.file entry) MD(..)... else if (static entry) MD(..) */
if (numaux > OBJ_COFF_MAX_AUXENTRIES) {
as_bad("Internal error? too many auxents for symbol");
} /* too many auxents */
-
+
for (i = 0; i < numaux; ++i) {
#ifdef CROSS_COMPILE
#if 0 /* This code has never been tested */
@@ -509,9 +509,9 @@ symbolS *symbolP;
#else /* CROSS_COMPILE */
append(where, (char *) &symbolP->sy_symbol.ost_auxent[i], sizeof(symbolP->sy_symbol.ost_auxent[i]));
#endif /* CROSS_COMPILE */
-
+
}; /* for each aux in use */
-#endif /* BFD_HEADERS */
+#endif /* BFD_HEADERS */
return;
} /* obj_symbol_to_chars() */
@@ -530,45 +530,45 @@ SCNHDR *header;
#ifdef CROSS_COMPILE
memcpy(*where, header->s_name, sizeof(header->s_name));
*where += sizeof(header->s_name);
-
+
md_number_to_chars(*where, header->s_paddr, sizeof(header->s_paddr));
*where += sizeof(header->s_paddr);
-
+
md_number_to_chars(*where, header->s_vaddr, sizeof(header->s_vaddr));
*where += sizeof(header->s_vaddr);
-
+
md_number_to_chars(*where, header->s_size, sizeof(header->s_size));
*where += sizeof(header->s_size);
-
+
md_number_to_chars(*where, header->s_scnptr, sizeof(header->s_scnptr));
*where += sizeof(header->s_scnptr);
-
+
md_number_to_chars(*where, header->s_relptr, sizeof(header->s_relptr));
*where += sizeof(header->s_relptr);
-
+
md_number_to_chars(*where, header->s_lnnoptr, sizeof(header->s_lnnoptr));
*where += sizeof(header->s_lnnoptr);
-
+
md_number_to_chars(*where, header->s_nreloc, sizeof(header->s_nreloc));
*where += sizeof(header->s_nreloc);
-
+
md_number_to_chars(*where, header->s_nlnno, sizeof(header->s_nlnno));
*where += sizeof(header->s_nlnno);
-
+
md_number_to_chars(*where, header->s_flags, sizeof(header->s_flags));
*where += sizeof(header->s_flags);
-
+
#ifdef TC_I960
md_number_to_chars(*where, header->s_align, sizeof(header->s_align));
*where += sizeof(header->s_align);
#endif /* TC_I960 */
-
+
#else /* CROSS_COMPILE */
-
+
append(where, (char *) header, sizeof(*header));
-
+
#endif /* CROSS_COMPILE */
-
+
return;
} /* obj_coff_section_header_append() */
@@ -585,9 +585,9 @@ symbolS *symbol_rootP;
/* Used to save the offset of the name. It is used to point
to the string in memory but must be a file offset. */
register char * temp;
-
+
tc_coff_symbol_emit_hook(symbolP);
-
+
temp = S_GET_NAME(symbolP);
if (SF_GET_STRING(symbolP)) {
S_SET_OFFSET(symbolP, symbolP->sy_name_offset);
@@ -609,15 +609,15 @@ symbolS *normal;
{
S_SET_DATA_TYPE(normal, S_GET_DATA_TYPE(debug));
S_SET_STORAGE_CLASS(normal, S_GET_STORAGE_CLASS(debug));
-
+
if (S_GET_NUMBER_AUXILIARY(debug) > S_GET_NUMBER_AUXILIARY(normal)) {
S_SET_NUMBER_AUXILIARY(normal, S_GET_NUMBER_AUXILIARY(debug));
} /* take the most we have */
-
+
if (S_GET_NUMBER_AUXILIARY(debug) > 0) {
memcpy((char*)&normal->sy_symbol.ost_auxent[0], (char*)&debug->sy_symbol.ost_auxent[0], S_GET_NUMBER_AUXILIARY(debug) * AUXESZ);
} /* Move all the auxiliary information */
-
+
/* Move the debug flags. */
SF_SET_DEBUG_FIELD(normal, SF_GET_DEBUG_FIELD(debug));
} /* c_symbol_merge() */
@@ -628,31 +628,31 @@ void c_dot_file_symbol(filename)
char *filename;
{
symbolS* symbolP;
-
+
symbolP = symbol_new(".file",
SEG_DEBUG,
0,
&zero_address_frag);
-
+
S_SET_STORAGE_CLASS(symbolP, C_FILE);
S_SET_NUMBER_AUXILIARY(symbolP, 1);
SA_SET_FILE_FNAME(symbolP, filename);
SF_SET_DEBUG(symbolP);
S_SET_VALUE(symbolP, (long) previous_file_symbol);
-
+
previous_file_symbol = symbolP;
-
+
/* Make sure that the symbol is first on the symbol chain */
if (symbol_rootP != symbolP) {
if (symbolP == symbol_lastP) {
symbol_lastP = symbol_lastP->sy_previous;
} /* if it was the last thing on the list */
-
+
symbol_remove(symbolP, &symbol_rootP, &symbol_lastP);
symbol_insert(symbolP, symbol_rootP, &symbol_rootP, &symbol_lastP);
symbol_rootP = symbolP;
} /* if not first on the list */
-
+
} /* c_dot_file_symbol() */
/*
* Build a 'section static' symbol.
@@ -666,7 +666,7 @@ unsigned short nreloc;
unsigned short nlnno;
{
symbolS *symbolP;
-
+
symbolP = symbol_new(name,
(name[1] == 't'
? SEG_TEXT
@@ -675,16 +675,16 @@ unsigned short nlnno;
: SEG_BSS)),
value,
&zero_address_frag);
-
+
S_SET_STORAGE_CLASS(symbolP, C_STAT);
S_SET_NUMBER_AUXILIARY(symbolP, 1);
-
+
SA_SET_SCN_SCNLEN(symbolP, length);
SA_SET_SCN_NRELOC(symbolP, nreloc);
SA_SET_SCN_NLINNO(symbolP, nlnno);
-
+
SF_SET_STATICS(symbolP);
-
+
return (char*)symbolP;
} /* c_section_symbol() */
@@ -720,7 +720,7 @@ long alignment;
header->s_lnnoptr = lineno_ptr;
header->s_nreloc = reloc_number;
header->s_nlnno = lineno_number;
-
+
#ifdef OBJ_COFF_SECTION_HEADER_HAS_ALIGNMENT
#ifdef OBJ_COFF_BROKEN_ALIGNMENT
header->s_align = ((name[1] == 'b' || (size > 0)) ? 16 : 0);
@@ -730,7 +730,7 @@ long alignment;
: (1 << alignment));
#endif /* OBJ_COFF_BROKEN_ALIGNMENT */
#endif /* OBJ_COFF_SECTION_HEADER_HAS_ALIGNMENT */
-
+
header->s_flags = STYP_REG | (name[1] == 't'
? STYP_TEXT
: (name[1] == 'd'
@@ -760,12 +760,12 @@ unsigned short line_number;
fragS* frag;
{
lineno* new_line = (lineno*)xmalloc(sizeof(lineno));
-
+
new_line->line.l_addr.l_paddr = paddr;
new_line->line.l_lnno = line_number;
new_line->frag = (char*)frag;
new_line->next = (lineno*)0;
-
+
if (lineno_rootP == (lineno*)0)
lineno_rootP = new_line;
else
@@ -786,23 +786,23 @@ char *file_start;
#endif
for (; line; line = line->next) {
line_entry = &line->line;
-
+
/* FIXME-SOMEDAY Resolving the sy_number of function linno's used to be done in
write_object_file() but their symbols need a fileptr to the lnno, so
I moved this resolution check here. xoxorich. */
-
+
if (line_entry->l_lnno == 0) {
/* There is a good chance that the symbol pointed to
is not the one that will be emitted and that the
sy_number is not accurate. */
/* char *name; */
symbolS *symbolP;
-
+
symbolP = (symbolS *) line_entry->l_addr.l_symndx;
-
+
line_entry->l_addr.l_symndx = symbolP->sy_number;
symbolP->sy_symbol.ost_auxent[0].x_sym.x_fcnary.x_fcn.x_lnnoptr = *where - file_start;
-
+
} /* if this is a function linno */
#ifdef BFD_HEADERS
*where += bfd_coff_swap_lineno_out(stdoutput, line_entry, *where);
@@ -812,23 +812,23 @@ char *file_start;
#ifdef CROSS_COMPILE
md_number_to_chars(*where, line_entry->l_addr.l_paddr, sizeof(line_entry->l_addr.l_paddr));
*where += sizeof(line_entry->l_addr.l_paddr);
-
+
md_number_to_chars(*where, line_entry->l_lnno, sizeof(line_entry->l_lnno));
*where += sizeof(line_entry->l_lnno);
-
+
#ifdef TC_I960
**where = '0';
++*where;
**where = '0';
++*where;
#endif /* TC_I960 */
-
+
#else /* CROSS_COMPILE */
append(where, (char *) line_entry, LINESZ);
#endif /* CROSS_COMPILE */
#endif /* BFD_HEADERS */
} /* for each line number */
-
+
return ;
} /* obj_emit_lineno() */
@@ -836,7 +836,7 @@ void obj_symbol_new_hook(symbolP)
symbolS *symbolP;
{
char underscore = 0; /* Symbol has leading _ */
-
+
/* Effective symbol */
/* Store the pointer in the offset. */
S_SET_ZEROES(symbolP, 0L);
@@ -847,7 +847,7 @@ symbolS *symbolP;
symbolP->sy_symbol.ost_flags = 0;
/* Auxiliary entries */
memset((char*) &symbolP->sy_symbol.ost_auxent[0], '\0', AUXESZ);
-
+
#ifdef STRIP_UNDERSCORE
/* Remove leading underscore at the beginning of the symbol.
* This is to be compatible with the standard librairies.
@@ -857,12 +857,12 @@ symbolS *symbolP;
S_SET_NAME(symbolP, S_GET_NAME(symbolP) + 1);
} /* strip underscore */
#endif /* STRIP_UNDERSCORE */
-
+
if (S_IS_STRING(symbolP))
SF_SET_STRING(symbolP);
if (!underscore && S_IS_LOCAL(symbolP))
SF_SET_LOCAL(symbolP);
-
+
return;
} /* obj_symbol_new_hook() */
@@ -872,7 +872,7 @@ unsigned long chunk_size;
unsigned long element_size;
{
stack* st;
-
+
if ((st = (stack*)malloc(sizeof(stack))) == (stack*)0)
return (stack*)0;
if ((st->data = malloc(chunk_size)) == (char*)0) {
@@ -934,11 +934,11 @@ static void obj_coff_ln() {
demand_empty_rest_of_line();
return;
} /* wrong context */
-
+
c_line_new(obstack_next_free(&frags) - frag_now->fr_literal,
get_absolute_expression(),
frag_now);
-
+
demand_empty_rest_of_line();
return;
} /* obj_coff_line() */
@@ -972,24 +972,24 @@ int what;
/*$char* directiveP;$ */ /* Name of the pseudo opcode */
/*$char directive[MAX_DIRECTIVE];$ */ /* Backup of the directive */
/*$char end = 0;$ */ /* If 1, stop parsing */
-
+
if (def_symbol_in_progress != NULL) {
as_warn(".def pseudo-op used inside of .def/.endef: ignored.");
demand_empty_rest_of_line();
return;
} /* if not inside .def/.endef */
-
+
SKIP_WHITESPACES();
-
+
def_symbol_in_progress = (symbolS *) obstack_alloc(&notes, sizeof(*def_symbol_in_progress));
memset(def_symbol_in_progress, '\0', sizeof(*def_symbol_in_progress));
-
+
symbol_name = input_line_pointer;
name_end = get_symbol_end();
symbol_name_length = strlen(symbol_name);
symbol_name_copy = xmalloc(symbol_name_length + 1);
strcpy(symbol_name_copy, symbol_name);
-
+
/* Initialize the new symbol */
#ifdef STRIP_UNDERSCORE
S_SET_NAME(def_symbol_in_progress, (*symbol_name_copy == '_'
@@ -1002,13 +1002,13 @@ int what;
def_symbol_in_progress->sy_name_offset = ~0;
def_symbol_in_progress->sy_number = ~0;
def_symbol_in_progress->sy_frag = &zero_address_frag;
-
+
if (S_IS_STRING(def_symbol_in_progress)) {
SF_SET_STRING(def_symbol_in_progress);
} /* "long" name */
-
+
*input_line_pointer = name_end;
-
+
demand_empty_rest_of_line();
return;
} /* obj_coff_def() */
@@ -1023,7 +1023,7 @@ static void obj_coff_endef() {
demand_empty_rest_of_line();
return;
} /* if not inside .def/.endef */
-
+
/* Set the section number according to storage class. */
switch (S_GET_STORAGE_CLASS(def_symbol_in_progress)) {
case C_STRTAG:
@@ -1036,7 +1036,7 @@ static void obj_coff_endef() {
SF_SET_DEBUG(def_symbol_in_progress);
S_SET_SEGMENT(def_symbol_in_progress, SEG_DEBUG);
break;
-
+
case C_EFCN:
SF_SET_LOCAL(def_symbol_in_progress); /* Do not emit this symbol. */
/* intentional fallthrough */
@@ -1045,7 +1045,7 @@ static void obj_coff_endef() {
/* intentional fallthrough */
case C_FCN:
S_SET_SEGMENT(def_symbol_in_progress, SEG_TEXT);
-
+
if (def_symbol_in_progress->sy_symbol.ost_entry.n_name[1] == 'b') { /* .bf */
if (function_lineoff < 0) {
fprintf(stderr, "`.bf' symbol without preceding function\n");
@@ -1055,7 +1055,7 @@ static void obj_coff_endef() {
function_lineoff = -1;
}
break;
-
+
#ifdef C_AUTOARG
case C_AUTOARG:
#endif /* C_AUTOARG */
@@ -1071,25 +1071,25 @@ static void obj_coff_endef() {
SF_SET_DEBUG(def_symbol_in_progress);
S_SET_SEGMENT(def_symbol_in_progress, SEG_ABSOLUTE);
break;
-
+
case C_EXT:
case C_STAT:
- case C_LABEL:
+ case C_LABEL:
/* Valid but set somewhere else (s_comm, s_lcomm, colon) */
break;
-
+
case C_USTATIC:
case C_EXTDEF:
case C_ULABEL:
as_warn("unexpected storage class %d", S_GET_STORAGE_CLASS(def_symbol_in_progress));
break;
} /* switch on storage class */
-
+
/* Now that we have built a debug symbol, try to
find if we should merge with an existing symbol
or not. If a symbol is C_EFCN or SEG_ABSOLUTE or
untagged SEG_DEBUG it never merges. */
-
+
/* Two cases for functions. Either debug followed
by definition or definition followed by debug.
For definition first, we will merge the debug
@@ -1100,19 +1100,19 @@ static void obj_coff_endef() {
symbol into the real symbol. Therefor, let's
presume the debug symbol is a real function
reference. */
-
+
/* FIXME-SOON If for some reason the definition
label/symbol is never seen, this will probably
leave an undefined symbol at link time. */
-
+
if (S_GET_STORAGE_CLASS(def_symbol_in_progress) == C_EFCN
|| (S_GET_SEGMENT(def_symbol_in_progress) == SEG_DEBUG
&& !SF_GET_TAG(def_symbol_in_progress))
|| S_GET_SEGMENT(def_symbol_in_progress) == SEG_ABSOLUTE
|| (symbolP = symbol_find_base(S_GET_NAME(def_symbol_in_progress), DO_NOT_STRIP)) == NULL) {
-
+
symbol_append(def_symbol_in_progress, symbol_lastP, &symbol_rootP, &symbol_lastP);
-
+
} else {
/* This symbol already exists, merge the
newly created symbol into the old one.
@@ -1121,14 +1121,14 @@ static void obj_coff_endef() {
guess that it save a *lot* of space if
the assembly file defines a lot of
symbols. [loic] */
-
+
/* The debug entry (def_symbol_in_progress)
is merged into the previous definition. */
-
+
c_symbol_merge(def_symbol_in_progress, symbolP);
/* FIXME-SOON Should *def_symbol_in_progress be free'd? xoxorich. */
def_symbol_in_progress = symbolP;
-
+
if (SF_GET_FUNCTION(def_symbol_in_progress)
|| SF_GET_TAG(def_symbol_in_progress)) {
/* For functions, and tags, the symbol *must* be where the debug symbol
@@ -1140,51 +1140,51 @@ static void obj_coff_endef() {
} /* if not already in place */
} /* if function */
} /* normal or mergable */
-
+
if (SF_GET_TAG(def_symbol_in_progress)
&& symbol_find_base(S_GET_NAME(def_symbol_in_progress), DO_NOT_STRIP) == NULL) {
tag_insert(S_GET_NAME(def_symbol_in_progress), def_symbol_in_progress);
} /* If symbol is a {structure,union} tag, associate symbol to its name. */
-
+
if (SF_GET_FUNCTION(def_symbol_in_progress)) {
know(sizeof(def_symbol_in_progress) <= sizeof(long));
function_lineoff = c_line_new((long) def_symbol_in_progress, 0, &zero_address_frag);
SF_SET_PROCESS(def_symbol_in_progress);
-
+
if (symbolP == NULL) {
/* That is, if this is the first
time we've seen the function... */
symbol_table_insert(def_symbol_in_progress);
} /* definition follows debug */
} /* Create the line number entry pointing to the function being defined */
-
+
def_symbol_in_progress = NULL;
demand_empty_rest_of_line();
return;
} /* obj_coff_endef() */
-static void obj_coff_dim()
+static void obj_coff_dim()
{
register int dim_index;
-
+
if (def_symbol_in_progress == NULL) {
as_warn(".dim pseudo-op used outside of .def/.endef: ignored.");
demand_empty_rest_of_line();
return;
} /* if not inside .def/.endef */
-
+
S_SET_NUMBER_AUXILIARY(def_symbol_in_progress, 1);
-
+
for (dim_index = 0; dim_index < DIMNUM; dim_index++) {
SKIP_WHITESPACES();
SA_SET_SYM_DIMEN(def_symbol_in_progress, dim_index, get_absolute_expression());
-
+
switch (*input_line_pointer) {
-
+
case ',':
input_line_pointer++;
break;
-
+
default:
as_warn("badly formed .dim directive ignored");
/* intentional fallthrough */
@@ -1194,7 +1194,7 @@ static void obj_coff_dim()
break;
} /* switch on following character */
} /* for each dimension */
-
+
demand_empty_rest_of_line();
return;
} /* obj_coff_dim() */
@@ -1204,10 +1204,10 @@ static void obj_coff_line() {
obj_coff_ln();
return;
} /* if it looks like a stabs style line */
-
+
S_SET_NUMBER_AUXILIARY(def_symbol_in_progress, 1);
SA_SET_SYM_LNNO(def_symbol_in_progress, get_absolute_expression());
-
+
demand_empty_rest_of_line();
return;
} /* obj_coff_line() */
@@ -1218,7 +1218,7 @@ static void obj_coff_size() {
demand_empty_rest_of_line();
return;
} /* if not inside .def/.endef */
-
+
S_SET_NUMBER_AUXILIARY(def_symbol_in_progress, 1);
SA_SET_SYM_SIZE(def_symbol_in_progress, get_absolute_expression());
demand_empty_rest_of_line();
@@ -1231,7 +1231,7 @@ static void obj_coff_scl() {
demand_empty_rest_of_line();
return;
} /* if not inside .def/.endef */
-
+
S_SET_STORAGE_CLASS(def_symbol_in_progress, get_absolute_expression());
demand_empty_rest_of_line();
return;
@@ -1240,27 +1240,27 @@ static void obj_coff_scl() {
static void obj_coff_tag() {
char *symbol_name;
char name_end;
-
+
if (def_symbol_in_progress == NULL) {
as_warn(".tag pseudo-op used outside of .def/.endef ignored.");
demand_empty_rest_of_line();
return;
} /* if not inside .def/.endef */
-
+
S_SET_NUMBER_AUXILIARY(def_symbol_in_progress, 1);
symbol_name = input_line_pointer;
name_end = get_symbol_end();
-
+
/* Assume that the symbol referred to by .tag is always defined. */
/* This was a bad assumption. I've added find_or_make. xoxorich. */
SA_SET_SYM_TAGNDX(def_symbol_in_progress, (long) tag_find_or_make(symbol_name));
if (SA_GET_SYM_TAGNDX(def_symbol_in_progress) == 0L) {
as_warn("tag not found for .tag %s", symbol_name);
} /* not defined */
-
+
SF_SET_TAGGED(def_symbol_in_progress);
*input_line_pointer = name_end;
-
+
demand_empty_rest_of_line();
return;
} /* obj_coff_tag() */
@@ -1271,14 +1271,14 @@ static void obj_coff_type() {
demand_empty_rest_of_line();
return;
} /* if not inside .def/.endef */
-
+
S_SET_DATA_TYPE(def_symbol_in_progress, get_absolute_expression());
-
+
if (ISFCN(S_GET_DATA_TYPE(def_symbol_in_progress)) &&
S_GET_STORAGE_CLASS(def_symbol_in_progress) != C_TPDEF) {
SF_SET_FUNCTION(def_symbol_in_progress);
} /* is a function */
-
+
demand_empty_rest_of_line();
return;
} /* obj_coff_type() */
@@ -1289,18 +1289,18 @@ static void obj_coff_val() {
demand_empty_rest_of_line();
return;
} /* if not inside .def/.endef */
-
+
if (is_name_beginner(*input_line_pointer)) {
char *symbol_name = input_line_pointer;
char name_end = get_symbol_end();
-
+
if (!strcmp(symbol_name, ".")) {
def_symbol_in_progress->sy_frag = frag_now;
S_SET_VALUE(def_symbol_in_progress, obstack_next_free(&frags) - frag_now->fr_literal);
/* If the .val is != from the .def (e.g. statics) */
} else if (strcmp(S_GET_NAME(def_symbol_in_progress), symbol_name)) {
def_symbol_in_progress->sy_forward = symbol_find_or_make(symbol_name);
-
+
/* If the segment is undefined when the forward
reference is solved, then copy the segment id
from the forward symbol. */
@@ -1311,7 +1311,7 @@ static void obj_coff_val() {
} else {
S_SET_VALUE(def_symbol_in_progress, get_absolute_expression());
} /* if symbol based */
-
+
demand_empty_rest_of_line();
return;
} /* obj_coff_val() */
@@ -1330,7 +1330,7 @@ char *name;
symbolS *symbolP;
{
register char * error_string;
-
+
if (*(error_string = hash_jam(tag_hash, name, (char *)symbolP))) {
as_fatal("Inserting \"%s\" into structure table failed: %s",
name, error_string);
@@ -1342,17 +1342,17 @@ static symbolS *tag_find_or_make(name)
char *name;
{
symbolS *symbolP;
-
+
if ((symbolP = tag_find(name)) == NULL) {
symbolP = symbol_new(name,
SEG_UNKNOWN,
0,
&zero_address_frag);
-
+
tag_insert(S_GET_NAME(symbolP), symbolP);
symbol_table_insert(symbolP);
} /* not found */
-
+
return(symbolP);
} /* tag_find_or_make() */
@@ -1372,7 +1372,7 @@ void obj_read_begin_hook() {
know(SYMESZ == AUXESZ);
#endif
tag_init();
-
+
return;
} /* obj_read_begin_hook() */
@@ -1386,18 +1386,18 @@ object_headers *headers;
symbolS *symbolP;
symbolS *symbol_externP = NULL;
symbolS *symbol_extern_lastP = NULL;
-
+
/* Initialize the stack used to keep track of the matching .bb .be */
stack* block_stack = stack_init(512, sizeof(symbolS*));
-
+
/* JF deal with forward references first... */
for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next(symbolP)) {
-
+
if (symbolP->sy_forward) {
S_SET_VALUE(symbolP, (S_GET_VALUE(symbolP)
+ S_GET_VALUE(symbolP->sy_forward)
+ symbolP->sy_forward->sy_frag->fr_address));
-
+
if (
#ifndef TE_I386AIX
SF_GET_GET_SEGMENT(symbolP)
@@ -1408,13 +1408,13 @@ object_headers *headers;
) {
S_SET_SEGMENT(symbolP, S_GET_SEGMENT(symbolP->sy_forward));
} /* forward segment also */
-
+
symbolP->sy_forward=0;
} /* if it has a forward reference */
} /* walk the symbol chain */
-
+
tc_crawl_symbol_chain(headers);
-
+
/* The symbol list should be ordered according to the following sequence
* order :
* . .file symbol
@@ -1425,13 +1425,13 @@ object_headers *headers;
* But this is not mandatory. The only important point is to put the
* undefined symbols at the end of the list.
*/
-
+
if (symbol_rootP == NULL
|| S_GET_STORAGE_CLASS(symbol_rootP) != C_FILE) {
know(!previous_file_symbol);
c_dot_file_symbol("fake");
} /* Is there a .file symbol ? If not insert one at the beginning. */
-
+
/*
* Build up static symbols for .text, .data and .bss
*/
@@ -1446,7 +1446,7 @@ object_headers *headers;
symbol_append(dot_text_symbol, previous_file_symbol,
&symbol_rootP, &symbol_lastP);
#endif /* TE_I386AIX */
-
+
dot_data_symbol = (symbolS*)
c_section_symbol(".data",
H_GET_TEXT_SIZE(headers),
@@ -1458,7 +1458,7 @@ object_headers *headers;
symbol_append(dot_data_symbol, dot_text_symbol,
&symbol_rootP, &symbol_lastP);
#endif /* TE_I386AIX */
-
+
dot_bss_symbol = (symbolS*)
c_section_symbol(".bss",
H_GET_TEXT_SIZE(headers) + H_GET_DATA_SIZE(headers),
@@ -1470,11 +1470,11 @@ object_headers *headers;
symbol_append(dot_bss_symbol, dot_data_symbol,
&symbol_rootP, &symbol_lastP);
#endif /* TE_I386AIX */
-
+
#if defined(DEBUG)
verify_symbol_chain(symbol_rootP, symbol_lastP);
#endif /* DEBUG */
-
+
/* Three traversals of symbol chains here. The
first traversal yanks externals into a temporary
chain, removing the externals from the global
@@ -1488,7 +1488,7 @@ object_headers *headers;
reference preceeds a definition as the definition
has no number at the time we process the
reference. */
-
+
/* Note that symbolP will be NULL at the end of a loop
if an external was at the beginning of the list (it
gets moved off the list). Hence the weird check in
@@ -1500,7 +1500,7 @@ object_headers *headers;
if (!SF_GET_DEBUG(symbolP)) {
/* Debug symbols do not need all this rubbish */
symbolS* real_symbolP;
-
+
/* L* and C_EFCN symbols never merge. */
if (!SF_GET_LOCAL(symbolP)
&& (real_symbolP = symbol_find_base(S_GET_NAME(symbolP), DO_NOT_STRIP))
@@ -1521,13 +1521,13 @@ object_headers *headers;
symbol_remove(symbolP, &symbol_rootP, &symbol_lastP);
symbolP = real_symbolP;
} /* if not local but dup'd */
-
+
if (flagseen['R'] && (S_GET_SEGMENT(symbolP) == SEG_DATA)) {
S_SET_SEGMENT(symbolP, SEG_TEXT);
} /* push data into text */
-
+
S_SET_VALUE(symbolP, S_GET_VALUE(symbolP) + symbolP->sy_frag->fr_address);
-
+
if (!S_IS_DEFINED(symbolP) && !SF_GET_LOCAL(symbolP)) {
S_SET_EXTERNAL(symbolP);
} else if (S_GET_STORAGE_CLASS(symbolP) == C_NULL) {
@@ -1537,7 +1537,7 @@ object_headers *headers;
S_SET_STORAGE_CLASS(symbolP, C_STAT);
}
} /* no storage class yet */
-
+
/* Mainly to speed up if not -g */
if (SF_GET_PROCESS(symbolP)) {
/* Handle the nested blocks auxiliary info. */
@@ -1560,11 +1560,11 @@ object_headers *headers;
if (last_functionP == (symbolS*)0 &&
SF_GET_FUNCTION(symbolP)) {
last_functionP = symbolP;
-
+
if (S_GET_NUMBER_AUXILIARY(symbolP) < 1) {
S_SET_NUMBER_AUXILIARY(symbolP, 1);
} /* make it at least 1 */
-
+
/* Clobber possible stale .dim information. */
memset(symbolP->sy_symbol.ost_auxent[0].x_sym.x_fcnary.x_ary.x_dimen,
'\0', sizeof(symbolP->sy_symbol.ost_auxent[0].x_sym.x_fcnary.x_ary.x_dimen));
@@ -1587,7 +1587,7 @@ object_headers *headers;
/* First descriptor of a structure must point to
the first slot after the structure description. */
last_tagP = symbolP;
-
+
} else if (S_GET_STORAGE_CLASS(symbolP) == C_EOS) {
/* +2 take in account the current symbol */
SA_SET_SYM_ENDNDX(last_tagP, symbol_number + 2);
@@ -1597,7 +1597,7 @@ object_headers *headers;
S_SET_VALUE(symbolP, 0);
} /* no one points at the first .file symbol */
} /* if debug or tag or eos or file */
-
+
/* We must put the external symbols apart. The loader
does not bomb if we do not. But the references in
the endndx field for a .bb symbol are not corrected
@@ -1608,13 +1608,13 @@ object_headers *headers;
[22] .be
ld will move the symbol 21 to the end of the list but
endndx will still be 22 instead of 21. */
-
-
+
+
if (SF_GET_LOCAL(symbolP)) {
/* remove C_EFCN and LOCAL (L...) symbols */
/* next pointer remains valid */
symbol_remove(symbolP, &symbol_rootP, &symbol_lastP);
-
+
} else if (
#ifdef TE_I386AIX
S_GET_STORAGE_CLASS(symbolP) == C_EXT && !SF_GET_FUNCTION(symbolP)
@@ -1624,7 +1624,7 @@ object_headers *headers;
) {
/* if external, Remove from the list */
symbolS *hold = symbol_previous(symbolP);
-
+
symbol_remove(symbolP, &symbol_rootP, &symbol_lastP);
symbol_clear_list_pointers(symbolP);
symbol_append(symbolP, symbol_extern_lastP, &symbol_externP, &symbol_extern_lastP);
@@ -1636,19 +1636,19 @@ object_headers *headers;
} else {
symbolP->sy_name_offset = 0;
} /* fix "long" names */
-
+
symbolP->sy_number = symbol_number;
symbol_number += 1 + S_GET_NUMBER_AUXILIARY(symbolP);
} /* if local symbol */
} /* traverse the symbol list */
-
+
for (symbolP = symbol_externP; symbol_externP;) {
symbolS *tmp = symbol_externP;
-
+
/* append */
symbol_remove(tmp, &symbol_externP, &symbol_extern_lastP);
symbol_append(tmp, symbol_lastP, &symbol_rootP, &symbol_lastP);
-
+
/* and process */
if (SF_GET_STRING(tmp)) {
tmp->sy_name_offset = string_byte_count;
@@ -1656,31 +1656,31 @@ object_headers *headers;
} else {
tmp->sy_name_offset = 0;
} /* fix "long" names */
-
+
tmp->sy_number = symbol_number;
symbol_number += 1 + S_GET_NUMBER_AUXILIARY(tmp);
} /* append the entire extern chain */
-
+
/* When a tag reference preceeds the tag definition,
the definition will not have a number at the time
we process the reference during the first
traversal. Thus, a second traversal. */
-
+
for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next(symbolP)) {
if (SF_GET_TAGGED(symbolP)) {
SA_SET_SYM_TAGNDX(symbolP, ((symbolS*) SA_GET_SYM_TAGNDX(symbolP))->sy_number);
} /* If the symbol has a tagndx entry, resolve it */
} /* second traversal */
-
+
know(symbol_externP == NULL);
know(symbol_extern_lastP == NULL);
-
+
/* FIXME-SOMEDAY I'm counting line no's here so we know what to put in the section
headers, and I'm resolving the addresses since I'm not sure how to
do it later. I am NOT resolving the linno's representing functions.
Their symbols need a fileptr pointing to this linno when emitted.
Thus, I resolve them on emit. xoxorich. */
-
+
for (lineP = lineno_rootP; lineP; lineP = lineP->next) {
if (lineP->line.l_lnno > 0) {
lineP->line.l_addr.l_paddr += ((fragS*)lineP->frag)->fr_address;
@@ -1689,9 +1689,9 @@ object_headers *headers;
}
text_lineno_number++;
} /* for each line number */
-
+
H_SET_SYMBOL_TABLE_SIZE(headers, symbol_number);
-
+
return;
} /* obj_crawl_symbol_chain() */
@@ -1703,7 +1703,7 @@ void obj_emit_strings(where)
char **where;
{
symbolS *symbolP;
-
+
#ifdef CROSS_COMPILE
/* Gotta do md_ byte-ordering stuff for string_byte_count first - KWK */
md_number_to_chars(*where, string_byte_count, sizeof(string_byte_count));
@@ -1711,13 +1711,13 @@ char **where;
#else /* CROSS_COMPILE */
append(where, (char *) &string_byte_count, (unsigned long) sizeof(string_byte_count));
#endif /* CROSS_COMPILE */
-
+
for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next(symbolP)) {
if (SF_GET_STRING(symbolP)) {
append(where, S_GET_NAME(symbolP), (unsigned long)(strlen(S_GET_NAME(symbolP)) + 1));
} /* if it has a string */
} /* walk the symbol chain */
-
+
return;
} /* obj_emit_strings() */
@@ -1730,7 +1730,7 @@ object_headers *headers;
H_SET_MAGIC_NUMBER(headers, FILE_HEADER_MAGIC);
H_SET_ENTRY_POINT(headers, 0);
-
+
/* FIXME-SOMEDAY this should be done at
fixup_segment time but I'm going to wait until I
do multiple segments. xoxorich. */
@@ -1750,16 +1750,16 @@ object_headers *headers;
++text_relocation_number;
}
#endif
-
+
} /* if not yet fixed */
} /* for each fix */
-
+
SA_SET_SCN_NRELOC(dot_text_symbol, text_relocation_number);
/* Assign the number of line number entries for the text section */
SA_SET_SCN_NLINNO(dot_text_symbol, text_lineno_number);
/* Assign the size of the section */
SA_SET_SCN_SCNLEN(dot_text_symbol, H_GET_TEXT_SIZE(headers));
-
+
for (fixP = data_fix_root; fixP; fixP = fixP->fx_next) {
if (fixP->fx_addsy) {
++data_relocation_number;
@@ -1770,28 +1770,28 @@ object_headers *headers;
++data_relocation_number;
}
#endif
-
+
} /* for each fix */
-
-
+
+
SA_SET_SCN_NRELOC(dot_data_symbol, data_relocation_number);
/* Assign the size of the section */
SA_SET_SCN_SCNLEN(dot_data_symbol, H_GET_DATA_SIZE(headers));
-
+
/* Assign the size of the section */
SA_SET_SCN_SCNLEN(dot_bss_symbol, H_GET_BSS_SIZE(headers));
-
+
/* pre write hook can add relocs (for 960 and 29k coff) so */
headers->relocation_size = text_relocation_number * RELSZ +
data_relocation_number *RELSZ;
-
-
-
+
+
+
/* Fill in extra coff fields */
-
+
/* Initialize general line number information. */
H_SET_LINENO_SIZE(headers, text_lineno_number * LINESZ);
-
+
/* filehdr */
H_SET_FILE_MAGIC_NUMBER(headers, FILE_HEADER_MAGIC);
H_SET_NUMBER_OF_SECTIONS(headers, 3); /* text+data+bss */
@@ -1812,7 +1812,7 @@ object_headers *headers;
#endif
/* symbol table size allready set */
H_SET_SIZEOF_OPTIONAL_HEADER(headers, OBJ_COFF_AOUTHDRSZ);
-
+
/* do not added the F_RELFLG for the standard COFF.
* The AIX linker complain on file with relocation info striped flag.
*/
@@ -1823,14 +1823,14 @@ object_headers *headers;
H_SET_FLAGS(headers, (text_lineno_number == 0 ? F_LNNO : 0)
| ((text_relocation_number + data_relocation_number) ? 0 : F_RELFLG)
| BYTE_ORDERING);
-#endif
+#endif
/* aouthdr */
/* magic number allready set */
H_SET_VERSION_STAMP(headers, 0);
/* Text, data, bss size; entry point; text_start and data_start are already set */
-
+
/* Build section headers */
-
+
c_section_header(&text_section_header,
".text",
0,
@@ -1845,7 +1845,7 @@ object_headers *headers;
SA_GET_SCN_NRELOC(dot_text_symbol),
text_lineno_number,
section_alignment[(int) SEG_TEXT]);
-
+
c_section_header(&data_section_header,
".data",
H_GET_TEXT_SIZE(headers),
@@ -1861,7 +1861,7 @@ object_headers *headers;
SA_GET_SCN_NRELOC(dot_data_symbol),
0, /* No line number information */
section_alignment[(int) SEG_DATA]);
-
+
c_section_header(&bss_section_header,
".bss",
H_GET_TEXT_SIZE(headers) + H_GET_DATA_SIZE(headers),
@@ -1872,7 +1872,7 @@ object_headers *headers;
0, /* No relocation information */
0, /* No line number information */
section_alignment[(int) SEG_BSS]);
-
+
return;
} /* obj_pre_write_hook() */
@@ -1888,11 +1888,11 @@ int what;
int saved_type = 0;
long longint;
symbolS *symbolP = 0;
-
+
if (what == 's') {
string = demand_copy_C_string(&length);
SKIP_WHITESPACE();
-
+
if (*input_line_pointer == ',') {
input_line_pointer++;
} else {
@@ -1900,7 +1900,7 @@ int what;
goof = 1;
} /* better be a comma */
} /* skip the string */
-
+
/*
* Input_line_pointer->after ','. String->symbol name.
*/
@@ -1911,7 +1911,7 @@ int what;
input_line_pointer--; /* Backup over a non-',' char. */
} /* on error */
} /* no error */
-
+
if (!goof) {
if (get_absolute_expression_and_terminator(&longint) != ',') {
as_bad("I want a comma after the n_other expression");
@@ -1919,10 +1919,10 @@ int what;
input_line_pointer--; /* Backup over a non-',' char. */
} /* on error */
} /* no error */
-
+
if (!goof) {
get_absolute_expression();
-
+
if (what == 's' || what == 'n') {
if (*input_line_pointer != ',') {
as_bad("I want a comma after the n_desc expression");
@@ -1932,9 +1932,9 @@ int what;
} /* on goof */
} /* not stabd */
} /* no error */
-
+
expression(&e);
-
+
if (goof) {
ignore_rest_of_line();
} else {
@@ -1952,7 +1952,7 @@ symbolS *s;
void symbol_dump() {
symbolS *symbolP;
-
+
for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next(symbolP)) {
printf("%3ld: 0x%lx \"%s\" type = %ld, class = %d, segment = %d\n",
symbolP->sy_number,
@@ -1962,7 +1962,7 @@ void symbol_dump() {
S_GET_STORAGE_CLASS(symbolP),
(int) S_GET_SEGMENT(symbolP));
} /* traverse symbols */
-
+
return;
} /* symbol_dump() */
#endif /* DEBUG */
diff --git a/gnu/usr.bin/as/config/obj-coff.h b/gnu/usr.bin/as/config/obj-coff.h
index 9720d5e..3f1f7ea 100644
--- a/gnu/usr.bin/as/config/obj-coff.h
+++ b/gnu/usr.bin/as/config/obj-coff.h
@@ -1,18 +1,18 @@
/* coff object file format
Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
-
+
This file is part of GAS.
-
+
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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -28,7 +28,7 @@
#include "bfd.h"
#include "coff/a29k.h"
-/* This internal_lineno crap is to stop namespace pollution from the bfd internal
+/* This internal_lineno crap is to stop namespace pollution from the bfd internal
coff headerfile. */
#define internal_lineno bfd_internal_lineno
@@ -45,7 +45,7 @@
#define SYMENT struct internal_syment
#define AUXENT union internal_auxent
#define SCNHDR struct internal_scnhdr
- #define LINENO struct bfd_internal_lineno
+ #define LINENO struct bfd_internal_lineno
#define AOUTHDR struct internal_aouthdr
#define FILHDR struct internal_filehdr
#define AOUTHDRSZ sizeof(struct external_aouthdr)
@@ -90,12 +90,12 @@ extern bfd *stdoutput;
/* Define some processor dependent values according to the processor we are on. */
#ifdef TC_M68K
-
+
#define BYTE_ORDERING F_AR32W /* See filehdr.h for more info. */
#ifndef FILE_HEADER_MAGIC
#define FILE_HEADER_MAGIC MC68MAGIC /* ... */
#endif /* FILE_HEADER_MAGIC */
-
+
#elif defined(TC_I386)
#define BYTE_ORDERING F_AR32WR /* See filehdr.h for more info. */
@@ -119,12 +119,12 @@ extern bfd *stdoutput;
#else
you lose
-#endif
-
+#endif
+
#ifndef OBJ_COFF_MAX_AUXENTRIES
#define OBJ_COFF_MAX_AUXENTRIES 1
#endif /* OBJ_COFF_MAX_AUXENTRIES */
-
+
extern const short seg_N_TYPE[];
extern const segT N_TYPE_seg[];
@@ -161,7 +161,7 @@ typedef struct {
/* Symbol table macros and constants */
-/* Possible and usefull section number in symbol table
+/* Possible and usefull section number in symbol table
* The values of TEXT, DATA and BSS may not be portable.
*/
@@ -215,7 +215,7 @@ typedef struct {
/* The zeroes if symbol name is longer than 8 chars */
#define S_GET_ZEROES(s) ((s)->sy_symbol.ost_entry.n_zeroes)
/* The value of the symbol */
-#define S_GET_VALUE(s) ((unsigned) ((s)->sy_symbol.ost_entry.n_value))
+#define S_GET_VALUE(s) ((unsigned) ((s)->sy_symbol.ost_entry.n_value))
/* The numeric value of the segment */
#define S_GET_SEGMENT(s) (N_TYPE_seg[(s)->sy_symbol.ost_entry.n_scnum+4])
/* The data type */
@@ -546,7 +546,7 @@ void c_section_header(
#else
SCNHDR *header,
#endif
-
+
char *name,
long core_address,
long size,
diff --git a/gnu/usr.bin/as/config/obj-coffbfd.c b/gnu/usr.bin/as/config/obj-coffbfd.c
index d69c7a0..352893a 100644
--- a/gnu/usr.bin/as/config/obj-coffbfd.c
+++ b/gnu/usr.bin/as/config/obj-coffbfd.c
@@ -1,26 +1,26 @@
/* coff object file format with bfd
Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
-
+
This file is part of GAS.
-
+
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, 675 Mass Ave, Cambridge, MA 02139, USA. */
/*
-
+
How does this releate to the rest of GAS ?
-
+
Well, all the other files in gas are more or less a black box. It
takes care of opening files, parsing command lines, stripping blanks
etc etc. This module gets a chance to register what it wants to do by
@@ -28,11 +28,11 @@
change is write_object_file. This runs through all the data
structures that gas builds, and outputs the file in the format of our
choice.
-
+
Hacked for BFDness by steve chamberlain
-
+
This object module now supports the Hitachi H8/300 and the AMD 29k
-
+
sac@cygnus.com
*/
@@ -44,7 +44,7 @@
/* This vector is used to turn an internal segment into a section #
- suitable for insertion into a coff symbol table
+ suitable for insertion into a coff symbol table
*/
const short seg_N_TYPE[] = { /* in: segT out: N_TYPE bits */
@@ -85,7 +85,7 @@ int text_lineno_number = 0;
/* Add 4 to the real value to get the index and compensate the
negatives. This vector is used by S_GET_SEGMENT to turn a coff
- section number into a segment number
+ section number into a segment number
*/
static symbolS *previous_file_symbol = NULL;
void c_symbol_merge();
@@ -168,42 +168,42 @@ const pseudo_typeS obj_pseudo_table[] = {
-/* Section stuff
-
+/* Section stuff
+
We allow more than just the standard 3 sections, infact, we allow
10 sections, (though the usual three have to be there).
-
+
This structure performs the mappings for us:
-
+
*/
-/* OBS stuff
+/* OBS stuff
static struct internal_scnhdr bss_section_header;
struct internal_scnhdr data_section_header;
struct internal_scnhdr text_section_header;
-
+
const segT N_TYPE_seg[32] =
{
-
+
};
-
+
*/
#define N_SEG 32
-typedef struct
+typedef struct
{
- segT seg_t;
- int i;
+ segT seg_t;
+ int i;
} seg_info_type;
-seg_info_type seg_info_off_by_4[N_SEG] =
+seg_info_type seg_info_off_by_4[N_SEG] =
{
{SEG_PTV, },
{SEG_NTV, },
{SEG_DEBUG, },
{SEG_ABSOLUTE, },
{SEG_UNKNOWN, },
- {SEG_E0},
+ {SEG_E0},
{SEG_E1},
{SEG_E2},
{SEG_E3},
@@ -211,7 +211,7 @@ seg_info_type seg_info_off_by_4[N_SEG] =
{SEG_E5},
{SEG_E6},
{SEG_E7},
- {SEG_E8},
+ {SEG_E8},
{SEG_E9},
{15},
{16},
@@ -228,21 +228,21 @@ seg_info_type seg_info_off_by_4[N_SEG] =
#define SEG_INFO_FROM_SEG_NUMBER(x) (seg_info_off_by_4[(x)])
-relax_addressT
+relax_addressT
DEFUN(relax_align,(address, alignment),
register relax_addressT address AND
register long alignment )
{
relax_addressT mask;
relax_addressT new_address;
-
+
mask = ~ ( (~0) << alignment );
new_address = (address + mask) & (~ mask);
return (new_address - address);
} /* relax_align() */
-segT
+segT
DEFUN(s_get_segment,(x) ,
symbolS* x)
{
@@ -257,11 +257,11 @@ static unsigned int DEFUN(size_section,(abfd, idx),
bfd *abfd AND
unsigned int idx)
{
-
+
unsigned int size = 0;
fragS *frag = segment_info[idx].frchainP->frch_root;
while (frag) {
- if (frag->fr_address != size) {
+ if (frag->fr_address != size) {
printf("Out of step\n");
size = frag->fr_address;
}
@@ -286,26 +286,26 @@ static unsigned int DEFUN(count_entries_in_chain,(idx),
{
unsigned int nrelocs;
fixS *fixup_ptr;
-
+
/* Count the relocations */
fixup_ptr = segment_info[idx].fix_root;
nrelocs = 0;
- while (fixup_ptr != (fixS *)NULL)
+ while (fixup_ptr != (fixS *)NULL)
{
- if (TC_COUNT_RELOC(fixup_ptr))
+ if (TC_COUNT_RELOC(fixup_ptr))
{
-
+
#ifdef TC_A29K
-
- if (fixup_ptr->fx_r_type == RELOC_CONSTH)
+
+ if (fixup_ptr->fx_r_type == RELOC_CONSTH)
nrelocs+=2;
- else
- nrelocs++;
+ else
+ nrelocs++;
#else
nrelocs++;
#endif
}
-
+
fixup_ptr = fixup_ptr->fx_next;
}
return nrelocs;
@@ -318,12 +318,12 @@ void DEFUN(do_relocs_for,(abfd, file_cursor),
{
unsigned int nrelocs;
unsigned int idx;
-
- for (idx = SEG_E0; idx < SEG_E9; idx++)
+
+ for (idx = SEG_E0; idx < SEG_E9; idx++)
{
- if (segment_info[idx].scnhdr.s_name[0])
+ if (segment_info[idx].scnhdr.s_name[0])
{
-
+
struct external_reloc *ext_ptr;
struct external_reloc *external_reloc_vec;
unsigned int external_reloc_size;
@@ -334,82 +334,82 @@ void DEFUN(do_relocs_for,(abfd, file_cursor),
external_reloc_size = nrelocs * RELSZ;
external_reloc_vec =
(struct external_reloc*)malloc(external_reloc_size);
-
-
-
+
+
+
ext_ptr = external_reloc_vec;
-
+
/* Fill in the internal coff style reloc struct from the
internal fix list */
while (fix_ptr)
{
symbolS *symbol_ptr;
struct internal_reloc intr;
-
+
/* Only output some of the relocations */
if (TC_COUNT_RELOC(fix_ptr))
{
#ifdef TC_RELOC_MANGLE
TC_RELOC_MANGLE(fix_ptr, &intr, base);
-
+
#else
symbolS *dot;
symbol_ptr = fix_ptr->fx_addsy;
-
+
intr.r_type = TC_COFF_FIX2RTYPE(fix_ptr);
intr.r_vaddr =
base + fix_ptr->fx_frag->fr_address + fix_ptr->fx_where ;
-
+
intr.r_offset = fix_ptr->fx_offset;
-
+
intr.r_offset = 0;
-
+
/* Turn the segment of the symbol into an offset
*/
- if (symbol_ptr)
+ if (symbol_ptr)
{
dot = segment_info[S_GET_SEGMENT(symbol_ptr)].dot;
if (dot)
{
intr.r_symndx = dot->sy_number;
}
- else
+ else
{
intr.r_symndx = symbol_ptr->sy_number;
}
-
+
}
- else
+ else
{
intr.r_symndx = -1;
-
-
+
+
}
#endif
-
+
(void)bfd_coff_swap_reloc_out(abfd, &intr, ext_ptr);
ext_ptr++;
-
+
#if defined(TC_A29K)
/* The 29k has a special kludge for the high 16 bit reloc.
Two relocations are emmited, R_IHIHALF, and
R_IHCONST. The second one doesn't contain a symbol,
but uses the value for offset */
-
+
if (intr.r_type == R_IHIHALF)
{
/* now emit the second bit */
- intr.r_type = R_IHCONST;
+ intr.r_type = R_IHCONST;
intr.r_symndx = fix_ptr->fx_addnumber;
(void)bfd_coff_swap_reloc_out(abfd,&intr,ext_ptr);
ext_ptr++;
}
#endif
}
-
+
fix_ptr = fix_ptr->fx_next;
}
-
+
/* Write out the reloc table */
segment_info[idx].scnhdr.s_relptr = *file_cursor;
segment_info[idx].scnhdr.s_nreloc = nrelocs;
@@ -422,31 +422,31 @@ void DEFUN(do_relocs_for,(abfd, file_cursor),
/* run through a frag chain and write out the data to go with it, fill
- in the scnhdrs with the info on the file postions
+ in the scnhdrs with the info on the file postions
*/
static void DEFUN(fill_section,(abfd, filehdr, file_cursor),
bfd *abfd AND
struct internal_filehdr *filehdr AND
unsigned long *file_cursor)
{
-
+
unsigned int i;
unsigned int paddr = 0;
-
- for (i = SEG_E0; i < SEG_UNKNOWN; i++)
- {
+
+ for (i = SEG_E0; i < SEG_UNKNOWN; i++)
+ {
unsigned int offset = 0;
-
+
struct internal_scnhdr *s = &( segment_info[i].scnhdr);
-
- if (s->s_name[0])
+
+ if (s->s_name[0])
{
fragS *frag = segment_info[i].frchainP->frch_root;
char *buffer = malloc(s->s_size);
s->s_scnptr = *file_cursor;
s->s_paddr = paddr;
s->s_vaddr = paddr;
-
+
s->s_flags = STYP_REG;
if (strcmp(s->s_name,".text") == 0)
s->s_flags |= STYP_TEXT;
@@ -454,54 +454,54 @@ static void DEFUN(fill_section,(abfd, filehdr, file_cursor),
s->s_flags |= STYP_DATA;
else if (strcmp(s->s_name,".bss") == 0)
s->s_flags |= STYP_BSS | STYP_NOLOAD;
-
+
while (frag) {
unsigned int fill_size;
switch (frag->fr_type) {
-
+
case rs_fill:
case rs_align:
case rs_org:
- if (frag->fr_fix)
+ if (frag->fr_fix)
{
memcpy(buffer + frag->fr_address,
frag->fr_literal,
frag->fr_fix);
offset += frag->fr_fix;
}
-
+
fill_size = frag->fr_var;
- if (fill_size)
+ if (fill_size)
{
unsigned int count ;
unsigned int off = frag->fr_fix;
- for (count = frag->fr_offset; count; count--)
+ for (count = frag->fr_offset; count; count--)
{
memcpy(buffer + frag->fr_address + off,
frag->fr_literal + frag->fr_fix,
fill_size);
off += fill_size;
offset += fill_size;
-
+
}
-
+
}
break;
- default:
+ default:
abort();
}
frag = frag->fr_next;
}
-
-
+
+
bfd_write(buffer, s->s_size,1,abfd);
free(buffer);
-
+
*file_cursor += s->s_size;
paddr += s->s_size;
- }
+ }
}
-
+
}
@@ -509,7 +509,7 @@ static void DEFUN(fill_section,(abfd, filehdr, file_cursor),
/* Coff file generation & utilities */
-static void
+static void
DEFUN(coff_header_append,(abfd, filehdr, aouthdr),
bfd *abfd AND
struct internal_filehdr *filehdr AND
@@ -518,23 +518,23 @@ static void
unsigned int i;
char buffer[1000];
char buffero[1000];
-
+
bfd_seek(abfd, 0, 0);
-#if 0
+#if 0
filehdr.f_opthdr = bfd_coff_swap_aouthdr_out(abfd, aouthdr,
buffero);
#else
filehdr->f_opthdr = 0;
#endif
i = bfd_coff_swap_filehdr_out(abfd, filehdr, buffer);
-
+
bfd_write(buffer, i ,1, abfd);
bfd_write(buffero, filehdr->f_opthdr, 1, abfd);
-
- for (i = SEG_E0; i < SEG_E9; i++)
+
+ for (i = SEG_E0; i < SEG_E9; i++)
{
- if (segment_info[i].scnhdr.s_name[0])
- {
+ if (segment_info[i].scnhdr.s_name[0])
+ {
unsigned int size =
bfd_coff_swap_scnhdr_out(abfd,
&(segment_info[i].scnhdr),
@@ -553,22 +553,22 @@ char *
{
unsigned int numaux = symbolP->sy_symbol.ost_entry.n_numaux;
unsigned int i;
-
+
/* Turn any symbols with register attributes into abs symbols */
- if (S_GET_SEGMENT(symbolP) == SEG_REGISTER)
+ if (S_GET_SEGMENT(symbolP) == SEG_REGISTER)
{
S_SET_SEGMENT(symbolP, SEG_ABSOLUTE);
}
/* At the same time, relocate all symbols to their output value */
-
+
S_SET_VALUE(symbolP,
- segment_info[S_GET_SEGMENT(symbolP)].scnhdr.s_paddr
+ segment_info[S_GET_SEGMENT(symbolP)].scnhdr.s_paddr
+ S_GET_VALUE(symbolP));
-
+
where += bfd_coff_swap_sym_out(abfd, &symbolP->sy_symbol.ost_entry,
where);
-
- for (i = 0; i < numaux; i++)
+
+ for (i = 0; i < numaux; i++)
{
where += bfd_coff_swap_aux_out(abfd,
&symbolP->sy_symbol.ost_auxent[i],
@@ -577,8 +577,8 @@ char *
where);
}
return where;
-
-}
+
+}
@@ -587,7 +587,7 @@ void obj_symbol_new_hook(symbolP)
symbolS *symbolP;
{
char underscore = 0; /* Symbol has leading _ */
-
+
/* Effective symbol */
/* Store the pointer in the offset. */
S_SET_ZEROES(symbolP, 0L);
@@ -598,7 +598,7 @@ symbolS *symbolP;
symbolP->sy_symbol.ost_flags = 0;
/* Auxiliary entries */
memset((char*) &symbolP->sy_symbol.ost_auxent[0], '\0', AUXESZ);
-
+
#ifdef STRIP_UNDERSCORE
/* Remove leading underscore at the beginning of the symbol.
* This is to be compatible with the standard librairies.
@@ -608,12 +608,12 @@ symbolS *symbolP;
S_SET_NAME(symbolP, S_GET_NAME(symbolP) + 1);
} /* strip underscore */
#endif /* STRIP_UNDERSCORE */
-
+
if (S_IS_STRING(symbolP))
SF_SET_STRING(symbolP);
if (!underscore && S_IS_LOCAL(symbolP))
SF_SET_LOCAL(symbolP);
-
+
return;
} /* obj_symbol_new_hook() */
@@ -623,7 +623,7 @@ unsigned long chunk_size;
unsigned long element_size;
{
stack* st;
-
+
if ((st = (stack*)malloc(sizeof(stack))) == (stack*)0)
return (stack*)0;
if ((st->data = malloc(chunk_size)) == (char*)0) {
@@ -665,7 +665,7 @@ stack* st;
st->pointer = 0;
return (char*)0;
}
-
+
return st->data + st->pointer;
}
@@ -680,16 +680,16 @@ stack* st;
* Handle .ln directives.
*/
-static void obj_coff_ln()
+static void obj_coff_ln()
{
int l;
-
+
if (def_symbol_in_progress != NULL) {
as_warn(".ln pseudo-op inside .def/.endef: ignored.");
demand_empty_rest_of_line();
return;
} /* wrong context */
-
+
c_line_new(0,
obstack_next_free(&frags) - frag_now->fr_literal,
l = get_absolute_expression(),
@@ -697,12 +697,12 @@ static void obj_coff_ln()
#ifndef NO_LISTING
{
extern int listing;
-
- if (listing)
+
+ if (listing)
{
listing_source_line(l + line_base - 1);
}
-
+
}
#endif
demand_empty_rest_of_line();
@@ -728,7 +728,7 @@ static void obj_coff_ln()
*input_line_pointer == '\t') \
input_line_pointer++;
-static void
+static void
DEFUN(obj_coff_def,(what),
int what)
{
@@ -739,24 +739,24 @@ static void
/*$char* directiveP;$ */ /* Name of the pseudo opcode */
/*$char directive[MAX_DIRECTIVE];$ */ /* Backup of the directive */
/*$char end = 0;$ */ /* If 1, stop parsing */
-
+
if (def_symbol_in_progress != NULL) {
as_warn(".def pseudo-op used inside of .def/.endef: ignored.");
demand_empty_rest_of_line();
return;
} /* if not inside .def/.endef */
-
+
SKIP_WHITESPACES();
-
+
def_symbol_in_progress = (symbolS *) obstack_alloc(&notes, sizeof(*def_symbol_in_progress));
memset(def_symbol_in_progress, '\0', sizeof(*def_symbol_in_progress));
-
+
symbol_name = input_line_pointer;
name_end = get_symbol_end();
symbol_name_length = strlen(symbol_name);
symbol_name_copy = xmalloc(symbol_name_length + 1);
strcpy(symbol_name_copy, symbol_name);
-
+
/* Initialize the new symbol */
#ifdef STRIP_UNDERSCORE
S_SET_NAME(def_symbol_in_progress, (*symbol_name_copy == '_'
@@ -769,20 +769,20 @@ static void
def_symbol_in_progress->sy_name_offset = ~0;
def_symbol_in_progress->sy_number = ~0;
def_symbol_in_progress->sy_frag = &zero_address_frag;
-
+
if (S_IS_STRING(def_symbol_in_progress)) {
SF_SET_STRING(def_symbol_in_progress);
} /* "long" name */
-
+
*input_line_pointer = name_end;
-
+
demand_empty_rest_of_line();
return;
} /* obj_coff_def() */
unsigned int dim_index;
-static void
- DEFUN_VOID(obj_coff_endef)
+static void
+ DEFUN_VOID(obj_coff_endef)
{
symbolS *symbolP = 0;
/* DIM BUG FIX sac@cygnus.com */
@@ -792,7 +792,7 @@ static void
demand_empty_rest_of_line();
return;
} /* if not inside .def/.endef */
-
+
/* Set the section number according to storage class. */
switch (S_GET_STORAGE_CLASS(def_symbol_in_progress)) {
case C_STRTAG:
@@ -805,7 +805,7 @@ static void
SF_SET_DEBUG(def_symbol_in_progress);
S_SET_SEGMENT(def_symbol_in_progress, SEG_DEBUG);
break;
-
+
case C_EFCN:
SF_SET_LOCAL(def_symbol_in_progress); /* Do not emit this symbol. */
/* intentional fallthrough */
@@ -814,7 +814,7 @@ static void
/* intentional fallthrough */
case C_FCN:
S_SET_SEGMENT(def_symbol_in_progress, SEG_E0);
-
+
if (def_symbol_in_progress->sy_symbol.ost_entry.n_name[1] == 'b') { /* .bf */
if (function_lineoff < 0) {
fprintf(stderr, "`.bf' symbol without preceding function\n");
@@ -824,7 +824,7 @@ static void
function_lineoff = -1;
}
break;
-
+
#ifdef C_AUTOARG
case C_AUTOARG:
#endif /* C_AUTOARG */
@@ -840,25 +840,25 @@ static void
SF_SET_DEBUG(def_symbol_in_progress);
S_SET_SEGMENT(def_symbol_in_progress, SEG_ABSOLUTE);
break;
-
+
case C_EXT:
case C_STAT:
- case C_LABEL:
+ case C_LABEL:
/* Valid but set somewhere else (s_comm, s_lcomm, colon) */
break;
-
+
case C_USTATIC:
case C_EXTDEF:
case C_ULABEL:
as_warn("unexpected storage class %d", S_GET_STORAGE_CLASS(def_symbol_in_progress));
break;
} /* switch on storage class */
-
+
/* Now that we have built a debug symbol, try to
find if we should merge with an existing symbol
or not. If a symbol is C_EFCN or SEG_ABSOLUTE or
untagged SEG_DEBUG it never merges. */
-
+
/* Two cases for functions. Either debug followed
by definition or definition followed by debug.
For definition first, we will merge the debug
@@ -869,19 +869,19 @@ static void
symbol into the real symbol. Therefor, let's
presume the debug symbol is a real function
reference. */
-
+
/* FIXME-SOON If for some reason the definition
label/symbol is never seen, this will probably
leave an undefined symbol at link time. */
-
+
if (S_GET_STORAGE_CLASS(def_symbol_in_progress) == C_EFCN
|| (S_GET_SEGMENT(def_symbol_in_progress) == SEG_DEBUG
&& !SF_GET_TAG(def_symbol_in_progress))
|| S_GET_SEGMENT(def_symbol_in_progress) == SEG_ABSOLUTE
|| (symbolP = symbol_find_base(S_GET_NAME(def_symbol_in_progress), DO_NOT_STRIP)) == NULL) {
-
+
symbol_append(def_symbol_in_progress, symbol_lastP, &symbol_rootP, &symbol_lastP);
-
+
} else {
/* This symbol already exists, merge the
newly created symbol into the old one.
@@ -890,14 +890,14 @@ static void
guess that it save a *lot* of space if
the assembly file defines a lot of
symbols. [loic] */
-
+
/* The debug entry (def_symbol_in_progress)
is merged into the previous definition. */
-
+
c_symbol_merge(def_symbol_in_progress, symbolP);
/* FIXME-SOON Should *def_symbol_in_progress be free'd? xoxorich. */
def_symbol_in_progress = symbolP;
-
+
if (SF_GET_FUNCTION(def_symbol_in_progress)
|| SF_GET_TAG(def_symbol_in_progress)) {
/* For functions, and tags, the symbol *must* be where the debug symbol
@@ -909,59 +909,59 @@ static void
} /* if not already in place */
} /* if function */
} /* normal or mergable */
-
+
if (SF_GET_TAG(def_symbol_in_progress)
&& symbol_find_base(S_GET_NAME(def_symbol_in_progress), DO_NOT_STRIP) == NULL) {
tag_insert(S_GET_NAME(def_symbol_in_progress), def_symbol_in_progress);
} /* If symbol is a {structure,union} tag, associate symbol to its name. */
-
+
if (SF_GET_FUNCTION(def_symbol_in_progress)) {
know(sizeof(def_symbol_in_progress) <= sizeof(long));
- function_lineoff
+ function_lineoff
= c_line_new(def_symbol_in_progress,0, 0, &zero_address_frag);
-
-
-
+
+
+
SF_SET_PROCESS(def_symbol_in_progress);
-
+
if (symbolP == NULL) {
/* That is, if this is the first
time we've seen the function... */
symbol_table_insert(def_symbol_in_progress);
} /* definition follows debug */
} /* Create the line number entry pointing to the function being defined */
-
+
def_symbol_in_progress = NULL;
demand_empty_rest_of_line();
return;
} /* obj_coff_endef() */
-static void
- DEFUN_VOID(obj_coff_dim)
+static void
+ DEFUN_VOID(obj_coff_dim)
{
register int dim_index;
-
- if (def_symbol_in_progress == NULL)
+
+ if (def_symbol_in_progress == NULL)
{
as_warn(".dim pseudo-op used outside of .def/.endef: ignored.");
demand_empty_rest_of_line();
return;
} /* if not inside .def/.endef */
-
+
S_SET_NUMBER_AUXILIARY(def_symbol_in_progress, 1);
-
- for (dim_index = 0; dim_index < DIMNUM; dim_index++)
+
+ for (dim_index = 0; dim_index < DIMNUM; dim_index++)
{
SKIP_WHITESPACES();
SA_SET_SYM_DIMEN(def_symbol_in_progress, dim_index, get_absolute_expression());
-
- switch (*input_line_pointer)
+
+ switch (*input_line_pointer)
{
-
+
case ',':
input_line_pointer++;
break;
-
+
default:
as_warn("badly formed .dim directive ignored");
/* intentional fallthrough */
@@ -971,38 +971,38 @@ static void
break;
} /* switch on following character */
} /* for each dimension */
-
+
demand_empty_rest_of_line();
return;
} /* obj_coff_dim() */
-static void obj_coff_line()
+static void obj_coff_line()
{
int this_base;
-
+
if (def_symbol_in_progress == NULL) {
obj_coff_ln();
return;
} /* if it looks like a stabs style line */
-
+
this_base = get_absolute_expression();
- if (this_base > line_base)
+ if (this_base > line_base)
{
line_base = this_base;
}
-
-
-#ifndef NO_LISTING
+
+
+#ifndef NO_LISTING
{
extern int listing;
if (listing && 0) {
listing_source_line(line_base);
}
- }
+ }
#endif
S_SET_NUMBER_AUXILIARY(def_symbol_in_progress, 1);
SA_SET_SYM_LNNO(def_symbol_in_progress, line_base);
-
+
demand_empty_rest_of_line();
return;
} /* obj_coff_line() */
@@ -1013,7 +1013,7 @@ static void obj_coff_size() {
demand_empty_rest_of_line();
return;
} /* if not inside .def/.endef */
-
+
S_SET_NUMBER_AUXILIARY(def_symbol_in_progress, 1);
SA_SET_SYM_SIZE(def_symbol_in_progress, get_absolute_expression());
demand_empty_rest_of_line();
@@ -1026,7 +1026,7 @@ static void obj_coff_scl() {
demand_empty_rest_of_line();
return;
} /* if not inside .def/.endef */
-
+
S_SET_STORAGE_CLASS(def_symbol_in_progress, get_absolute_expression());
demand_empty_rest_of_line();
return;
@@ -1035,27 +1035,27 @@ static void obj_coff_scl() {
static void obj_coff_tag() {
char *symbol_name;
char name_end;
-
+
if (def_symbol_in_progress == NULL) {
as_warn(".tag pseudo-op used outside of .def/.endef ignored.");
demand_empty_rest_of_line();
return;
} /* if not inside .def/.endef */
-
+
S_SET_NUMBER_AUXILIARY(def_symbol_in_progress, 1);
symbol_name = input_line_pointer;
name_end = get_symbol_end();
-
+
/* Assume that the symbol referred to by .tag is always defined. */
/* This was a bad assumption. I've added find_or_make. xoxorich. */
SA_SET_SYM_TAGNDX(def_symbol_in_progress, (long) tag_find_or_make(symbol_name));
if (SA_GET_SYM_TAGNDX(def_symbol_in_progress) == 0L) {
as_warn("tag not found for .tag %s", symbol_name);
} /* not defined */
-
+
SF_SET_TAGGED(def_symbol_in_progress);
*input_line_pointer = name_end;
-
+
demand_empty_rest_of_line();
return;
} /* obj_coff_tag() */
@@ -1066,14 +1066,14 @@ static void obj_coff_type() {
demand_empty_rest_of_line();
return;
} /* if not inside .def/.endef */
-
+
S_SET_DATA_TYPE(def_symbol_in_progress, get_absolute_expression());
-
+
if (ISFCN(S_GET_DATA_TYPE(def_symbol_in_progress)) &&
S_GET_STORAGE_CLASS(def_symbol_in_progress) != C_TPDEF) {
SF_SET_FUNCTION(def_symbol_in_progress);
} /* is a function */
-
+
demand_empty_rest_of_line();
return;
} /* obj_coff_type() */
@@ -1084,18 +1084,18 @@ static void obj_coff_val() {
demand_empty_rest_of_line();
return;
} /* if not inside .def/.endef */
-
+
if (is_name_beginner(*input_line_pointer)) {
char *symbol_name = input_line_pointer;
char name_end = get_symbol_end();
-
+
if (!strcmp(symbol_name, ".")) {
def_symbol_in_progress->sy_frag = frag_now;
S_SET_VALUE(def_symbol_in_progress, obstack_next_free(&frags) - frag_now->fr_literal);
/* If the .val is != from the .def (e.g. statics) */
} else if (strcmp(S_GET_NAME(def_symbol_in_progress), symbol_name)) {
def_symbol_in_progress->sy_forward = symbol_find_or_make(symbol_name);
-
+
/* If the segment is undefined when the forward
reference is solved, then copy the segment id
from the forward symbol. */
@@ -1106,7 +1106,7 @@ static void obj_coff_val() {
} else {
S_SET_VALUE(def_symbol_in_progress, get_absolute_expression());
} /* if symbol based */
-
+
demand_empty_rest_of_line();
return;
} /* obj_coff_val() */
@@ -1125,7 +1125,7 @@ char *name;
symbolS *symbolP;
{
register char * error_string;
-
+
if (*(error_string = hash_jam(tag_hash, name, (char *)symbolP))) {
as_fatal("Inserting \"%s\" into structure table failed: %s",
name, error_string);
@@ -1137,17 +1137,17 @@ static symbolS *tag_find_or_make(name)
char *name;
{
symbolS *symbolP;
-
+
if ((symbolP = tag_find(name)) == NULL) {
symbolP = symbol_new(name,
SEG_UNKNOWN,
0,
&zero_address_frag);
-
+
tag_insert(S_GET_NAME(symbolP), symbolP);
symbol_table_insert(symbolP);
} /* not found */
-
+
return(symbolP);
} /* tag_find_or_make() */
@@ -1167,7 +1167,7 @@ void obj_read_begin_hook() {
know(SYMESZ == AUXESZ);
#endif
tag_init();
-
+
return;
} /* obj_read_begin_hook() */
@@ -1187,14 +1187,14 @@ static unsigned int DEFUN_VOID(yank_symbols)
{
symbolS *symbolP;
unsigned int symbol_number =0;
-
+
for (symbolP = symbol_rootP;
symbolP;
symbolP = symbolP ? symbol_next(symbolP) : symbol_rootP) {
if (!SF_GET_DEBUG(symbolP)) {
/* Debug symbols do not need all this rubbish */
symbolS* real_symbolP;
-
+
/* L* and C_EFCN symbols never merge. */
if (!SF_GET_LOCAL(symbolP)
&& (real_symbolP = symbol_find_base(S_GET_NAME(symbolP), DO_NOT_STRIP))
@@ -1216,32 +1216,32 @@ static unsigned int DEFUN_VOID(yank_symbols)
symbol_remove(symbolP, &symbol_rootP, &symbol_lastP);
symbolP = real_symbolP;
} /* if not local but dup'd */
-
+
if (flagseen['R'] && (S_GET_SEGMENT(symbolP) == SEG_E1)) {
S_SET_SEGMENT(symbolP, SEG_E0);
} /* push data into text */
-
+
S_SET_VALUE(symbolP,
S_GET_VALUE(symbolP) + symbolP->sy_frag->fr_address);
-
- if (!S_IS_DEFINED(symbolP) && !SF_GET_LOCAL(symbolP))
+
+ if (!S_IS_DEFINED(symbolP) && !SF_GET_LOCAL(symbolP))
{
S_SET_EXTERNAL(symbolP);
- }
- else if (S_GET_STORAGE_CLASS(symbolP) == C_NULL)
+ }
+ else if (S_GET_STORAGE_CLASS(symbolP) == C_NULL)
{
if (S_GET_SEGMENT(symbolP) == SEG_E0)
{
S_SET_STORAGE_CLASS(symbolP, C_LABEL);
- }
- else
+ }
+ else
{
S_SET_STORAGE_CLASS(symbolP, C_STAT);
}
- }
-
+ }
+
/* Mainly to speed up if not -g */
- if (SF_GET_PROCESS(symbolP))
+ if (SF_GET_PROCESS(symbolP))
{
/* Handle the nested blocks auxiliary info. */
if (S_GET_STORAGE_CLASS(symbolP) == C_BLOCK) {
@@ -1263,11 +1263,11 @@ static unsigned int DEFUN_VOID(yank_symbols)
if (last_functionP == (symbolS*)0 &&
SF_GET_FUNCTION(symbolP)) {
last_functionP = symbolP;
-
+
if (S_GET_NUMBER_AUXILIARY(symbolP) < 1) {
S_SET_NUMBER_AUXILIARY(symbolP, 1);
} /* make it at least 1 */
-
+
/* Clobber possible stale .dim information. */
memset(symbolP->sy_symbol.ost_auxent[0].x_sym.x_fcnary.x_ary.x_dimen,
'\0', sizeof(symbolP->sy_symbol.ost_auxent[0].x_sym.x_fcnary.x_ary.x_dimen));
@@ -1290,7 +1290,7 @@ static unsigned int DEFUN_VOID(yank_symbols)
/* First descriptor of a structure must point to
the first slot after the structure description. */
last_tagP = symbolP;
-
+
} else if (S_GET_STORAGE_CLASS(symbolP) == C_EOS) {
/* +2 take in account the current symbol */
SA_SET_SYM_ENDNDX(last_tagP, symbol_number + 2);
@@ -1300,7 +1300,7 @@ static unsigned int DEFUN_VOID(yank_symbols)
S_SET_VALUE(symbolP, 0);
} /* no one points at the first .file symbol */
} /* if debug or tag or eos or file */
-
+
/* We must put the external symbols apart. The loader
does not bomb if we do not. But the references in
the endndx field for a .bb symbol are not corrected
@@ -1311,22 +1311,22 @@ static unsigned int DEFUN_VOID(yank_symbols)
[22] .be
ld will move the symbol 21 to the end of the list but
endndx will still be 22 instead of 21. */
-
-
+
+
if (SF_GET_LOCAL(symbolP)) {
/* remove C_EFCN and LOCAL (L...) symbols */
/* next pointer remains valid */
symbol_remove(symbolP, &symbol_rootP, &symbol_lastP);
-
+
}
else if (!S_IS_DEFINED(symbolP)
- && !S_IS_DEBUG(symbolP)
+ && !S_IS_DEBUG(symbolP)
&& !SF_GET_STATICS(symbolP) &&
S_GET_STORAGE_CLASS(symbolP) == C_EXT)
{ /* C_EXT && !SF_GET_FUNCTION(symbolP)) */
/* if external, Remove from the list */
symbolS *hold = symbol_previous(symbolP);
-
+
symbol_remove(symbolP, &symbol_rootP, &symbol_lastP);
symbol_clear_list_pointers(symbolP);
symbol_append(symbolP, symbol_extern_lastP, &symbol_externP, &symbol_extern_lastP);
@@ -1338,27 +1338,27 @@ static unsigned int DEFUN_VOID(yank_symbols)
} else {
symbolP->sy_name_offset = 0;
} /* fix "long" names */
-
+
symbolP->sy_number = symbol_number;
symbol_number += 1 + S_GET_NUMBER_AUXILIARY(symbolP);
} /* if local symbol */
} /* traverse the symbol list */
return symbol_number;
-
+
}
static unsigned int DEFUN_VOID(glue_symbols)
{
unsigned int symbol_number = 0;
- symbolS *symbolP;
+ symbolS *symbolP;
for (symbolP = symbol_externP; symbol_externP;) {
symbolS *tmp = symbol_externP;
-
+
/* append */
symbol_remove(tmp, &symbol_externP, &symbol_extern_lastP);
symbol_append(tmp, symbol_lastP, &symbol_rootP, &symbol_lastP);
-
+
/* and process */
if (SF_GET_STRING(tmp)) {
tmp->sy_name_offset = string_byte_count;
@@ -1366,74 +1366,74 @@ static unsigned int DEFUN_VOID(glue_symbols)
} else {
tmp->sy_name_offset = 0;
} /* fix "long" names */
-
+
tmp->sy_number = symbol_number;
symbol_number += 1 + S_GET_NUMBER_AUXILIARY(tmp);
} /* append the entire extern chain */
return symbol_number;
-
+
}
static unsigned int DEFUN_VOID(tie_tags)
{
unsigned int symbol_number = 0;
-
- symbolS*symbolP;
+
+ symbolS*symbolP;
for (symbolP = symbol_rootP; symbolP; symbolP =
- symbol_next(symbolP))
+ symbol_next(symbolP))
{
symbolP->sy_number = symbol_number;
-
-
-
- if (SF_GET_TAGGED(symbolP))
+
+
+
+ if (SF_GET_TAGGED(symbolP))
{
SA_SET_SYM_TAGNDX
(symbolP,
((symbolS*) SA_GET_SYM_TAGNDX(symbolP))->sy_number);
- }
-
+ }
+
symbol_number += 1 + S_GET_NUMBER_AUXILIARY(symbolP);
- }
+ }
return symbol_number;
-
+
}
-static void
+static void
DEFUN(crawl_symbols,(headers, abfd),
struct internal_filehdr *headers AND
bfd *abfd)
{
-
- unsigned int i;
+
+ unsigned int i;
unsigned int ptr = 0;
-
-
+
+
symbolS *symbolP;
-
+
/* Initialize the stack used to keep track of the matching .bb .be */
-
+
block_stack = stack_init(512, sizeof(symbolS*));
/* JF deal with forward references first... */
for (symbolP = symbol_rootP;
symbolP;
- symbolP = symbol_next(symbolP))
+ symbolP = symbol_next(symbolP))
{
-
+
if (symbolP->sy_forward) {
S_SET_VALUE(symbolP, (S_GET_VALUE(symbolP)
+ S_GET_VALUE(symbolP->sy_forward)
+ symbolP->sy_forward->sy_frag->fr_address));
-
+
if (SF_GET_GET_SEGMENT(symbolP)) {
S_SET_SEGMENT(symbolP, S_GET_SEGMENT(symbolP->sy_forward));
} /* forward segment also */
-
+
symbolP->sy_forward=0;
} /* if it has a forward reference */
} /* walk the symbol chain */
-
-
+
+
/* The symbol list should be ordered according to the following sequence
* order :
* . .file symbol
@@ -1444,39 +1444,39 @@ static void
* But this is not mandatory. The only important point is to put the
* undefined symbols at the end of the list.
*/
-
+
if (symbol_rootP == NULL
|| S_GET_STORAGE_CLASS(symbol_rootP) != C_FILE) {
c_dot_file_symbol("fake");
}
/* Is there a .file symbol ? If not insert one at the beginning. */
-
+
/*
* Build up static symbols for the sections, they are filled in later
*/
-
-
- for (i = SEG_E0; i < SEG_E9; i++)
+
+
+ for (i = SEG_E0; i < SEG_E9; i++)
{
if (segment_info[i].scnhdr.s_name[0])
{
- segment_info[i].dot =
+ segment_info[i].dot =
c_section_symbol(segment_info[i].scnhdr.s_name,
i-SEG_E0+1);
-
+
}
}
-
-
+
+
/* Take all the externals out and put them into another chain */
headers->f_nsyms = yank_symbols();
/* Take the externals and glue them onto the end.*/
headers->f_nsyms += glue_symbols();
-
+
headers->f_nsyms = tie_tags();
know(symbol_externP == NULL);
know(symbol_extern_lastP == NULL);
-
+
return;
}
@@ -1488,82 +1488,82 @@ void DEFUN(w_strings,(where),
char *where)
{
symbolS *symbolP;
-
+
/* Gotta do md_ byte-ordering stuff for string_byte_count first - KWK */
md_number_to_chars(where, string_byte_count, sizeof(string_byte_count));
where += sizeof(string_byte_count);
for (symbolP = symbol_rootP;
symbolP;
- symbolP = symbol_next(symbolP))
+ symbolP = symbol_next(symbolP))
{
unsigned int size;
-
+
if (SF_GET_STRING(symbolP)) {
size = strlen(S_GET_NAME(symbolP)) + 1;
-
+
memcpy(where, S_GET_NAME(symbolP),size);
where += size;
-
- }
- }
-
+
+ }
+ }
+
}
-static void
+static void
DEFUN(do_linenos_for,(abfd, file_cursor),
bfd *abfd AND
unsigned long *file_cursor)
{
unsigned int idx;
-
- for (idx = SEG_E0; idx < SEG_E9; idx++)
+
+ for (idx = SEG_E0; idx < SEG_E9; idx++)
{
- segment_info_type *s = segment_info + idx;
-
-
- if (s->scnhdr.s_nlnno != 0)
+ segment_info_type *s = segment_info + idx;
+
+
+ if (s->scnhdr.s_nlnno != 0)
{
struct lineno_list *line_ptr ;
-
- struct external_lineno *buffer =
+
+ struct external_lineno *buffer =
(struct external_lineno *)xmalloc(s->scnhdr.s_nlnno * LINESZ);
-
+
struct external_lineno *dst= buffer;
-
+
/* Run through the table we've built and turn it into its external
form, take this chance to remove duplicates */
-
+
for (line_ptr = s->lineno_list_head;
line_ptr != (struct lineno_list *)NULL;
- line_ptr = line_ptr->next)
+ line_ptr = line_ptr->next)
{
-
- if (line_ptr->line.l_lnno == 0)
+
+ if (line_ptr->line.l_lnno == 0)
{
/* Turn a pointer to a symbol into the symbols' index */
line_ptr->line.l_addr.l_symndx =
( (symbolS *)line_ptr->line.l_addr.l_symndx)->sy_number;
- }
- else
+ }
+ else
{
line_ptr->line.l_addr.l_paddr += ((struct frag * )(line_ptr->frag))->fr_address;
}
-
-
+
+
(void) bfd_coff_swap_lineno_out(abfd, &(line_ptr->line), dst);
dst++;
-
+
}
-
+
s->scnhdr.s_lnnoptr = *file_cursor;
-
+
bfd_write(buffer, 1, s->scnhdr.s_nlnno* LINESZ, abfd);
free(buffer);
-
+
*file_cursor += s->scnhdr.s_nlnno * LINESZ;
}
}
@@ -1576,15 +1576,15 @@ static void
static void DEFUN_VOID(remove_subsegs)
{
- unsigned int i;
-
+ unsigned int i;
+
for (i = SEG_E0; i < SEG_UNKNOWN; i++)
- {
+ {
frchainS *head = segment_info[i].frchainP;
fragS dummy;
fragS * prev_frag = &dummy;
-
- while (head && head->frch_seg == i)
+
+ while (head && head->frch_seg == i)
{
prev_frag->fr_next = head->frch_root;
prev_frag = head->frch_last;
@@ -1598,35 +1598,35 @@ static void DEFUN_VOID(remove_subsegs)
extern void DEFUN_VOID(write_object_file)
{
int i;
- struct frchain *frchain_ptr;
-
+ struct frchain *frchain_ptr;
+
struct internal_filehdr filehdr;
struct internal_aouthdr aouthdr;
- unsigned long file_cursor;
+ unsigned long file_cursor;
bfd *abfd;
- unsigned int addr = 0;
+ unsigned int addr = 0;
abfd = bfd_openw(out_file_name, TARGET_FORMAT);
-
-
+
+
if (abfd == 0) {
as_perror ("FATAL: Can't create %s", out_file_name);
exit(42);
}
bfd_set_format(abfd, bfd_object);
bfd_set_arch_mach(abfd, BFD_ARCH, 0);
-
-
-
+
+
+
string_byte_count = 4;
-
+
for (frchain_ptr = frchain_root;
- frchain_ptr != (struct frchain *)NULL;
+ frchain_ptr != (struct frchain *)NULL;
frchain_ptr = frchain_ptr->frch_next) {
/* Run through all the sub-segments and align them up. Also close any
open frags. We tack a .fill onto the end of the frag chain so
that any .align's size can be worked by looking at the next
frag */
-
+
subseg_new(frchain_ptr->frch_seg, frchain_ptr->frch_subseg);
#define SUB_SEGMENT_ALIGN 1
frag_align(SUB_SEGMENT_ALIGN,0);
@@ -1634,27 +1634,27 @@ extern void DEFUN_VOID(write_object_file)
frag_now->fr_fix = 0;
know( frag_now->fr_next == NULL );
}
-
-
+
+
remove_subsegs();
-
-
- for (i = SEG_E0; i < SEG_UNKNOWN; i++)
+
+
+ for (i = SEG_E0; i < SEG_UNKNOWN; i++)
{
relax_segment(segment_info[i].frchainP->frch_root, i);
}
-
-
-
-
-
+
+
+
+
+
filehdr.f_nscns = 0;
-
+
/* Find out how big the sections are */
- for (i = SEG_E0; i < SEG_UNKNOWN; i++)
+ for (i = SEG_E0; i < SEG_UNKNOWN; i++)
{
-
- if (segment_info[i].scnhdr.s_name[0])
+
+ if (segment_info[i].scnhdr.s_name[0])
{
filehdr.f_nscns++;
}
@@ -1667,40 +1667,40 @@ extern void DEFUN_VOID(write_object_file)
addr += size_section(abfd, i);
}
}
-
-
-
+
+
+
/* Turn the gas native symbol table shape into a coff symbol table */
crawl_symbols(&filehdr, abfd);
#ifndef TC_H8300
- for (i = SEG_E0; i < SEG_UNKNOWN; i++)
+ for (i = SEG_E0; i < SEG_UNKNOWN; i++)
{
fixup_segment(segment_info[i].fix_root, i);
}
#endif
-
+
file_cursor = FILHSZ + SCNHSZ * filehdr.f_nscns ;
-
+
bfd_seek(abfd, file_cursor, 0);
-
-
+
+
do_relocs_for(abfd, &file_cursor);
-
+
do_linenos_for(abfd, &file_cursor);
-
-
+
+
/* Plant the data */
-
+
fill_section(abfd,&filehdr, &file_cursor);
-
+
filehdr.f_magic = COFF_MAGIC;
filehdr.f_timdat = 0;
filehdr.f_flags = 0;
-
-
-
+
+
+
{
-
+
unsigned int symtable_size = filehdr.f_nsyms * SYMESZ;
char *buffer1 = malloc(symtable_size + string_byte_count + 4);
char *ptr = buffer1;
@@ -1709,10 +1709,10 @@ extern void DEFUN_VOID(write_object_file)
w_strings(buffer1 + symtable_size);
bfd_write(buffer1, 1,symtable_size + string_byte_count + 4, abfd);
free(buffer1);
-
+
}
coff_header_append(abfd, &filehdr, &aouthdr);
-
+
bfd_close_all_done(abfd);
}
@@ -1722,37 +1722,37 @@ static void DEFUN(change_to_section,(name, len, exp),
unsigned int len AND
unsigned int exp)
{
- unsigned int i;
+ unsigned int i;
/* Find out if we've already got a section of this name etc */
- for (i = SEG_E0; i < SEG_E9 && segment_info[i].scnhdr.s_name[0] ; i++)
+ for (i = SEG_E0; i < SEG_E9 && segment_info[i].scnhdr.s_name[0] ; i++)
{
- if (strncmp(segment_info[i].scnhdr.s_name, name, len) == 0)
+ if (strncmp(segment_info[i].scnhdr.s_name, name, len) == 0)
{
- subseg_new(i, exp);
+ subseg_new(i, exp);
return;
-
+
}
}
/* No section, add one */
strncpy(segment_info[i].scnhdr.s_name, name, 8);
- subseg_new(i, exp);
+ subseg_new(i, exp);
}
-static void
+static void
DEFUN_VOID(obj_coff_section)
{
/* Strip out the section name */
char *section_name ;
char *section_name_end;
char c;
-
+
unsigned int len;
unsigned int exp;
-
+
section_name = input_line_pointer;
c = get_symbol_end();
section_name_end = input_line_pointer;
-
+
len = section_name_end - section_name ;
input_line_pointer++;
SKIP_WHITESPACE();
@@ -1760,20 +1760,20 @@ static void
{
exp = get_absolute_expression();
}
- else if ( *input_line_pointer == ',')
+ else if ( *input_line_pointer == ',')
{
-
+
input_line_pointer++;
- exp = get_absolute_expression();
+ exp = get_absolute_expression();
}
- else
+ else
{
exp = 0;
}
-
+
change_to_section(section_name, len,exp);
- *section_name_end = c;
-
+ *section_name_end = c;
+
}
@@ -1794,15 +1794,15 @@ symbolS *normal;
{
S_SET_DATA_TYPE(normal, S_GET_DATA_TYPE(debug));
S_SET_STORAGE_CLASS(normal, S_GET_STORAGE_CLASS(debug));
-
+
if (S_GET_NUMBER_AUXILIARY(debug) > S_GET_NUMBER_AUXILIARY(normal)) {
S_SET_NUMBER_AUXILIARY(normal, S_GET_NUMBER_AUXILIARY(debug));
} /* take the most we have */
-
+
if (S_GET_NUMBER_AUXILIARY(debug) > 0) {
memcpy((char*)&normal->sy_symbol.ost_auxent[0], (char*)&debug->sy_symbol.ost_auxent[0], S_GET_NUMBER_AUXILIARY(debug) * AUXESZ);
} /* Move all the auxiliary information */
-
+
/* Move the debug flags. */
SF_SET_DEBUG_FIELD(normal, SF_GET_DEBUG_FIELD(debug));
} /* c_symbol_merge() */
@@ -1814,30 +1814,30 @@ static int
unsigned short line_number AND
fragS* frag)
{
- struct lineno_list* new_line =
+ struct lineno_list* new_line =
(struct lineno_list *)xmalloc(sizeof(struct lineno_list));
-
+
segment_info_type *s = segment_info + now_seg;
new_line->line.l_lnno = line_number;
-
- if (line_number == 0)
+
+ if (line_number == 0)
{
new_line->line.l_addr.l_symndx = (long)symbol;
}
- else
+ else
{
new_line->line.l_addr.l_paddr = paddr;
- }
-
+ }
+
new_line->frag = (char*)frag;
new_line->next = (struct lineno_list*)NULL;
-
-
- if (s->lineno_list_head == (struct lineno_list *)NULL)
+
+
+ if (s->lineno_list_head == (struct lineno_list *)NULL)
{
s->lineno_list_head = new_line;
}
- else
+ else
{
s->lineno_list_tail->next = new_line;
}
@@ -1849,42 +1849,42 @@ void c_dot_file_symbol(filename)
char *filename;
{
symbolS* symbolP;
-
+
symbolP = symbol_new(".file",
SEG_DEBUG,
0,
&zero_address_frag);
-
+
S_SET_STORAGE_CLASS(symbolP, C_FILE);
S_SET_NUMBER_AUXILIARY(symbolP, 1);
SA_SET_FILE_FNAME(symbolP, filename);
#ifndef NO_LISTING
{
extern int listing;
- if (listing)
+ if (listing)
{
listing_source_file(filename);
}
-
+
}
-
-#endif
+
+#endif
SF_SET_DEBUG(symbolP);
S_SET_VALUE(symbolP, (long) previous_file_symbol);
-
+
previous_file_symbol = symbolP;
-
+
/* Make sure that the symbol is first on the symbol chain */
if (symbol_rootP != symbolP) {
if (symbolP == symbol_lastP) {
symbol_lastP = symbol_lastP->sy_previous;
} /* if it was the last thing on the list */
-
+
symbol_remove(symbolP, &symbol_rootP, &symbol_lastP);
symbol_insert(symbolP, symbol_rootP, &symbol_rootP, &symbol_lastP);
symbol_rootP = symbolP;
} /* if not first on the list */
-
+
} /* c_dot_file_symbol() */
/*
@@ -1896,20 +1896,20 @@ char *name;
int idx;
{
symbolS *symbolP;
-
+
symbolP = symbol_new(name,idx,
0,
&zero_address_frag);
-
+
S_SET_STORAGE_CLASS(symbolP, C_STAT);
S_SET_NUMBER_AUXILIARY(symbolP, 1);
-
+
SF_SET_STATICS(symbolP);
-
+
return symbolP;
} /* c_section_symbol() */
-static void
+static void
DEFUN(w_symbols,(abfd, where, symbol_rootP),
bfd *abfd AND
char *where AND
@@ -1917,21 +1917,21 @@ static void
{
symbolS *symbolP;
unsigned int i;
-
+
/* First fill in those values we have only just worked out */
- for (i = SEG_E0; i < SEG_E9; i++)
+ for (i = SEG_E0; i < SEG_E9; i++)
{
symbolP = segment_info[i].dot;
- if (symbolP)
+ if (symbolP)
{
-
+
SA_SET_SCN_SCNLEN(symbolP, segment_info[i].scnhdr.s_size);
SA_SET_SCN_NRELOC(symbolP, segment_info[i].scnhdr.s_nreloc);
SA_SET_SCN_NLINNO(symbolP, segment_info[i].scnhdr.s_nlnno);
-
+
}
}
-
+
/*
* Emit all symbols left in the symbol chain.
*/
@@ -1939,9 +1939,9 @@ static void
/* Used to save the offset of the name. It is used to point
to the string in memory but must be a file offset. */
register char * temp;
-
+
tc_coff_symbol_emit_hook(symbolP);
-
+
temp = S_GET_NAME(symbolP);
if (SF_GET_STRING(symbolP)) {
S_SET_OFFSET(symbolP, symbolP->sy_name_offset);
@@ -1953,7 +1953,7 @@ static void
where = symbol_to_chars(abfd, where, symbolP);
S_SET_NAME(symbolP,temp);
}
-
+
} /* w_symbols() */
static void DEFUN_VOID(obj_coff_lcomm)
@@ -1964,9 +1964,9 @@ static void DEFUN_VOID(obj_coff_lcomm)
char *p;
symbolS *symbolP;
name = input_line_pointer;
-
-
-
+
+
+
c = get_symbol_end();
p = input_line_pointer;
*p = c;
@@ -2010,9 +2010,9 @@ static void DEFUN(fixup_segment,(fixP, this_segment_type),
register char pcrel;
register fragS *fragP;
register segT add_symbol_segment = SEG_ABSOLUTE;
-
-
- for ( ; fixP; fixP = fixP->fx_next)
+
+
+ for ( ; fixP; fixP = fixP->fx_next)
{
fragP = fixP->fx_frag;
know(fragP);
@@ -2025,7 +2025,7 @@ static void DEFUN(fixup_segment,(fixP, this_segment_type),
/* Relocation should be done via the
associated 'bal' entry point
symbol. */
-
+
if (!TC_S_IS_BALNAME(tc_get_bal_of_call(add_symbolP))) {
as_bad("No 'bal' entry point for leafproc %s",
S_GET_NAME(add_symbolP));
@@ -2037,20 +2037,20 @@ static void DEFUN(fixup_segment,(fixP, this_segment_type),
sub_symbolP = fixP->fx_subsy;
add_number = fixP->fx_offset;
pcrel = fixP->fx_pcrel;
-
+
if (add_symbolP) {
add_symbol_segment = S_GET_SEGMENT(add_symbolP);
} /* if there is an addend */
-
+
if (sub_symbolP) {
if (!add_symbolP) {
/* Its just -sym */
if (S_GET_SEGMENT(sub_symbolP) != SEG_ABSOLUTE) {
as_bad("Negative of non-absolute symbol %s", S_GET_NAME(sub_symbolP));
} /* not absolute */
-
+
add_number -= S_GET_VALUE(sub_symbolP);
-
+
/* if sub_symbol is in the same segment that add_symbol
and add_symbol is either in DATA, TEXT, BSS or ABSOLUTE */
} else if ((S_GET_SEGMENT(sub_symbolP) == add_symbol_segment)
@@ -2067,15 +2067,15 @@ static void DEFUN(fixup_segment,(fixP, this_segment_type),
as_bad("callj to difference of 2 symbols");
}
#endif /* TC_I960 */
- add_number += S_GET_VALUE(add_symbolP) -
+ add_number += S_GET_VALUE(add_symbolP) -
S_GET_VALUE(sub_symbolP);
-
+
add_symbolP = NULL;
fixP->fx_addsy = NULL;
} else {
/* Different segments in subtraction. */
know(!(S_IS_EXTERNAL(sub_symbolP) && (S_GET_SEGMENT(sub_symbolP) == SEG_ABSOLUTE)));
-
+
if ((S_GET_SEGMENT(sub_symbolP) == SEG_ABSOLUTE)) {
add_number -= S_GET_VALUE(sub_symbolP);
} else {
@@ -2085,7 +2085,7 @@ static void DEFUN(fixup_segment,(fixP, this_segment_type),
} /* if absolute */
}
} /* if sub_symbolP */
-
+
if (add_symbolP) {
if (add_symbol_segment == this_segment_type && pcrel) {
/*
@@ -2101,14 +2101,14 @@ static void DEFUN(fixup_segment,(fixP, this_segment_type),
*/
reloc_callj(fixP);
#endif /* TC_I960 */
-
+
add_number += S_GET_VALUE(add_symbolP);
add_number -= md_pcrel_from (fixP);
pcrel = 0; /* Lie. Don't want further pcrel processing. */
fixP->fx_addsy = NULL; /* No relocations please. */
- } else
+ } else
{
- switch (add_symbol_segment)
+ switch (add_symbol_segment)
{
case SEG_ABSOLUTE:
#ifdef TC_I960
@@ -2119,11 +2119,11 @@ static void DEFUN(fixup_segment,(fixP, this_segment_type),
add_symbolP = NULL;
break;
default:
-
+
add_number += S_GET_VALUE(add_symbolP) +
segment_info[S_GET_SEGMENT(add_symbolP)].scnhdr.s_paddr ;
break;
-
+
case SEG_UNKNOWN:
#ifdef TC_I960
if ((int)fixP->fx_bit_fixP == 13) {
@@ -2137,23 +2137,23 @@ static void DEFUN(fixup_segment,(fixP, this_segment_type),
continue;
} /* COBR */
#endif /* TC_I960 */
-
-
-
+
+
+
break;
-
-
+
+
} /* switch on symbol seg */
} /* if not in local seg */
} /* if there was a + symbol */
-
+
if (pcrel) {
add_number -= md_pcrel_from(fixP);
if (add_symbolP == 0) {
fixP->fx_addsy = & abs_symbol;
} /* if there's an add_symbol */
} /* if pcrel */
-
+
if (!fixP->fx_bit_fixP) {
if ((size == 1
&& (add_number & ~0xFF) && (add_number & ~0xFF != (-1 & ~0xFF))) ||
@@ -2163,13 +2163,13 @@ static void DEFUN(fixup_segment,(fixP, this_segment_type),
add_number, size, fragP->fr_address + where);
} /* generic error checking */
} /* not a bit fix */
- /* once this fix has been applied, we don't have to output anything
+ /* once this fix has been applied, we don't have to output anything
nothing more need be done -*/
md_apply_fix(fixP, add_number);
-
+
} /* For each fixS in this segment. */
-
-
+
+
} /* fixup_segment() */
#endif
diff --git a/gnu/usr.bin/as/config/obj-coffbfd.h b/gnu/usr.bin/as/config/obj-coffbfd.h
index d1afabb..5ccefab 100644
--- a/gnu/usr.bin/as/config/obj-coffbfd.h
+++ b/gnu/usr.bin/as/config/obj-coffbfd.h
@@ -1,18 +1,18 @@
/* coff object file format
Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
-
+
This file is part of GAS.
-
+
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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -43,7 +43,7 @@
#else
help me
#endif
-
+
#if 0
/* Define some processor dependent values according to the processor we are
on. */
@@ -80,15 +80,15 @@ help me
#else
you lose
-#endif
-
#endif
-
+
+#endif
+
#ifndef OBJ_COFF_MAX_AUXENTRIES
#define OBJ_COFF_MAX_AUXENTRIES 1
#endif /* OBJ_COFF_MAX_AUXENTRIES */
-
-
+
+
extern const segT N_TYPE_seg[];
/* Magic number of paged executable. */
@@ -104,11 +104,11 @@ you lose
/* Symbol table entry data type */
-typedef struct
+typedef struct
{
struct internal_syment ost_entry; /* Basic symbol */
union internal_auxent ost_auxent[OBJ_COFF_MAX_AUXENTRIES]; /* Auxiliary entry. */
-
+
unsigned int ost_flags; /* obj_coff internal use only flags */
} obj_symbol_type;
@@ -118,7 +118,7 @@ typedef struct
#endif
/* Symbol table macros and constants */
-/* Possible and usefull section number in symbol table
+/* Possible and usefull section number in symbol table
* The values of TEXT, DATA and BSS may not be portable.
*/
@@ -169,7 +169,7 @@ typedef struct
/* The zeroes if symbol name is longer than 8 chars */
#define S_GET_ZEROES(s) ((s)->sy_symbol.ost_entry.n_zeroes)
/* The value of the symbol */
-#define S_GET_VALUE(s) ((unsigned) ((s)->sy_symbol.ost_entry.n_value))
+#define S_GET_VALUE(s) ((unsigned) ((s)->sy_symbol.ost_entry.n_value))
/* The numeric value of the segment */
#define S_GET_SEGMENT(s) s_get_segment(s)
/* The data type */
@@ -446,7 +446,7 @@ typedef struct {
struct lineno_list
{
-
+
struct bfd_internal_lineno line;
char* frag; /* Frag to which the line number is related */
struct lineno_list* next; /* Forward chain pointer */
@@ -477,7 +477,7 @@ void EXFUN(stack_delete,(stack *st));
void EXFUN(c_section_header,(
-
+
struct internal_scnhdr *header,
char *name,
long core_address,
diff --git a/gnu/usr.bin/as/config/obj-generic.c b/gnu/usr.bin/as/config/obj-generic.c
index a91eff9..2f69ce4 100644
--- a/gnu/usr.bin/as/config/obj-generic.c
+++ b/gnu/usr.bin/as/config/obj-generic.c
@@ -1,20 +1,20 @@
/* This file is obj-generic.c and is intended to be a template for
- object format specific source files.
+ object format specific source files.
Copyright (C) 1987-1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
diff --git a/gnu/usr.bin/as/config/obj-generic.h b/gnu/usr.bin/as/config/obj-generic.h
index f370722..24a6ace 100644
--- a/gnu/usr.bin/as/config/obj-generic.h
+++ b/gnu/usr.bin/as/config/obj-generic.h
@@ -1,25 +1,25 @@
/* This file is obj-generic.h
Copyright (C) 1987-1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
/*
* This file is obj-generic.h and is intended to be a template for
- * object format specific header files.
+ * object format specific header files.
*/
/* define an obj specific macro off which target cpu back ends may key. */
@@ -61,7 +61,7 @@ typedef void *object_headers;
/* symbols may be external */
#define S_IS_EXTERNAL(s) (0)
#define S_SET_EXTERNAL(s) ;
-
+
/* symbols may or may not be defined */
#define S_IS_DEFINED(s) (0)
diff --git a/gnu/usr.bin/as/config/obj-ieee.c b/gnu/usr.bin/as/config/obj-ieee.c
index 5f74a5f..c190999 100644
--- a/gnu/usr.bin/as/config/obj-ieee.c
+++ b/gnu/usr.bin/as/config/obj-ieee.c
@@ -1,26 +1,26 @@
/* obj-format for ieee-695 records.
Copyright (C) 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
-/*
+/*
created by
-
+
steve chamberlain steve@cygnus.com
*/
@@ -44,7 +44,7 @@ register long alignment; /* Alignment (binary). */
{
relax_addressT mask;
relax_addressT new_address;
-
+
mask = ~ ( (~0) << alignment );
new_address = (address + mask) & (~ mask);
return (new_address - address);
@@ -60,7 +60,7 @@ static void DEFUN(size_section,(abfd, idx),
unsigned int size = 0;
fragS *frag = segment_info[idx].frag_root;
while (frag) {
- if (frag->fr_address != size) {
+ if (frag->fr_address != size) {
printf("Out of step\n");
size = frag->fr_address;
}
@@ -104,7 +104,7 @@ static void DEFUN(fill_section,(abfd, idx),
case rs_fill:
case rs_align:
case rs_org:
- if (frag->fr_fix)
+ if (frag->fr_fix)
{
bfd_set_section_contents(abfd,
sec,
@@ -114,10 +114,10 @@ static void DEFUN(fill_section,(abfd, idx),
}
offset += frag->fr_fix;
fill_size = frag->fr_var;
- if (fill_size)
+ if (fill_size)
{
unsigned int off = frag->fr_fix;
- for (count = frag->fr_offset; count; count--)
+ for (count = frag->fr_offset; count; count--)
{
bfd_set_section_contents(abfd, sec,
frag->fr_literal +
@@ -128,7 +128,7 @@ static void DEFUN(fill_section,(abfd, idx),
}
}
break;
- default:
+ default:
abort();
}
frag = frag->fr_next;
@@ -143,11 +143,11 @@ static unsigned int DEFUN(count_entries_in_chain,(idx),
{
unsigned int nrelocs;
fixS *fixup_ptr;
-
+
/* Count the relocations */
fixup_ptr = segment_info[idx].fix_root;
nrelocs = 0;
- while (fixup_ptr != (fixS *)NULL)
+ while (fixup_ptr != (fixS *)NULL)
{
fixup_ptr = fixup_ptr->fx_next;
nrelocs ++ ;
@@ -156,7 +156,7 @@ static unsigned int DEFUN(count_entries_in_chain,(idx),
}
/* output all the relocations for a section */
-void DEFUN(do_relocs_for,(idx),
+void DEFUN(do_relocs_for,(idx),
unsigned int idx)
{
unsigned int nrelocs;
@@ -168,35 +168,35 @@ void DEFUN(do_relocs_for,(idx),
fixS *from;
if (section) {
nrelocs = count_entries_in_chain(idx);
-
+
reloc_ptr_vector = (arelent**)malloc((nrelocs+1) * sizeof(arelent *));
reloc_vector = (arelent*)malloc(nrelocs * sizeof(arelent));
ptrs = (asymbol **)malloc(nrelocs * sizeof(asymbol *));
from = segment_info[idx].fix_root;
- for (i = 0; i < nrelocs; i++)
- {
+ for (i = 0; i < nrelocs; i++)
+ {
arelent *to = reloc_vector + i;
asymbol *s ;
reloc_ptr_vector[i] = to;
to->howto = (reloc_howto_type *)(from->fx_r_type);
-
+
/* We can't represent complicated things in a reloc yet */
/* if (from->fx_addsy == 0 ||
from->fx_subsy != 0) abort();
*/
s = &( from->fx_addsy->sy_symbol.sy);
to->address = ((char *)( from->fx_frag->fr_address +
- from->fx_where))
+ from->fx_where))
- ((char *)(&(from->fx_frag->fr_literal)));
to->addend = from->fx_offset ;
/* If we know the symbol which we want to relocate to, turn this
- reloaction into a section relative.
-
+ reloaction into a section relative.
+
If this relocation is pcrelative, and we know the
destination, we still want to keep the relocation - since
the linker might relax some of the bytes, but it stops
being pc relative and turns into an absolute relocation.
-
+
*/
if (s) {
if ((s->flags & BSF_UNDEFINED) == 0) {
@@ -212,27 +212,27 @@ void DEFUN(do_relocs_for,(idx),
to->section = 0;
*ptrs = &(from->fx_addsy->sy_symbol.sy);
to->sym_ptr_ptr = ptrs;
-
+
if (to->howto->pcrel_offset) {
/* This is a pcrel relocation, the addend should be adjusted */
to->addend -= to->address -1;
}
}
-
+
}
else {
to->section = 0;
}
-
+
ptrs++;
from = from->fx_next;
}
-
+
/* attatch to the section */
section->orelocation = reloc_ptr_vector;
- section->reloc_count = nrelocs;
+ section->reloc_count = nrelocs;
section->flags |= SEC_LOAD;
- }
+ }
}
/* do the symbols.. */
@@ -245,13 +245,13 @@ static void DEFUN(do_symbols, (abfd),
asymbol *symbol_vec;
unsigned int count = 0;
unsigned int index;
-
-
+
+
for (ptr = symbol_rootP;
ptr != (symbolS *)NULL;
- ptr = ptr->sy_next)
+ ptr = ptr->sy_next)
{
- if (SEG_NORMAL(ptr->sy_symbol.seg))
+ if (SEG_NORMAL(ptr->sy_symbol.seg))
{
ptr->sy_symbol.sy.section =
(asection *)(segment_info[ptr->sy_symbol.seg].user_stuff);
@@ -277,11 +277,11 @@ static void DEFUN(do_symbols, (abfd),
count++;
}
symbol_ptr_vec = (asymbol **)malloc((count+1) * sizeof(asymbol *));
-
+
index = 0;
for (ptr = symbol_rootP;
ptr != (symbolS *)NULL;
- ptr = ptr->sy_next)
+ ptr = ptr->sy_next)
{
symbol_ptr_vec[index] = &(ptr->sy_symbol.sy);
index++;
@@ -297,50 +297,50 @@ static void DEFUN(do_symbols, (abfd),
void DEFUN_VOID(bfd_as_write_hook)
{
int i;
-
+
for (i = SEG_E0; i < SEG_UNKNOWN; i++) {
size_section(abfd, i);
}
-
-
+
+
for (i = SEG_E0; i < SEG_UNKNOWN; i++)
fill_section(abfd,i);
-
+
do_symbols(abfd);
-
+
for (i = SEG_E0; i < SEG_UNKNOWN; i++)
do_relocs_for(i);
-
+
}
-S_GET_VALUE(x)
-symbolS *x;
+S_GET_VALUE(x)
+symbolS *x;
{
- return x->sy_symbol.sy.value;
+ return x->sy_symbol.sy.value;
}
S_SET_SEGMENT(x,y)
symbolS *x ;
int y;
-{
+{
x->sy_symbol.seg = y;
}
S_IS_DEFINED(x)
symbolS *x;
{
- if (SEG_NORMAL(x->sy_symbol.seg))
+ if (SEG_NORMAL(x->sy_symbol.seg))
{
return 1;
}
- switch (x->sy_symbol.seg)
+ switch (x->sy_symbol.seg)
{
case SEG_UNKNOWN:
return 0;
default:
- abort();
+ abort();
}
}
@@ -352,7 +352,7 @@ symbolS *x;
{ return x->sy_symbol.seg; }
S_SET_EXTERNAL(x)
-symbolS *x;
+symbolS *x;
{
x->sy_symbol.sy.flags |= BSF_GLOBAL | BSF_EXPORT;
}
@@ -365,7 +365,7 @@ char *y; {
S_SET_VALUE(s,v)
symbolS *s;
long v;
-{
+{
s->sy_symbol.sy.value = v;
}
@@ -392,7 +392,7 @@ int ignore;
if (segment_info[i].hadone){
if (strncmp(segment_info[i].name, s, p-s) == 0) {
goto ok;
-
+
}
}
else break;
@@ -401,17 +401,17 @@ int ignore;
as_bad("too many sections");
return;
}
-
+
segment_info[i].hadone = 1;
segment_info[i].name = malloc(p-s + 1);
memcpy(segment_info[i].name, s, p-s);
- segment_info[i].name[p-s] = 0;
+ segment_info[i].name[p-s] = 0;
ok:
subseg_new(i,0);
- while (!is_end_of_line[*p])
+ while (!is_end_of_line[*p])
p++;
input_line_pointer = p;
-
+
}
@@ -429,8 +429,8 @@ void s_ignore();
void stringer();
void s_globl();
-const pseudo_typeS obj_pseudo_table[] =
-{
+const pseudo_typeS obj_pseudo_table[] =
+{
{"section", obj_ieee_section, 0},
{"data.b", cons, 1},
{"data.w", cons, 2},
@@ -441,7 +441,7 @@ const pseudo_typeS obj_pseudo_table[] =
{"import", s_ignore, 0},
{"sdata", stringer, 0},
0,
-
+
};
@@ -460,11 +460,11 @@ symbolS *symbolP;
extern void DEFUN_VOID(write_object_file)
{
int i;
- struct frchain *frchain_ptr;
+ struct frchain *frchain_ptr;
struct frag *frag_ptr;
-
+
abfd = bfd_openw(out_file_name, "ieee");
-
+
if (abfd == 0) {
as_perror ("FATAL: Can't create %s", out_file_name);
exit(42);
@@ -475,13 +475,13 @@ extern void DEFUN_VOID(write_object_file)
subseg_new(2,0);
subseg_new(3,0);
for (frchain_ptr = frchain_root;
- frchain_ptr != (struct frchain *)NULL;
+ frchain_ptr != (struct frchain *)NULL;
frchain_ptr = frchain_ptr->frch_next) {
/* Run through all the sub-segments and align them up. Also close any
open frags. We tack a .fill onto the end of the frag chain so
that any .align's size can be worked by looking at the next
frag */
-
+
subseg_new(frchain_ptr->frch_seg, frchain_ptr->frch_subseg);
#define SUB_SEGMENT_ALIGN 2
frag_align(SUB_SEGMENT_ALIGN,0);
@@ -489,17 +489,17 @@ extern void DEFUN_VOID(write_object_file)
frag_now->fr_fix = 0;
know( frag_now->fr_next == NULL );
}
-
+
/* Now build one big frag chain for each segment, linked through
fr_next. */
for (i = SEG_E0; i < SEG_UNKNOWN; i++)
- {
-
+ {
+
fragS ** prev_frag_ptr_ptr ;
struct frchain *next_frchain_ptr;
-
+
/* struct frag **head_ptr = segment_info[i].frag_root;*/
-
+
segment_info[i].frag_root = segment_info[i].frchainP->frch_root;
#if 0
/* Im not sure what this is for */
@@ -510,17 +510,17 @@ extern void DEFUN_VOID(write_object_file)
*head_ptr = frchain_ptr;
head_ptr = &frchain_ptr->next;
}
-
-
+
+
#endif
}
-
+
for (i = SEG_E0; i < SEG_UNKNOWN; i++) {
relax_segment(segment_info[i].frag_root, i);
}
-
+
/* Now the addresses of the frags are correct within the segment */
-
+
bfd_as_write_hook();
bfd_close(abfd);
}
diff --git a/gnu/usr.bin/as/config/obj-ieee.h b/gnu/usr.bin/as/config/obj-ieee.h
index 3baa081..b2864bc 100644
--- a/gnu/usr.bin/as/config/obj-ieee.h
+++ b/gnu/usr.bin/as/config/obj-ieee.h
@@ -1,19 +1,19 @@
/* This file is obj-ieee.h
Copyright (C) 1987-1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -22,7 +22,7 @@
#include <bfd.h>
-typedef struct
+typedef struct
{
asymbol sy;
int seg;
diff --git a/gnu/usr.bin/as/config/obj-vms.c b/gnu/usr.bin/as/config/obj-vms.c
index 5d12387..2a51ba9 100644
--- a/gnu/usr.bin/as/config/obj-vms.c
+++ b/gnu/usr.bin/as/config/obj-vms.c
@@ -40,7 +40,7 @@ extern const char version_string[];
char *compiler_version_string;
/* Flag that determines how we map names. This takes several values, and
- * is set with the -h switch. A value of zero implies names should be
+ * is set with the -h switch. A value of zero implies names should be
* upper case, and the presence of the -h switch inhibits the case hack.
* No -h switch at all sets vms_name_mapping to 0, and allows case hacking.
* A value of 2 (set with -h2) implies names should be
@@ -453,13 +453,13 @@ const pseudo_typeS obj_pseudo_table[] =
}; /* obj_pseudo_table */
-void
+void
obj_read_begin_hook ()
{
return;
} /* obj_read_begin_hook() */
-void
+void
obj_crawl_symbol_chain (headers)
object_headers *headers;
{
@@ -490,16 +490,16 @@ obj_crawl_symbol_chain (headers)
/* OK, here is how we decide which symbols go out into the
brave new symtab. Symbols that do are:
-
+
* symbols with no name (stabd's?)
* symbols with debug info in their N_TYPE
-
+
Symbols that don't are:
* symbols that are registers
* symbols with \1 as their 3rd character (numeric labels)
* "local labels" as defined by S_LOCAL_NAME(name)
if the -L switch was passed to gas.
-
+
All other symbols are output. We complain if a deleted
symbol was marked external. */
@@ -538,7 +538,7 @@ Create_VMS_Object_File ()
#if defined(eunice) || !defined(HO_VMS)
VMS_Object_File_FD = creat (out_file_name, 0777, "var");
#else /* eunice */
- VMS_Object_File_FD = creat (out_file_name, 0, "rfm=var",
+ VMS_Object_File_FD = creat (out_file_name, 0, "rfm=var",
"mbc=16", "deq=64", "fop=tef", "shr=nil");
#endif /* eunice */
/*
@@ -3799,7 +3799,7 @@ VMS_Emit_Globalvalues (text_siz, data_siz, Data_Segment)
if (Size > 4)
error ("Invalid data type for globalvalue");
globalvalue = 0;
-
+
memcpy (&globalvalue, Data_Segment + S_GET_VALUE (sp) -
text_siz, Size);
/* Three times for good luck. The linker seems to get confused
@@ -4583,12 +4583,12 @@ VMS_write_object_file (text_siz, data_siz, text_frag_root, data_frag_root)
0);
}
#ifndef gxx_bug_fixed
- /*
+ /*
* The g++ compiler does not write out external references to vtables
* correctly. Check for this and holler if we see it happening.
* If that compiler bug is ever fixed we can remove this.
*/
- for (sp = symbol_rootP; sp; sp = symbol_next (sp))
+ for (sp = symbol_rootP; sp; sp = symbol_next (sp))
{
/*
* Dispatch on symbol type
diff --git a/gnu/usr.bin/as/config/obj-vms.h b/gnu/usr.bin/as/config/obj-vms.h
index fec056d..f997535 100644
--- a/gnu/usr.bin/as/config/obj-vms.h
+++ b/gnu/usr.bin/as/config/obj-vms.h
@@ -201,7 +201,7 @@ typedef struct nlist obj_symbol_type; /* Symbol table entry */
#define H_SET_SYMBOL_TABLE_SIZE(h,v) ((h)->header.a_syms = (v) * \
sizeof(struct nlist))
-/*
+/*
* Current means for getting the name of a segment.
* This will change for infinite-segments support (e.g. COFF).
*/
diff --git a/gnu/usr.bin/as/config/tc-a29k.c b/gnu/usr.bin/as/config/tc-a29k.c
index 84ec97a..3e95db0 100644
--- a/gnu/usr.bin/as/config/tc-a29k.c
+++ b/gnu/usr.bin/as/config/tc-a29k.c
@@ -1,18 +1,18 @@
/* tc-a29k.c -- Assemble for the AMD 29000.
Copyright (C) 1989, 1990, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -129,14 +129,14 @@ static unsigned char octal[256];
static unsigned char toHex[256];
/*
- * anull bit - causes the branch delay slot instructions to not be executed
+ * anull bit - causes the branch delay slot instructions to not be executed
*/
#define ANNUL (1 << 29)
static void
s_use()
{
-
+
if (strncmp(input_line_pointer, ".text", 5) == 0) {
input_line_pointer += 5;
s_text();
@@ -160,7 +160,7 @@ static void
demand_empty_rest_of_line();
return;
}
-
+
as_bad("Unknown segment type");
demand_empty_rest_of_line();
return;
@@ -184,16 +184,16 @@ int regnum;
{
/* FIXME-SOON, put something in these syms so they won't be output to the symbol
table of the resulting object file. */
-
+
/* Must be large enough to hold the names of the special registers. */
char buf[80];
int i;
-
+
symbol_table_insert(symbol_new(regname, SEG_REGISTER, regnum, &zero_address_frag));
for (i = 0; regname[i]; i++)
buf[i] = islower (regname[i]) ? toupper (regname[i]) : regname[i];
buf[i] = '\0';
-
+
symbol_table_insert(symbol_new(buf, SEG_REGISTER, regnum, &zero_address_frag));
} /* insert_sreg() */
@@ -202,7 +202,7 @@ int regnum;
void define_some_regs() {
#define SREG 256
-
+
/* Protected special-purpose register names */
insert_sreg ("vab", SREG+0);
insert_sreg ("ops", SREG+1);
@@ -219,7 +219,7 @@ void define_some_regs() {
insert_sreg ("pc2", SREG+12);
insert_sreg ("mmu", SREG+13);
insert_sreg ("lru", SREG+14);
-
+
/* Unprotected special-purpose register names */
insert_sreg ("ipc", SREG+128);
insert_sreg ("ipa", SREG+129);
@@ -246,25 +246,25 @@ void
register int skipnext = 0;
register unsigned int i;
register char *strend, *strend2;
-
+
/* Hash up all the opcodes for fast use later. */
-
+
op_hash = hash_new();
if (op_hash == NULL)
as_fatal("Virtual memory exhausted");
-
+
for (i = 0; i < num_opcodes; i++)
{
const char *name = machine_opcodes[i].name;
-
+
if (skipnext) {
skipnext = 0;
continue;
}
-
+
/* Hack to avoid multiple opcode entries. We pre-locate all the
variations (b/i field and P/A field) and handle them. */
-
+
if (!strcmp (name, machine_opcodes[i+1].name)) {
if ((machine_opcodes[i].opcode ^ machine_opcodes[i+1].opcode)
!= 0x01000000)
@@ -289,7 +289,7 @@ void
fprintf (stderr, "internal error: can't handle opcode %s\n", name);
lose = 1;
}
-
+
/* OK, this is an i/b or A/P pair. We skip the higher-valued one,
and let the code for operand checking handle OR-ing in the bit. */
if (machine_opcodes[i].opcode & 1)
@@ -297,7 +297,7 @@ void
else
skipnext = 1;
}
-
+
retval = hash_insert (op_hash, name, &machine_opcodes[i]);
if (retval != NULL && *retval != '\0')
{
@@ -306,10 +306,10 @@ void
lose = 1;
}
}
-
+
if (lose)
as_fatal("Broken assembler. No assembly attempted.");
-
+
for (i = '0'; i < '8'; ++i)
octal[i] = 1;
for (i = '0'; i <= '9'; ++i)
@@ -318,7 +318,7 @@ void
toHex[i] = i + 10 - 'a';
for (i = 'A'; i <= 'F'; ++i)
toHex[i] = i + 10 - 'A';
-
+
define_some_regs ();
}
@@ -335,13 +335,13 @@ char *str;
{
char *toP;
/* !!!! int rsd; */
-
+
know(str);
machine_ip(str);
toP = frag_more(4);
/* put out the opcode */
md_number_to_chars(toP, the_insn.opcode, 4);
-
+
/* put out the symbol-dependent stuff */
if (the_insn.reloc != NO_RELOC) {
fix_new(
@@ -365,12 +365,12 @@ expressionS *operandp;
char *save = input_line_pointer;
char *new;
segT seg;
-
+
input_line_pointer = s;
seg = expr (0, operandp);
new = input_line_pointer;
input_line_pointer = save;
-
+
switch (seg) {
case SEG_ABSOLUTE:
case SEG_TEXT:
@@ -381,18 +381,18 @@ expressionS *operandp;
case SEG_BIG:
case SEG_REGISTER:
return new;
-
+
case SEG_ABSENT:
as_bad("Missing operand");
return new;
-
+
default:
as_bad("Don't understand operand of type %s", segment_name (seg));
return new;
}
}
-/* Instruction parsing. Takes a string containing the opcode.
+/* Instruction parsing. Takes a string containing the opcode.
Operands are at input_line_pointer. Output is in the_insn.
Warnings or errors are generated. */
@@ -411,22 +411,22 @@ char *str;
expressionS the_operand;
expressionS *operand = &the_operand;
unsigned int reg;
-
+
/* Must handle `div0' opcode. */
s = str;
if (isalpha(*s))
for (; isalnum(*s); ++s)
if (isupper (*s))
*s = tolower (*s);
-
+
switch (*s) {
case '\0':
break;
-
+
case ' ': /* FIXME-SOMEDAY more whitespace */
*s++ = '\0';
break;
-
+
default:
as_bad("Unknown opcode: `%s'", str);
return;
@@ -439,7 +439,7 @@ char *str;
opcode = insn->opcode;
memset(&the_insn, '\0', sizeof(the_insn));
the_insn.reloc = NO_RELOC;
-
+
/*
* Build the opcode, checking as we go to make
* sure that the operands match.
@@ -449,10 +449,10 @@ char *str;
*/
if (insn->args[0] != '\0')
s = parse_operand (s, operand); /* Prime the pump */
-
+
for (args = insn->args; ; ++args) {
switch (*args) {
-
+
case '\0': /* end of args */
if (*s == '\0') {
/* We are truly done. */
@@ -461,21 +461,21 @@ char *str;
}
as_bad("Too many operands: %s", s);
break;
-
+
case ',': /* Must match a comma */
if (*s++ == ',') {
s = parse_operand (s, operand); /* Parse next opnd */
continue;
}
break;
-
+
case 'v': /* Trap numbers (immediate field) */
if (operand->X_seg == SEG_ABSOLUTE) {
if (operand->X_add_number < 256) {
opcode |= (operand->X_add_number << 16);
continue;
} else {
- as_bad("Immediate value of %d is too large",
+ as_bad("Immediate value of %d is too large",
operand->X_add_number);
continue;
}
@@ -484,21 +484,21 @@ char *str;
the_insn.reloc_offset = 1; /* BIG-ENDIAN Byte 1 of insn */
the_insn.exp = *operand;
continue;
-
+
case 'b': /* A general register or 8-bit immediate */
case 'i':
/* We treat the two cases identically since we mashed
them together in the opcode table. */
if (operand->X_seg == SEG_REGISTER)
goto general_reg;
-
+
opcode |= IMMEDIATE_BIT;
if (operand->X_seg == SEG_ABSOLUTE) {
if (operand->X_add_number < 256) {
opcode |= operand->X_add_number;
continue;
} else {
- as_bad("Immediate value of %d is too large",
+ as_bad("Immediate value of %d is too large",
operand->X_add_number);
continue;
}
@@ -507,7 +507,7 @@ char *str;
the_insn.reloc_offset = 3; /* BIG-ENDIAN Byte 3 of insn */
the_insn.exp = *operand;
continue;
-
+
case 'a': /* next operand must be a register */
case 'c':
general_reg:
@@ -519,7 +519,7 @@ char *str;
reg = operand->X_add_number;
if (reg >= SREG)
break; /* No special registers */
-
+
/*
* Got the register, now figure out where
* it goes in the opcode.
@@ -528,19 +528,19 @@ char *str;
case 'a':
opcode |= reg << 8;
continue;
-
+
case 'b':
case 'i':
opcode |= reg;
continue;
-
+
case 'c':
opcode |= reg << 16;
continue;
}
as_fatal("failed sanity check.");
break;
-
+
case 'x': /* 16 bit constant, zero-extended */
case 'X': /* 16 bit constant, one-extended */
if (operand->X_seg == SEG_ABSOLUTE) {
@@ -551,7 +551,7 @@ char *str;
the_insn.reloc = RELOC_CONST;
the_insn.exp = *operand;
continue;
-
+
case 'h':
if (operand->X_seg == SEG_ABSOLUTE) {
opcode |= (operand->X_add_number & 0x00FF0000) >> 16 |
@@ -562,7 +562,7 @@ char *str;
the_insn.reloc = RELOC_CONSTH;
the_insn.exp = *operand;
continue;
-
+
case 'P': /* PC-relative jump address */
case 'A': /* Absolute jump address */
/* These two are treated together since we folded the
@@ -578,7 +578,7 @@ char *str;
the_insn.pcrel = 1; /* Assume PC-relative jump */
/* FIXME-SOON, Do we figure out whether abs later, after know sym val? */
continue;
-
+
case 'e': /* Coprocessor enable bit for LOAD/STORE insn */
if (operand->X_seg == SEG_ABSOLUTE) {
if (operand->X_add_number == 0)
@@ -589,7 +589,7 @@ char *str;
}
}
break;
-
+
case 'n': /* Control bits for LOAD/STORE instructions */
if (operand->X_seg == SEG_ABSOLUTE &&
operand->X_add_number < 128) {
@@ -597,7 +597,7 @@ char *str;
continue;
}
break;
-
+
case 's': /* Special register number */
if (operand->X_seg != SEG_REGISTER)
break; /* Only registers */
@@ -605,7 +605,7 @@ char *str;
break; /* Not a special register */
opcode |= (operand->X_add_number & 0xFF) << 8;
continue;
-
+
case 'u': /* UI bit of CONVERT */
if (operand->X_seg == SEG_ABSOLUTE) {
if (operand->X_add_number == 0)
@@ -616,7 +616,7 @@ char *str;
}
}
break;
-
+
case 'r': /* RND bits of CONVERT */
if (operand->X_seg == SEG_ABSOLUTE &&
operand->X_add_number < 8) {
@@ -624,7 +624,7 @@ char *str;
continue;
}
break;
-
+
case 'd': /* FD bits of CONVERT */
if (operand->X_seg == SEG_ABSOLUTE &&
operand->X_add_number < 4) {
@@ -632,8 +632,8 @@ char *str;
continue;
}
break;
-
-
+
+
case 'f': /* FS bits of CONVERT */
if (operand->X_seg == SEG_ABSOLUTE &&
operand->X_add_number < 4) {
@@ -641,7 +641,7 @@ char *str;
continue;
}
break;
-
+
case 'C':
if (operand->X_seg == SEG_ABSOLUTE &&
operand->X_add_number < 4) {
@@ -649,7 +649,7 @@ char *str;
continue;
}
break;
-
+
case 'F':
if (operand->X_seg == SEG_ABSOLUTE &&
operand->X_add_number < 16) {
@@ -657,7 +657,7 @@ char *str;
continue;
}
break;
-
+
default:
BAD_CASE (*args);
}
@@ -670,7 +670,7 @@ char *str;
/*
This is identical to the md_atof in m68k.c. I think this is right,
but I'm not sure.
-
+
Turn a string in input_line_pointer into a floating point constant of type
type, and store the appropriate bytes in *litP. The number of LITTLENUMS
emitted is stored in *sizeP. An error message is returned, or NULL on OK.
@@ -689,33 +689,33 @@ int *sizeP;
LITTLENUM_TYPE words[MAX_LITTLENUMS];
LITTLENUM_TYPE *wordP;
char *t;
-
+
switch (type) {
-
+
case 'f':
case 'F':
case 's':
case 'S':
prec = 2;
break;
-
+
case 'd':
case 'D':
case 'r':
case 'R':
prec = 4;
break;
-
+
case 'x':
case 'X':
prec = 6;
break;
-
+
case 'p':
case 'P':
prec = 6;
break;
-
+
default:
*sizeP=0;
return "Bad call to MD_ATOF()";
@@ -740,9 +740,9 @@ char *buf;
long val;
int n;
{
-
+
switch (n) {
-
+
case 4:
*buf++ = val >> 24;
*buf++ = val >> 16;
@@ -751,7 +751,7 @@ int n;
case 1:
*buf = val;
break;
-
+
default:
as_fatal("failed sanity check.");
}
@@ -763,13 +763,13 @@ fixS *fixP;
long val;
{
char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;
-
+
fixP->fx_addnumber = val; /* Remember value for emit_reloc */
-
-
+
+
know(fixP->fx_size == 4);
know(fixP->fx_r_type < NO_RELOC);
-
+
/*
* This is a hack. There should be a better way to
* handle this.
@@ -777,20 +777,20 @@ long val;
if (fixP->fx_r_type == RELOC_WDISP30 && fixP->fx_addsy) {
val += fixP->fx_where + fixP->fx_frag->fr_address;
}
-
+
switch (fixP->fx_r_type) {
-
+
case RELOC_32:
buf[0] = val >> 24;
buf[1] = val >> 16;
buf[2] = val >> 8;
buf[3] = val;
break;
-
+
case RELOC_8:
buf[0] = val;
break;
-
+
case RELOC_WDISP30:
val = (val >>= 2) + 1;
buf[0] |= (val >> 24) & 0x3f;
@@ -798,23 +798,23 @@ long val;
buf[2] = val >> 8;
buf[3] = val;
break;
-
+
case RELOC_HI22:
buf[1] |= (val >> 26) & 0x3f;
buf[2] = val >> 18;
buf[3] = val >> 10;
break;
-
+
case RELOC_LO10:
buf[2] |= (val >> 8) & 0x03;
buf[3] = val;
break;
-
+
case RELOC_BASE13:
buf[2] |= (val >> 8) & 0x1f;
buf[3] = val;
break;
-
+
case RELOC_WDISP22:
val = (val >>= 2) + 1;
/* FALLTHROUGH */
@@ -823,31 +823,31 @@ long val;
buf[2] = val >> 8;
buf[3] = val;
break;
-
+
#if 0
- case RELOC_PC10:
- case RELOC_PC22:
+ case RELOC_PC10:
+ case RELOC_PC22:
case RELOC_JMP_TBL:
case RELOC_SEGOFF16:
case RELOC_GLOB_DAT:
- case RELOC_JMP_SLOT:
+ case RELOC_JMP_SLOT:
case RELOC_RELATIVE:
#endif
case RELOC_JUMPTARG: /* 00XX00XX pattern in a word */
buf[1] = val >> 10; /* Holds bits 0003FFFC of address */
buf[3] = val >> 2;
break;
-
+
case RELOC_CONST: /* 00XX00XX pattern in a word */
buf[1] = val >> 8; /* Holds bits 0000XXXX */
buf[3] = val;
break;
-
+
case RELOC_CONSTH: /* 00XX00XX pattern in a word */
buf[1] = val >> 24; /* Holds bits XXXX0000 */
buf[3] = val >> 16;
break;
-
+
case NO_RELOC:
default:
as_bad("bad relocation type: 0x%02x", fixP->fx_r_type);
@@ -860,11 +860,11 @@ long val;
short tc_coff_fix2rtype(fixP)
fixS *fixP;
{
-
+
/* FIXME-NOW: relocation type handling is not yet written for
a29k. */
-
-
+
+
switch (fixP->fx_r_type) {
case RELOC_32: return(R_WORD);
case RELOC_8: return(R_BYTE);
@@ -874,7 +874,7 @@ fixS *fixP;
default: printf("need %o3\n", fixP->fx_r_type);
abort(0);
} /* switch on type */
-
+
return(0);
} /* tc_coff_fix2rtype() */
#endif /* OBJ_COFF */
@@ -950,7 +950,7 @@ struct machine_it *insn;
"RELOC_RELATIVE",
"NO_RELOC"
};
-
+
if (insn->error) {
fprintf(stderr, "ERROR: %s\n");
}
@@ -959,11 +959,11 @@ struct machine_it *insn;
fprintf(stderr, "exp = {\n");
fprintf(stderr, "\t\tX_add_symbol = %s\n",
insn->exp.X_add_symbol ?
- (S_GET_NAME(insn->exp.X_add_symbol) ?
+ (S_GET_NAME(insn->exp.X_add_symbol) ?
S_GET_NAME(insn->exp.X_add_symbol) : "???") : "0");
fprintf(stderr, "\t\tX_sub_symbol = %s\n",
insn->exp.X_subtract_symbol ?
- (S_GET_NAME(insn->exp.X_subtract_symbol) ?
+ (S_GET_NAME(insn->exp.X_subtract_symbol) ?
S_GET_NAME(insn->exp.X_subtract_symbol) : "???") : "0");
fprintf(stderr, "\t\tX_add_number = %d\n",
insn->exp.X_add_number);
@@ -973,7 +973,7 @@ struct machine_it *insn;
#endif
/* Translate internal representation of relocation info to target format.
-
+
On sparc/29k: first 4 bytes are normal unsigned long address, next three
bytes are index, most sig. byte first. Byte 7 is broken up with
bit 7 as external, bits 6 & 5 unused, and the lower
@@ -988,25 +988,25 @@ fixS *fixP;
relax_addressT segment_address_in_file;
{
long r_symbolnum;
-
+
know(fixP->fx_r_type < NO_RELOC);
know(fixP->fx_addsy != NULL);
-
+
md_number_to_chars(where,
fixP->fx_frag->fr_address + fixP->fx_where - segment_address_in_file,
4);
-
+
r_symbolnum = (S_IS_DEFINED(fixP->fx_addsy)
? S_GET_TYPE(fixP->fx_addsy)
: fixP->fx_addsy->sy_number);
-
+
where[4] = (r_symbolnum >> 16) & 0x0ff;
where[5] = (r_symbolnum >> 8) & 0x0ff;
where[6] = r_symbolnum & 0x0ff;
where[7] = (((!S_IS_DEFINED(fixP->fx_addsy)) << 7) & 0x80) | (0 & 0x60) | (fixP->fx_r_type & 0x1F);
/* Also easy */
md_number_to_chars(&where[8], fixP->fx_addnumber, 4);
-
+
return;
} /* tc_aout_fix_to_chars() */
@@ -1031,7 +1031,7 @@ char *name;
{
long regnum;
char testbuf[5+ /*SLOP*/ 5];
-
+
if (name[0] == 'g' || name[0] == 'G' || name[0] == 'l' || name[0] == 'L')
{
/* Perhaps a global or local register name */
@@ -1045,14 +1045,14 @@ char *name;
sprintf(testbuf, "%ld", regnum);
if (strcmp (testbuf, &name[2]) != 0)
return 0; /* gr007 or lr7foo or whatever */
-
+
/* We have a wiener! Define and return a new symbol for it. */
if (name[0] == 'l' || name[0] == 'L')
regnum += 128;
return(symbol_new(name, SEG_REGISTER, regnum, &zero_address_frag));
}
}
-
+
return 0;
}
@@ -1061,7 +1061,7 @@ char *name;
void md_operand(expressionP)
expressionS *expressionP;
{
-
+
if (input_line_pointer[0] == '%' && input_line_pointer[1] == '%')
{
/* We have a numeric register expression. No biggy. */
diff --git a/gnu/usr.bin/as/config/tc-a29k.h b/gnu/usr.bin/as/config/tc-a29k.h
index fee1ca2..a362595 100644
--- a/gnu/usr.bin/as/config/tc-a29k.h
+++ b/gnu/usr.bin/as/config/tc-a29k.h
@@ -1,18 +1,18 @@
/* tc-a29k.h -- Assemble for the AMD 29000.
Copyright (C) 1989, 1990, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -31,7 +31,7 @@
#define BFD_ARCH bfd_arch_a29k
#define COFF_MAGIC SIPFBOMAGIC
-/* Should the reloc be output ?
+/* Should the reloc be output ?
on the 29k, this is true only if there is a symbol attatched.
on the h8, this is allways true, since no fixup is done
*/
diff --git a/gnu/usr.bin/as/config/tc-generic.h b/gnu/usr.bin/as/config/tc-generic.h
index 181d4aa..7a16dd0 100644
--- a/gnu/usr.bin/as/config/tc-generic.h
+++ b/gnu/usr.bin/as/config/tc-generic.h
@@ -1,19 +1,19 @@
/* This file is tc-generic.h
Copyright (C) 1987-1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
diff --git a/gnu/usr.bin/as/config/tc-h8300.c b/gnu/usr.bin/as/config/tc-h8300.c
index db4786b..2ce2f2b 100644
--- a/gnu/usr.bin/as/config/tc-h8300.c
+++ b/gnu/usr.bin/as/config/tc-h8300.c
@@ -1,24 +1,24 @@
/* tc-h8300.c -- Assemble code for the Hitachi H8/300
Copyright (C) 1991, 1992 Free Software Foundation.
-
+
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, 675 Mass Ave, Cambridge, MA 02139, USA. */
-/*
+/*
Written By Steve Chamberlain
sac@cygnus.com
*/
@@ -84,7 +84,7 @@ struct reg_entry
char number;
};
-struct reg_entry reg_list[] = {
+struct reg_entry reg_list[] = {
"r0",WORD_REG +0,
"r1",WORD_REG +1,
"r2",WORD_REG +2,
@@ -120,17 +120,17 @@ struct reg_entry reg_list[] = {
#endif
-void md_begin ()
+void md_begin ()
{
struct h8_opcode *opcode;
const struct reg_entry *reg;
char prev_buffer[100];
int idx = 0;
-
+
opcode_hash_control = hash_new();
prev_buffer[0] = 0;
-
- for (opcode = h8_opcodes; opcode->name; opcode++)
+
+ for (opcode = h8_opcodes; opcode->name; opcode++)
{
/* Strip off any . part when inserting the opcode and only enter
unique codes into the hash table
@@ -139,7 +139,7 @@ void md_begin ()
unsigned int len = strlen(src);
char *dst = malloc(len+1);
char *buffer = dst;
- opcode->size = 0;
+ opcode->size = 0;
while (*src) {
if (*src == '.') {
*dst++ = 0;
@@ -149,15 +149,15 @@ void md_begin ()
}
*dst++ = *src++;
}
- if (strcmp(buffer, prev_buffer))
+ if (strcmp(buffer, prev_buffer))
{
hash_insert(opcode_hash_control, buffer, (char *)opcode);
strcpy(prev_buffer, buffer);
idx++;
}
opcode->idx = idx;
-
-
+
+
/* Find the number of operands */
opcode->noperands = 0;
while (opcode->args.nib[opcode->noperands] != E)
@@ -167,7 +167,7 @@ void md_begin ()
while (opcode->data.nib[opcode->length*2] != E)
opcode->length++;
}
-
+
}
@@ -176,7 +176,7 @@ struct h8_exp {
char *e_end;
expressionS e_exp;
};
-struct h8_op
+struct h8_op
{
unsigned int dispreg;
op_type mode;
@@ -187,14 +187,14 @@ struct h8_op
/*
- parse operands
+ parse operands
WREG r0,r1,r2,r3,r4,r5,r6,r7,fp,sp
r0l,r0h,..r7l,r7h
@WREG
@WREG+
@-WREG
#const
-
+
*/
op_type r8_sord[] = {RS8, RD8};
@@ -204,42 +204,42 @@ op_type abs_sord[2] = {ABS16SRC, ABS16DST};
op_type disp_sord[] = {DISPSRC, DISPDST};
/* try and parse a reg name, returns number of chars consumed */
-int
+int
DEFUN(parse_reg,(src, mode, reg, dst),
char *src AND
op_type *mode AND
unsigned int *reg AND
int dst)
{
- if (src[0] == 's' && src[1] == 'p')
+ if (src[0] == 's' && src[1] == 'p')
{
*mode = r16_sord[dst];
*reg = 7;
return 2;
}
- if (src[0] == 'c' && src[1] == 'c' && src[2] == 'r')
+ if (src[0] == 'c' && src[1] == 'c' && src[2] == 'r')
{
*mode = CCR;
*reg = 0;
return 3;
}
- if (src[0] == 'f' && src[1] == 'p')
+ if (src[0] == 'f' && src[1] == 'p')
{
*mode = r16_sord[dst];
*reg = 6;
return 2;
}
- if (src[0] == 'r')
+ if (src[0] == 'r')
{
- if (src[1] >= '0' && src[1] <= '7')
+ if (src[1] >= '0' && src[1] <= '7')
{
- if (src[2] == 'l')
+ if (src[2] == 'l')
{
*mode = r8_sord[dst];
*reg = (src[1] - '0') + 8;
return 3;
}
- if (src[2] == 'h')
+ if (src[2] == 'h')
{
*mode = r8_sord[dst];
*reg = (src[1] - '0') ;
@@ -265,7 +265,7 @@ char *
seg = expr(0,op);
new = input_line_pointer;
input_line_pointer = save;
- if (SEG_NORMAL(seg))
+ if (SEG_NORMAL(seg))
return new;
switch (seg) {
case SEG_ABSOLUTE:
@@ -291,13 +291,13 @@ static char *
ptr++;
while (isdigit(*ptr))
ptr++;
-
+
}
return ptr;
}
/* The many forms of operand:
-
+
Rn Register direct
@Rn Register indirect
@(exp[:16], Rn) Register indirect with displacement
@@ -306,17 +306,17 @@ static char *
@aa:8 absolute 8 bit
@aa:16 absolute 16 bit
@aa absolute 16 bit
-
+
#xx[:size] immediate data
@(exp:[8], pc) pc rel
@@aa[:8] memory indirect
-
+
*/
-static void
+static void
DEFUN(get_operand,(ptr, op, dst),
- char **ptr AND
- struct h8_op *op AND
+ char **ptr AND
+ struct h8_op *op AND
unsigned int dst)
{
char *src = *ptr;
@@ -325,48 +325,48 @@ static void
unsigned int len;
unsigned int size;
op->mode = E;
-
+
len = parse_reg(src, &op->mode, &op->reg, dst);
if (len) {
*ptr = src + len;
return ;
}
-
- if (*src == '@')
+
+ if (*src == '@')
{
src++;
- if (*src == '@')
+ if (*src == '@')
{
src++;
src = parse_exp(src,&op->exp);
src = skip_colonthing(src);
-
+
*ptr = src;
-
+
op->mode = MEMIND;
return;
-
+
}
-
-
- if (*src == '-')
- {
+
+
+ if (*src == '-')
+ {
src++;
len = parse_reg(src, &mode, &num, dst);
- if (len == 0)
+ if (len == 0)
{
/* Oops, not a reg after all, must be ordinary exp */
src--;
/* must be a symbol */
op->mode = abs_sord[dst];
*ptr = skip_colonthing(parse_exp(src, &op->exp));
-
+
return;
-
-
+
+
}
-
- if (mode != r16_sord[dst])
+
+ if (mode != r16_sord[dst])
{
as_bad("@- needs word register");
}
@@ -375,13 +375,13 @@ static void
*ptr = src + len;
return;
}
- if (*src == '(' && ')')
+ if (*src == '(' && ')')
{
/* Disp */
src++;
src = parse_exp(src, &op->exp);
-
- if (*src == ')')
+
+ if (*src == ')')
{
src++;
op->mode = abs_sord[dst];
@@ -389,8 +389,8 @@ static void
return;
}
src = skip_colonthing(src);
-
- if (*src != ',')
+
+ if (*src != ',')
{
as_bad("expected @(exp, reg16)");
}
@@ -403,24 +403,24 @@ static void
op->mode = disp_sord[dst];
src += len;
src = skip_colonthing(src);
-
- if (*src != ')' && '(')
+
+ if (*src != ')' && '(')
{
as_bad("expected @(exp, reg16)");
-
+
}
*ptr = src +1;
-
+
return;
}
len = parse_reg(src, &mode, &num, dst);
-
+
if (len) {
src += len;
- if (*src == '+')
+ if (*src == '+')
{
src++;
- if (mode != RS16)
+ if (mode != RS16)
{
as_bad("@Rn+ needs src word register");
}
@@ -429,7 +429,7 @@ static void
*ptr = src;
return;
}
- if (mode != r16_sord[dst])
+ if (mode != r16_sord[dst])
{
as_bad("@Rn needs word register");
}
@@ -438,23 +438,23 @@ static void
*ptr = src;
return;
}
- else
+ else
{
/* must be a symbol */
op->mode = abs_sord[dst];
*ptr = skip_colonthing(parse_exp(src, &op->exp));
-
+
return;
}
}
-
-
+
+
if (*src == '#') {
src++;
op->mode = IMM16;
src = parse_exp(src, &op->exp);
*ptr= skip_colonthing(src);
-
+
return;
}
else {
@@ -469,35 +469,35 @@ static
DEFUN(get_operands,(noperands,op_end, operand),
unsigned int noperands AND
char *op_end AND
- struct h8_op *operand)
+ struct h8_op *operand)
{
char *ptr = op_end;
- switch (noperands)
+ switch (noperands)
{
case 0:
operand[0].mode = 0;
operand[1].mode = 0;
break;
-
- case 1:
+
+ case 1:
ptr++;
get_operand(& ptr, operand +0,0);
operand[1].mode =0;
break;
-
+
case 2:
ptr++;
get_operand(& ptr, operand +0,0);
if (*ptr == ',') ptr++;
get_operand(& ptr, operand +1, 1);
break;
-
+
default:
- abort();
+ abort();
}
-
-
- return ptr;
+
+
+ return ptr;
}
/* Passed a pointer to a list of opcodes which use different
@@ -514,18 +514,18 @@ static
struct h8_opcode *this_try = opcode ;
int found = 0;
unsigned int noperands = opcode->noperands;
-
+
unsigned int dispreg;
unsigned int this_index = opcode->idx;
- while (this_index == opcode->idx && !found)
+ while (this_index == opcode->idx && !found)
{
unsigned int i;
-
+
this_try = opcode ++;
- for (i = 0; i < noperands; i++)
+ for (i = 0; i < noperands; i++)
{
op_type op = (this_try->args.nib[i]) & ~(B30|B31);
- switch (op)
+ switch (op)
{
case Hex0:
case Hex1:
@@ -546,7 +546,7 @@ static
break;
case DISPSRC:
case DISPDST:
- operands[0].dispreg = operands[i].reg;
+ operands[0].dispreg = operands[i].reg;
case RD8:
case RS8:
case RDIND:
@@ -571,7 +571,7 @@ static
case ABS8SRC:
case ABS16OR8SRC:
case ABS16ORREL8SRC:
-
+
if (operands[i].mode != ABS16SRC) goto fail;
break;
case ABS16OR8DST:
@@ -584,9 +584,9 @@ static
found =1;
fail: ;
}
- if (found)
+ if (found)
return this_try;
- else
+ else
return 0;
}
@@ -596,10 +596,10 @@ static void
unsigned int width AND
char *string)
{
- if (operand->exp.X_add_symbol == 0
+ if (operand->exp.X_add_symbol == 0
&& operand->exp.X_subtract_symbol == 0)
{
-
+
/* No symbol involved, let's look at offset, it's dangerous if any of
the high bits are not 0 or ff's, find out by oring or anding with
the width and seeing if the answer is 0 or all fs*/
@@ -609,19 +609,19 @@ static void
as_warn("operand %s0x%x out of range.", string, operand->exp.X_add_number);
}
}
-
+
}
/* Now we know what sort of opcodes it is, lets build the bytes -
*/
-static void
+static void
DEFUN (build_bytes,(this_try, operand),
struct h8_opcode *this_try AND
struct h8_op *operand)
{
unsigned int i;
-
+
char *output = frag_more(this_try->length);
char *output_ptr = output;
op_type *nibble_ptr = this_try->data.nib;
@@ -630,18 +630,18 @@ static void
char high;
int nib;
top: ;
- while (*nibble_ptr != E)
+ while (*nibble_ptr != E)
{
int nibble;
- for (nibble = 0; nibble <2; nibble++)
+ for (nibble = 0; nibble <2; nibble++)
{
c = *nibble_ptr & ~(B30|B31);
- switch (c)
+ switch (c)
{
default:
abort();
case KBIT:
- switch (operand[0].exp.X_add_number)
+ switch (operand[0].exp.X_add_number)
{
case 1:
nib = 0;
@@ -659,7 +659,7 @@ static void
case 0:
case 1:
case 2: case 3: case 4: case 5: case 6:
- case 7: case 8: case 9: case 10: case 11:
+ case 7: case 8: case 9: case 10: case 11:
case 12: case 13: case 14: case 15:
nib = c;
break;
@@ -670,23 +670,23 @@ static void
operand[0].mode = IMM8;
nib = 0;
break;
-
+
case DISPDST:
nib = 0;
break;
- case IMM3:
+ case IMM3:
if (operand[0].exp.X_add_symbol == 0) {
operand[0].mode = 0; /* stop it making a fix */
nib = (operand[0].exp.X_add_number);
}
else as_bad("can't have symbol for bit number");
- if (nib < 0 || nib > 7)
+ if (nib < 0 || nib > 7)
{
as_bad("Bit number out of range %d", nib);
}
-
+
break;
-
+
case ABS16DST:
nib = 0;
break;
@@ -700,35 +700,35 @@ static void
break;
case ABS16OR8DST:
operand[1].mode = c;
-
+
nib = 0;
-
+
break;
-
+
case ABS16ORREL8SRC:
operand[0].mode = c;
nib=0;
break;
-
+
case ABS16OR8SRC:
operand[0].mode = ABS16OR8SRC;
nib = 0;
break;
- case DISPSRC:
+ case DISPSRC:
operand[0].mode = ABS16SRC;
nib = 0;
break;
-
+
case DISP8:
operand[0].mode = DISP8;
nib = 0;
break;
-
+
case ABS16SRC:
case IMM16:
case IGNORE:
case MEMIND:
-
+
nib=0;
break;
case RS8:
@@ -737,22 +737,22 @@ static void
case RSINC:
nib = operand[0].reg;
break;
-
+
case RD8:
case RD16:
case RDDEC:
case RDIND:
nib = operand[1].reg;
break;
-
- case E:
+
+ case E:
abort();
break;
}
if (*nibble_ptr & B31) {
nib |=0x8;
}
-
+
if (nibble == 0) {
*output_ptr = nib << 4;
}
@@ -762,21 +762,21 @@ static void
}
nibble_ptr++;
}
-
+
}
-
+
/* output any fixes */
- for (i = 0; i < 2; i++)
+ for (i = 0; i < 2; i++)
{
switch (operand[i].mode) {
case 0:
break;
-
+
case DISP8:
check_operand(operand+i, 0x7f,"@");
-
+
fix_new(frag_now,
- output - frag_now->fr_literal + 1,
+ output - frag_now->fr_literal + 1,
1,
operand[i].exp.X_add_symbol,
operand[i].exp.X_subtract_symbol,
@@ -788,14 +788,14 @@ static void
check_operand(operand+i, 0xff,"#");
/* If there is nothing else going on we can safely
reloc in place */
- if (operand[i].exp.X_add_symbol == 0)
+ if (operand[i].exp.X_add_symbol == 0)
{
output[1] = operand[i].exp.X_add_number;
}
- else
+ else
{
fix_new(frag_now,
- output - frag_now->fr_literal + 1,
+ output - frag_now->fr_literal + 1,
1,
operand[i].exp.X_add_symbol,
operand[i].exp.X_subtract_symbol,
@@ -803,12 +803,12 @@ static void
0,
R_RELBYTE);
}
-
+
break;
case MEMIND:
check_operand(operand+i, 0xff,"@@");
fix_new(frag_now,
- output - frag_now->fr_literal + 1,
+ output - frag_now->fr_literal + 1,
1,
operand[i].exp.X_add_symbol,
operand[i].exp.X_subtract_symbol,
@@ -820,7 +820,7 @@ static void
case ABS8SRC:
check_operand(operand+i, 0xff,"@");
fix_new(frag_now,
- output - frag_now->fr_literal + 1,
+ output - frag_now->fr_literal + 1,
1,
operand[i].exp.X_add_symbol,
operand[i].exp.X_subtract_symbol,
@@ -828,13 +828,13 @@ static void
0,
R_RELBYTE);
break;
-
- case ABS16OR8SRC:
+
+ case ABS16OR8SRC:
case ABS16OR8DST:
check_operand(operand+i, 0xffff,"@");
-
+
fix_new(frag_now,
- output - frag_now->fr_literal + 2,
+ output - frag_now->fr_literal + 2,
2,
operand[i].exp.X_add_symbol,
operand[i].exp.X_subtract_symbol,
@@ -842,12 +842,12 @@ static void
0,
R_MOVB1);
break;
-
- case ABS16ORREL8SRC:
+
+ case ABS16ORREL8SRC:
check_operand(operand+i, 0xffff,"@");
-
+
fix_new(frag_now,
- output - frag_now->fr_literal + 2,
+ output - frag_now->fr_literal + 2,
2,
operand[i].exp.X_add_symbol,
operand[i].exp.X_subtract_symbol,
@@ -855,26 +855,26 @@ static void
0,
R_JMP1);
break;
-
-
+
+
case ABS16SRC:
case ABS16DST:
case IMM16:
case DISPSRC:
case DISPDST:
check_operand(operand+i, 0xffff,"@");
- if (operand[i].exp.X_add_symbol == 0)
+ if (operand[i].exp.X_add_symbol == 0)
{
/* This should be done with bfd */
- output[3] = operand[i].exp.X_add_number & 0xff;
+ output[3] = operand[i].exp.X_add_number & 0xff;
output[2] = operand[i].exp.X_add_number >> 8;
-
+
}
- else
+ else
{
-
+
fix_new(frag_now,
- output - frag_now->fr_literal + 2,
+ output - frag_now->fr_literal + 2,
2,
operand[i].exp.X_add_symbol,
operand[i].exp.X_subtract_symbol,
@@ -882,25 +882,25 @@ static void
0,
R_RELWORD);
}
-
+
break;
case RS8:
case RD8:
case RS16:
case RD16:
- case RDDEC:
+ case RDDEC:
case KBIT:
case RSINC:
case RDIND:
case RSIND:
case CCR:
-
+
break;
default:
abort();
}
}
-
+
}
/*
try and give an intelligent error message for common and simple to
@@ -913,48 +913,48 @@ static void
struct h8_op *operand)
{
struct h8_opcode *scan = opcode;
-
- /* Find out if there was more than one possible opccode */
-
- if ((opcode+1)->idx != opcode->idx)
+
+ /* Find out if there was more than one possible opccode */
+
+ if ((opcode+1)->idx != opcode->idx)
{
unsigned int argn;
-
+
/* Only one opcode of this flavour, try and guess which operand
didn't match */
- for (argn = 0; argn < opcode->noperands; argn++)
+ for (argn = 0; argn < opcode->noperands; argn++)
{
- switch (opcode->args.nib[argn])
+ switch (opcode->args.nib[argn])
{
case RD16:
- if (operand[argn].mode != RD16)
+ if (operand[argn].mode != RD16)
{
- as_bad("destination operand must be 16 bit register");
+ as_bad("destination operand must be 16 bit register");
}
return;
case RS8:
-
- if (operand[argn].mode != RS8)
+
+ if (operand[argn].mode != RS8)
{
as_bad("source operand must be 8 bit register");
}
return;
case ABS16DST:
- if (operand[argn].mode != ABS16DST)
+ if (operand[argn].mode != ABS16DST)
{
as_bad("destination operand must be 16bit absolute address");
return;
}
-
+
case RD8:
- if (operand[argn].mode != RD8)
+ if (operand[argn].mode != RD8)
{
- as_bad("destination operand must be 8 bit register");
+ as_bad("destination operand must be 8 bit register");
}
return;
-
+
case ABS16SRC:
- if (operand[argn].mode != ABS16SRC)
+ if (operand[argn].mode != ABS16SRC)
{
as_bad("source operand must be 16bit absolute address");
return;
@@ -972,27 +972,27 @@ static void
-void
+void
DEFUN(md_assemble,(str),
char *str)
{
char *op_start;
char *op_end;
unsigned int i;
- struct h8_op operand[2];
+ struct h8_op operand[2];
struct h8_opcode * opcode;
struct h8_opcode * prev_opcode;
-
+
char *dot = 0;
- char c;
+ char c;
/* Drop leading whitespace */
while (*str == ' ')
str++;
-
+
/* find the op code end */
for (op_start = op_end = str;
*op_end != 0 && *op_end != ' ';
- op_end ++)
+ op_end ++)
{
if (*op_end == '.') {
dot = op_end+1;
@@ -1001,57 +1001,57 @@ void
break;
}
}
-
+
;
-
- if (op_end == op_start)
+
+ if (op_end == op_start)
{
as_bad("can't find opcode ");
}
c = *op_end;
-
+
*op_end = 0;
-
+
opcode = (struct h8_opcode *) hash_find(opcode_hash_control,
op_start);
-
- if (opcode == NULL)
+
+ if (opcode == NULL)
{
as_bad("unknown opcode");
return;
}
-
-
+
+
input_line_pointer = get_operands(opcode->noperands, op_end,
operand);
*op_end = c;
prev_opcode = opcode;
-
+
opcode = get_specific(opcode, operand);
-
- if (opcode == 0)
+
+ if (opcode == 0)
{
/* Couldn't find an opcode which matched the operands */
char *where =frag_more(2);
where[0] = 0x0;
where[1] = 0x0;
clever_message(prev_opcode, operand);
-
+
return;
}
- if (opcode->size && dot)
+ if (opcode->size && dot)
{
- if (opcode->size != *dot)
+ if (opcode->size != *dot)
{
as_warn("mismatch between opcode size and operand size");
}
}
-
+
build_bytes(opcode, operand);
-
+
}
-void
+void
DEFUN(tc_crawl_symbol_chain, (headers),
object_headers *headers)
{
@@ -1064,14 +1064,14 @@ symbolS *DEFUN(md_undefined_symbol,(name),
return 0;
}
-void
+void
DEFUN(tc_headers_hook,(headers),
object_headers *headers)
{
- printf("call to tc_headers_hook \n");
+ printf("call to tc_headers_hook \n");
}
void
- DEFUN_VOID(md_end)
+ DEFUN_VOID(md_end)
{
}
@@ -1094,7 +1094,7 @@ int *sizeP;
LITTLENUM_TYPE *wordP;
char *t;
char *atof_ieee();
-
+
switch (type) {
case 'f':
case 'F':
@@ -1102,24 +1102,24 @@ int *sizeP;
case 'S':
prec = 2;
break;
-
+
case 'd':
case 'D':
case 'r':
case 'R':
prec = 4;
break;
-
+
case 'x':
case 'X':
prec = 6;
break;
-
+
case 'p':
case 'P':
prec = 6;
break;
-
+
default:
*sizeP=0;
return "Bad call to MD_ATOF()";
@@ -1127,7 +1127,7 @@ int *sizeP;
t=atof_ieee(input_line_pointer,type,words);
if (t)
input_line_pointer=t;
-
+
*sizeP=prec * sizeof(LITTLENUM_TYPE);
for (wordP=words;prec--;) {
md_number_to_chars(litP,(long)(*wordP++),sizeof(LITTLENUM_TYPE));
@@ -1144,7 +1144,7 @@ char ***vecP;
{
return 0;
-
+
}
int md_short_jump_size;
@@ -1184,7 +1184,7 @@ long
long size)
{
return((size + (1 << section_alignment[(int) seg]) - 1) & (-1 << section_alignment[(int) seg]));
-
+
}
void
@@ -1193,7 +1193,7 @@ fixS *fixP;
long val;
{
char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;
-
+
switch (fixP->fx_size) {
case 1:
*buf++=val;
@@ -1210,11 +1210,11 @@ long val;
break;
default:
abort();
-
+
}
}
-void DEFUN(md_operand, (expressionP),expressionS *expressionP)
+void DEFUN(md_operand, (expressionP),expressionS *expressionP)
{ }
int md_long_jump_size;
@@ -1222,7 +1222,7 @@ int
md_estimate_size_before_relax(fragP, segment_type)
register fragS *fragP;
register segT segment_type;
-{
+{
printf("call tomd_estimate_size_before_relax \n"); abort(); }
/* Put number into target byte order */
@@ -1241,7 +1241,7 @@ void DEFUN(md_number_to_chars,(ptr, use, nbytes),
abort();
}
}
-long md_pcrel_from(fixP)
+long md_pcrel_from(fixP)
fixS *fixP; { abort(); }
void tc_coff_symbol_emit_hook() { }
@@ -1254,17 +1254,17 @@ bfd_vma base;
{
symbolS *symbol_ptr;
-
+
symbol_ptr = fix_ptr->fx_addsy;
-
+
/* If this relocation is attached to a symbol then it's ok
to output it */
if (fix_ptr->fx_r_type == RELOC_32) {
/* cons likes to create reloc32's whatever the size of the reloc..
*/
- switch (fix_ptr->fx_size)
+ switch (fix_ptr->fx_size)
{
-
+
case 2:
intr->r_type = R_RELWORD;
break;
@@ -1273,23 +1273,23 @@ bfd_vma base;
break;
default:
abort();
-
+
}
-
+
}
- else {
+ else {
intr->r_type = fix_ptr->fx_r_type;
}
-
+
intr->r_vaddr = fix_ptr->fx_frag->fr_address + fix_ptr->fx_where +base;
intr->r_offset = fix_ptr->fx_offset;
-
+
if (symbol_ptr)
intr->r_symndx = symbol_ptr->sy_number;
else
intr->r_symndx = -1;
-
-
+
+
}
/* end of tc-h8300.c */
diff --git a/gnu/usr.bin/as/config/tc-h8300.h b/gnu/usr.bin/as/config/tc-h8300.h
index 6da7896..dc01f6c 100644
--- a/gnu/usr.bin/as/config/tc-h8300.h
+++ b/gnu/usr.bin/as/config/tc-h8300.h
@@ -1,19 +1,19 @@
/* This file is tc-h8300.h
Copyright (C) 1987-1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -23,7 +23,7 @@
/* This macro translates between an internal fix and an coff reloc type */
#define TC_COFF_FIX2RTYPE(fixP) abort();
-
+
#define BFD_ARCH bfd_arch_h8300
#define COFF_MAGIC 0x8300
#define TC_COUNT_RELOC(x) (1)
diff --git a/gnu/usr.bin/as/config/tc-i386.c b/gnu/usr.bin/as/config/tc-i386.c
index caadb8a..7aa2174 100644
--- a/gnu/usr.bin/as/config/tc-i386.c
+++ b/gnu/usr.bin/as/config/tc-i386.c
@@ -1,18 +1,18 @@
/* i386.c -- Assemble code for the Intel 80386
Copyright (C) 1989, 1991, 1992 Free Software Foundation.
-
+
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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -25,7 +25,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: tc-i386.c,v 1.2 1993/11/30 20:57:41 jkh Exp $";
+static char rcsid[] = "$Id: tc-i386.c,v 1.3 1994/12/23 22:37:35 nate Exp $";
#endif
#include "as.h"
@@ -42,19 +42,19 @@ typedef struct {
/* SUFFIX holds the opcode suffix (e.g. 'l' for 'movl') if given. */
char suffix;
/* Operands are coded with OPERANDS, TYPES, DISPS, IMMS, and REGS. */
-
+
/* OPERANDS gives the number of given operands. */
unsigned int operands;
-
+
/* REG_OPERANDS, DISP_OPERANDS, MEM_OPERANDS, IMM_OPERANDS give the number of
given register, displacement, memory operands and immediate operands. */
unsigned int reg_operands, disp_operands, mem_operands, imm_operands;
-
+
/* TYPES [i] is the type (see above #defines) which tells us how to
search through DISPS [i] & IMMS [i] & REGS [i] for the required
operand. */
unsigned int types[MAX_OPERANDS];
-
+
/* Displacements (if given) for each operand. */
expressionS *disps[MAX_OPERANDS];
@@ -62,32 +62,32 @@ typedef struct {
/* Relocation type for operand */
enum reloc_type disp_reloc[MAX_OPERANDS];
#endif
-
+
/* Immediate operands (if given) for each operand. */
expressionS *imms[MAX_OPERANDS];
-
+
/* Register operands (if given) for each operand. */
reg_entry *regs[MAX_OPERANDS];
-
+
/* BASE_REG, INDEX_REG, and LOG2_SCALE_FACTOR are used to encode
the base index byte below. */
reg_entry *base_reg;
reg_entry *index_reg;
unsigned int log2_scale_factor;
-
+
/* SEG gives the seg_entry of this insn. It is equal to zero unless
an explicit segment override is given. */
const seg_entry *seg; /* segment for memory operands (if given) */
-
+
/* PREFIX holds all the given prefix opcodes (usually null).
PREFIXES is the size of PREFIX. */
/* richfix: really unsigned? */
unsigned char prefix[MAX_PREFIXES];
unsigned int prefixes;
-
+
/* RM and IB are the modrm byte and the base index byte where the addressing
modes of this insn are encoded. */
-
+
modrm_byte rm;
base_index_byte bi;
@@ -144,7 +144,7 @@ static char save_stack[32];
static char *save_stack_p; /* stack pointer */
#define END_STRING_AND_SAVE(s) *save_stack_p++ = *s; *s = '\0'
#define RESTORE_END_STRING(s) *s = *--save_stack_p
-
+
/* The instruction we're assembling. */
static i386_insn i;
@@ -188,7 +188,7 @@ const relax_typeS md_relax_table[] = {
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
-
+
/* For now we don't use word displacement jumps: they may be
untrustworthy. */
{127+1, -128+1, 0, ENCODE_RELAX_STATE(COND_JUMP,DWORD) },
@@ -199,7 +199,7 @@ const relax_typeS md_relax_table[] = {
1 opcode prefix; 3 displacement bytes */
{0, 0, 4, 0},
{1, 1, 0, 0},
-
+
{127+1, -128+1, 0, ENCODE_RELAX_STATE(UNCOND_JUMP,DWORD) },
/* word jmp adds 2 bytes to frag:
1 opcode prefix; 1 displacement bytes */
@@ -208,7 +208,7 @@ const relax_typeS md_relax_table[] = {
0 opcode prefix; 3 displacement bytes */
{0, 0, 3, 0},
{1, 1, 0, 0},
-
+
};
#if __STDC__ == 1
@@ -283,22 +283,22 @@ static struct hash_control *prefix_hash = (struct hash_control *) 0;
void md_begin ()
{
char * hash_err;
-
+
obstack_begin (&o,4096);
-
+
/* initialize op_hash hash table */
op_hash = hash_new(); /* xmalloc handles error */
-
+
{
register const template *optab;
register templates *core_optab;
char *prev_name;
-
+
optab = i386_optab; /* setup for loop */
prev_name = optab->name;
obstack_grow (&o, optab, sizeof(template));
core_optab = (templates *) xmalloc (sizeof (templates));
-
+
for (optab++; optab < i386_optab_end; optab++) {
if (! strcmp (optab->name, prev_name)) {
/* same name as before --> append to current template list */
@@ -321,43 +321,43 @@ void md_begin ()
}
}
}
-
+
/* initialize reg_hash hash table */
reg_hash = hash_new();
{
register const reg_entry *regtab;
-
+
for (regtab = i386_regtab; regtab < i386_regtab_end; regtab++) {
hash_err = hash_insert (reg_hash, regtab->reg_name, regtab);
if (hash_err && *hash_err) goto hash_error;
}
}
-
+
esp = (reg_entry *) hash_find (reg_hash, "esp");
ebp = (reg_entry *) hash_find (reg_hash, "ebp");
-
+
/* initialize reg_hash hash table */
prefix_hash = hash_new();
{
register const prefix_entry *prefixtab;
-
+
for (prefixtab = i386_prefixtab;
prefixtab < i386_prefixtab_end; prefixtab++) {
hash_err = hash_insert (prefix_hash, prefixtab->prefix_name, prefixtab);
if (hash_err && *hash_err) goto hash_error;
}
}
-
+
/* fill in lexical tables: opcode_chars, operand_chars, space_chars */
- {
+ {
register unsigned int c;
-
+
memset(opcode_chars, '\0', sizeof(opcode_chars));
memset(operand_chars, '\0', sizeof(operand_chars));
memset(space_chars, '\0', sizeof(space_chars));
memset(identifier_chars, '\0', sizeof(identifier_chars));
memset(digit_chars, '\0', sizeof(digit_chars));
-
+
for (c = 0; c < 256; c++) {
if (islower(c) || isdigit(c)) {
opcode_chars[c] = c;
@@ -370,17 +370,17 @@ void md_begin ()
} else if (c == ')' || c == '(') {
register_chars[c] = c;
}
-
+
if (isupper(c) || islower(c) || isdigit(c))
operand_chars[c] = c;
else if (c && strchr(operand_special_chars, c))
operand_chars[c] = c;
-
+
if (isdigit(c) || c == '-') digit_chars[c] = c;
-
+
if (isalpha(c) || c == '_' || c == '.' || isdigit(c))
identifier_chars[c] = c;
-
+
if (c == ' ' || c == '\t') space_chars[c] = c;
}
}
@@ -401,7 +401,7 @@ i386_insn *x;
{
register template *p;
int i;
-
+
fprintf (stdout, "%s: template ", line);
pte (&x->tm);
fprintf (stdout, " modrm: mode %x reg %x reg/mem %x",
@@ -488,7 +488,7 @@ static void pt (t)
unsigned int t;
{
register struct type_name *ty;
-
+
if (t == Unknown) {
fprintf (stdout, "Unknown");
} else {
@@ -510,22 +510,22 @@ char *line;
{
/* Holds temlate once we've found it. */
register template *t;
-
+
/* Possible templates for current insn */
templates *current_templates = (templates *) 0;
-
+
/* Initialize globals. */
memset(&i, '\0', sizeof(i));
memset(disp_expressions, '\0', sizeof(disp_expressions));
memset(im_expressions, '\0', sizeof(im_expressions));
save_stack_p = save_stack; /* reset stack pointer */
-
+
/* Fist parse an opcode & call i386_operand for the operands.
- We assume that the scrubber has arranged it so that line[0] is the valid
+ We assume that the scrubber has arranged it so that line[0] is the valid
start of a (possibly prefixed) opcode. */
{
register char *l = line; /* Fast place to put LINE. */
-
+
/* 1 if operand is pending after ','. */
unsigned int expecting_operand = 0;
/* 1 if we found a prefix only acceptable with string insns. */
@@ -533,7 +533,7 @@ char *line;
/* Non-zero if operand parens not balenced. */
unsigned int paren_not_balenced;
char * token_start = l;
-
+
while (! is_space_char(*l) && *l != END_OF_INSN) {
if (! is_opcode_char(*l)) {
as_bad("invalid character %s in opcode", output_invalid(*l));
@@ -544,7 +544,7 @@ char *line;
} else { /* this opcode's got a prefix */
register unsigned int q;
register prefix_entry * prefix;
-
+
if (l == token_start) {
as_bad("expecting prefix; got nothing");
return;
@@ -578,7 +578,7 @@ char *line;
as_bad("expecting opcode; got nothing");
return;
}
-
+
/* Lookup insn in hash; try intel & att naming conventions if appropriate;
that is: we only use the opcode suffix 'b' 'w' or 'l' if we need to. */
current_templates = (templates *) hash_find (op_hash, token_start);
@@ -599,7 +599,7 @@ char *line;
}
}
RESTORE_END_STRING (l);
-
+
/* check for rep/repne without a string instruction */
if (expecting_string_instruction &&
! IS_STRING_INSTRUCTION (current_templates->
@@ -607,7 +607,7 @@ char *line;
as_bad("expecting string instruction after rep/repne");
return;
}
-
+
/* There may be operands to parse. */
if (*l != END_OF_INSN &&
/* For string instructions, we ignore any operands if given. This
@@ -671,7 +671,7 @@ char *line;
return;
}
}
-
+
/* now *l must be either ',' or END_OF_INSN */
if (*l == ',') {
if (*++l == END_OF_INSN) { /* just skip it, if it's \n complain */
@@ -682,18 +682,18 @@ char *line;
} while (*l != END_OF_INSN); /* until we get end of insn */
}
}
-
+
/* Now we've parsed the opcode into a set of templates, and have the
operands at hand.
Next, we find a template that matches the given insn,
making sure the overlap of the given operands types is consistent
with the template operand types. */
-
+
#define MATCH(overlap,given_type) \
(overlap && \
(overlap & (JumpAbsolute|BaseIndex|Mem8)) \
== (given_type & (JumpAbsolute|BaseIndex|Mem8)))
-
+
/* If m0 and m1 are register matches they must be consistent
with the expected operand types t0 and t1.
That is, if both m0 & m1 are register matches
@@ -717,16 +717,16 @@ char *line;
expressionS * exp;
unsigned int overlap2;
unsigned int found_reverse_match;
-
+
overlap0 = overlap1 = overlap2 = found_reverse_match = 0;
for (t = current_templates->start;
t < current_templates->end;
t++) {
-
+
/* must have right number of operands */
if (i.operands != t->operands) continue;
else if (!t->operands) break; /* 0 operands always matches */
-
+
overlap0 = i.types[0] & t->operand_types[0];
switch (t->operands) {
case 1:
@@ -739,17 +739,17 @@ char *line;
! CONSISTENT_REGISTER_MATCH(overlap0, overlap1,
t->operand_types[0],
t->operand_types[1])) {
-
+
/* check if other direction is valid ... */
if (! (t->opcode_modifier & COMES_IN_BOTH_DIRECTIONS))
continue;
-
+
/* try reversing direction of operands */
overlap0 = i.types[0] & t->operand_types[1];
overlap1 = i.types[1] & t->operand_types[0];
if (! MATCH (overlap0,i.types[0]) ||
! MATCH (overlap1,i.types[1]) ||
- ! CONSISTENT_REGISTER_MATCH (overlap0, overlap1,
+ ! CONSISTENT_REGISTER_MATCH (overlap0, overlap1,
t->operand_types[0],
t->operand_types[1])) {
/* does not match either direction */
@@ -766,7 +766,7 @@ char *line;
! CONSISTENT_REGISTER_MATCH (overlap0, overlap2,
t->operand_types[0],
t->operand_types[2]) ||
- ! CONSISTENT_REGISTER_MATCH (overlap1, overlap2,
+ ! CONSISTENT_REGISTER_MATCH (overlap1, overlap2,
t->operand_types[1],
t->operand_types[2]))
continue;
@@ -780,11 +780,11 @@ char *line;
as_bad("operands given don't match any known 386 instruction");
return;
}
-
+
/* Copy the template we found (we may change it!). */
memcpy(&i.tm, t, sizeof(template));
t = &i.tm; /* alter new copy of template */
-
+
/* If there's no opcode suffix we try to invent one based on register
operands. */
if (! i.suffix && i.reg_operands) {
@@ -799,7 +799,7 @@ char *line;
DWORD_OPCODE_SUFFIX;
}
}
-
+
/* Make still unresolved immediate matches conform to size of immediate
given in i.suffix. Note: overlap2 cannot be an immediate!
We assume this. */
@@ -823,32 +823,32 @@ char *line;
overlap1 &= (i.suffix == BYTE_OPCODE_SUFFIX ? (Imm8|Imm8S) :
(i.suffix == WORD_OPCODE_SUFFIX ? Imm16 : Imm32));
}
-
+
i.types[0] = overlap0;
i.types[1] = overlap1;
i.types[2] = overlap2;
-
+
if (overlap0 & ImplicitRegister) i.reg_operands--;
if (overlap1 & ImplicitRegister) i.reg_operands--;
if (overlap2 & ImplicitRegister) i.reg_operands--;
if (overlap0 & Imm1) i.imm_operands = 0; /* kludge for shift insns */
-
+
if (found_reverse_match) {
unsigned int save;
save = t->operand_types[0];
t->operand_types[0] = t->operand_types[1];
t->operand_types[1] = save;
}
-
+
/* Finalize opcode. First, we change the opcode based on the operand
size given by i.suffix: we never have to change things for byte insns,
or when no opcode suffix is need to size the operands. */
-
+
if (! i.suffix && (t->opcode_modifier & W)) {
as_bad("no opcode suffix given and no register operands; can't size instruction");
return;
}
-
+
if (i.suffix && i.suffix != BYTE_OPCODE_SUFFIX) {
/* Select between byte and word/dword operations. */
if (t->opcode_modifier & W)
@@ -864,17 +864,17 @@ char *line;
i.prefix[i.prefixes++] = WORD_PREFIX_OPCODE;
}
}
-
+
/* For insns with operands there are more diddles to do to the opcode. */
if (i.operands) {
/* If we found a reverse match we must alter the opcode direction bit
found_reverse_match holds bit to set (different for int &
float insns). */
-
+
if (found_reverse_match) {
t->base_opcode |= found_reverse_match;
}
-
+
/*
The imul $imm, %reg instruction is converted into
imul $imm, %reg, %reg. */
@@ -882,7 +882,7 @@ char *line;
i.regs[2] = i.regs[1]; /* Pretend we saw the 3 operand case. */
i.reg_operands = 2;
}
-
+
/* Certain instructions expect the destination to be in the i.rm.reg
field. This is by far the exceptional case. For these instructions,
if the source operand is a register, we must reverse the i.rm.reg
@@ -895,7 +895,7 @@ char *line;
i.regs[first_reg_operand] = i.regs[second_reg_operand];
i.regs[second_reg_operand] = tmp;
}
-
+
if (t->opcode_modifier & ShortForm) {
/* The register or float register operand is in operand 0 or 1. */
unsigned int o = (i.types[0] & (Reg|FloatReg)) ? 0 : 1;
@@ -925,7 +925,7 @@ char *line;
be put into the modrm byte.
Now, we make the modrm & index base bytes based on all the info
we've collected. */
-
+
/* i.reg_operands MUST be the number of real register operands;
implicit registers do not count. */
if (i.reg_operands == 2) {
@@ -947,9 +947,9 @@ char *line;
if (i.mem_operands) {
unsigned int fake_zero_displacement = 0;
unsigned int o = (i.types[0] & Mem) ? 0 : ((i.types[1] & Mem) ? 1 : 2);
-
+
/* Encode memory operand into modrm byte and base index byte. */
-
+
if (i.base_reg == esp && ! i.index_reg) {
/* <disp>(%esp) becomes two byte modrm with no index register. */
i.rm.regmem = ESCAPE_TO_TWO_BYTE_ADDRESSING;
@@ -1020,12 +1020,12 @@ char *line;
exp->X_add_symbol = (symbolS *) 0;
exp->X_subtract_symbol = (symbolS *) 0;
}
-
+
/* Select the correct segment for the memory operand. */
if (i.seg) {
unsigned int seg_index;
const seg_entry *default_seg;
-
+
if (i.rm.regmem == ESCAPE_TO_TWO_BYTE_ADDRESSING) {
seg_index = (i.rm.mode<<3) | i.bi.base;
default_seg = two_byte_segment_defaults[seg_index];
@@ -1045,7 +1045,7 @@ char *line;
}
}
}
-
+
/* Fill in i.rm.reg or i.rm.regmem field with register operand
(if any) based on t->extension_opcode. Again, we must be careful
to make sure that segment/control/debug/test registers are coded
@@ -1059,13 +1059,13 @@ char *line;
if (t->extension_opcode != None)
i.rm.regmem = i.regs[o]->reg_num;
else i.rm.reg = i.regs[o]->reg_num;
-
+
/* Now, if no memory operand has set i.rm.mode = 0, 1, 2
we must set it to 3 to indicate this is a register operand
int the regmem field */
if (! i.mem_operands) i.rm.mode = 3;
}
-
+
/* Fill in i.rm.reg field with extension opcode (if any). */
if (t->extension_opcode != None)
i.rm.reg = t->extension_opcode;
@@ -1073,21 +1073,21 @@ char *line;
}
}
}
-
+
/* Handle conversion of 'int $3' --> special int3 insn. */
if (t->base_opcode == INT_OPCODE && i.imms[0]->X_add_number == 3) {
t->base_opcode = INT3_OPCODE;
i.imm_operands = 0;
}
-
+
/* We are ready to output the insn. */
{
register char * p;
-
+
/* Output jumps. */
if (t->opcode_modifier & Jump) {
int n = i.disps[0]->X_add_number;
-
+
switch (i.disps[0]->X_seg) {
case SEG_ABSOLUTE:
if (fits_in_signed_byte(n)) {
@@ -1145,7 +1145,7 @@ char *line;
} else if (t->opcode_modifier & (JumpByte|JumpDword)) {
int size = (t->opcode_modifier & JumpByte) ? 1 : 4;
int n = i.disps[0]->X_add_number;
-
+
if (fits_in_unsigned_byte(t->base_opcode)) {
FRAG_APPEND_1_CHAR (t->base_opcode);
} else {
@@ -1154,7 +1154,7 @@ char *line;
*p++ = (t->base_opcode >> 8) & 0xff;
*p = t->base_opcode & 0xff;
}
-
+
p = frag_more (size);
switch (i.disps[0]->X_seg) {
case SEG_ABSOLUTE:
@@ -1193,14 +1193,14 @@ char *line;
*/
int nopbytes = 0;
#endif
-
+
/* First the prefix bytes. */
for (q = i.prefix; q < i.prefix + i.prefixes; q++) {
p = frag_more (1);
nopbytes += 1;
md_number_to_chars (p, (unsigned int) *q, 1);
}
-
+
/* Now the opcode; be careful about word order here! */
if (fits_in_unsigned_byte(t->base_opcode)) {
nopbytes += 1;
@@ -1224,7 +1224,7 @@ char *line;
*p++ = (t->base_opcode >> 8) & 0xff;
*p = (t->base_opcode ) & 0xff;
}
-
+
/* Now the modrm byte and base index byte (if present). */
if (t->opcode_modifier & Modrm) {
p = frag_more (1);
@@ -1240,10 +1240,10 @@ char *line;
md_number_to_chars (p,(i.bi.base<<0 | i.bi.index<<3 | i.bi.scale<<6), 1);
}
}
-
+
if (i.disp_operands) {
register unsigned int n;
-
+
for (n = 0; n < i.operands; n++) {
if (i.disps[n]) {
if (i.disps[n]->X_seg == SEG_ABSOLUTE) {
@@ -1274,11 +1274,11 @@ char *line;
}
}
} /* end displacement output */
-
+
/* output immediate */
if (i.imm_operands) {
register unsigned int n;
-
+
for (n = 0; n < i.operands; n++) {
if (i.imms[n]) {
if (i.imms[n]->X_seg == SEG_ABSOLUTE) {
@@ -1317,13 +1317,13 @@ char *line;
}
} /* end immediate output */
}
-
+
#ifdef DEBUG386
if (flagseen['D']) {
pi (line, &i);
}
#endif /* DEBUG386 */
-
+
}
return;
}
@@ -1335,21 +1335,21 @@ static int i386_operand (operand_string)
char *operand_string;
{
register char *op_string = operand_string;
-
+
/* Address of '\0' at end of operand_string. */
char * end_of_operand_string = operand_string + strlen(operand_string);
-
+
/* Start and end of displacement string expression (if found). */
char *displacement_string_start = NULL;
char *displacement_string_end = NULL;
-
+
/* We check for an absolute prefix (differentiating,
for example, 'jmp pc_relative_label' from 'jmp *absolute_label'. */
if (*op_string == ABSOLUTE_PREFIX) {
op_string++;
i.types[this_operand] |= JumpAbsolute;
}
-
+
/* Check if operand is a register. */
if (*op_string == REGISTER_PREFIX) {
register reg_entry *r;
@@ -1451,14 +1451,14 @@ char *operand_string;
/* This is a memory reference of some sort. */
register char * base_string;
unsigned int found_base_index_form;
-
+
do_memory_reference:
if (i.mem_operands == MAX_MEMORY_OPERANDS) {
as_bad("more than 1 memory reference in instruction");
return 0;
}
i.mem_operands++;
-
+
/* Determine type of memory operand from opcode_suffix;
no opcode suffix implies general memory references. */
switch (i.suffix) {
@@ -1472,7 +1472,7 @@ char *operand_string;
default:
i.types[this_operand] |= Mem32;
}
-
+
/* Check for base index form. We detect the base index form by
looking for an ')' at the end of the operand, searching
for the '(' matching it, and finding a REGISTER_PREFIX or ','
@@ -1492,7 +1492,7 @@ char *operand_string;
if (*base_string == REGISTER_PREFIX || *base_string == ',')
found_base_index_form = 1;
}
-
+
/* If we can't parse a base index register expression, we've found
a pure displacement expression. We set up displacement_string_start
and displacement_string_end for the code below. */
@@ -1502,15 +1502,15 @@ char *operand_string;
} else {
char *base_reg_name, *index_reg_name, *num_string;
int num;
-
+
i.types[this_operand] |= BaseIndex;
-
+
/* If there is a displacement set-up for it to be parsed later. */
if (base_string != op_string + 1) {
displacement_string_start = op_string;
displacement_string_end = base_string - 1;
}
-
+
/* Find base register (if any). */
if (*base_string != ',') {
base_reg_name = base_string++;
@@ -1528,7 +1528,7 @@ char *operand_string;
}
RESTORE_END_STRING (base_string);
}
-
+
/* Now check seperator; must be ',' ==> index reg
OR num ==> no index reg. just scale factor
OR ')' ==> end. (scale factor = 1) */
@@ -1537,7 +1537,7 @@ char *operand_string;
operand_string);
return 0;
}
-
+
/* There may index reg here; and there may be a scale factor. */
if (*base_string == ',' && *(base_string+1) == REGISTER_PREFIX) {
index_reg_name = ++base_string;
@@ -1549,7 +1549,7 @@ char *operand_string;
}
RESTORE_END_STRING (base_string);
}
-
+
/* Check for scale factor. */
if (*base_string == ',' && isdigit(*(base_string+1))) {
num_string = ++base_string;
@@ -1582,7 +1582,7 @@ char *operand_string;
}
}
}
-
+
/* If there's an expression begining the operand, parse it,
assuming displacement_string_start and displacement_string_end
are meaningful. */
@@ -1689,7 +1689,7 @@ char *operand_string;
goto seg_unimplemented;
}
}
-
+
/* Make sure the memory operand we've been dealt is valid. */
if (i.base_reg && i.index_reg &&
! (i.base_reg->reg_type & i.index_reg->reg_type & Reg)) {
@@ -1740,7 +1740,7 @@ register segT segment;
{
register unsigned char * opcode;
register int old_fr_fix;
-
+
old_fr_fix = fragP->fr_fix;
opcode = (unsigned char *) fragP->fr_opcode;
/* We've already got fragP->fr_subtype right; all we have to do is check
@@ -1764,7 +1764,7 @@ register segT segment;
#endif
NO_RELOC, (symbolS *)0);
break;
-
+
default:
/* This changes the byte-displacement jump 0x7N -->
the dword-displacement jump 0x0f8N */
@@ -1809,18 +1809,18 @@ register fragS * fragP;
unsigned int opcode_address;
unsigned int extension = 0;
int displacement_from_opcode_start;
-
+
opcode = (unsigned char *) fragP->fr_opcode;
-
+
/* Address we want to reach in file space. */
target_address = S_GET_VALUE(fragP->fr_symbol) + fragP->fr_offset;
-
+
/* Address opcode resides at in file space. */
opcode_address = fragP->fr_address + fragP->fr_fix;
-
+
/* Displacement from opcode start to fill into instruction. */
displacement_from_opcode_start = target_address - opcode_address;
-
+
switch (fragP->fr_subtype) {
case ENCODE_RELAX_STATE (COND_JUMP, BYTE):
case ENCODE_RELAX_STATE (UNCOND_JUMP, BYTE):
@@ -1828,7 +1828,7 @@ register fragS * fragP;
extension = 1; /* 1 opcode + 1 displacement */
where_to_put_displacement = &opcode[1];
break;
-
+
case ENCODE_RELAX_STATE (COND_JUMP, WORD):
opcode[1] = TWO_BYTE_OPCODE_ESCAPE;
opcode[2] = opcode[0] + 0x10;
@@ -1836,27 +1836,27 @@ register fragS * fragP;
extension = 4; /* 3 opcode + 2 displacement */
where_to_put_displacement = &opcode[3];
break;
-
+
case ENCODE_RELAX_STATE (UNCOND_JUMP, WORD):
opcode[1] = 0xe9;
opcode[0] = WORD_PREFIX_OPCODE;
extension = 3; /* 2 opcode + 2 displacement */
where_to_put_displacement = &opcode[2];
break;
-
+
case ENCODE_RELAX_STATE (COND_JUMP, DWORD):
opcode[1] = opcode[0] + 0x10;
opcode[0] = TWO_BYTE_OPCODE_ESCAPE;
extension = 5; /* 2 opcode + 4 displacement */
where_to_put_displacement = &opcode[2];
break;
-
+
case ENCODE_RELAX_STATE (UNCOND_JUMP, DWORD):
opcode[0] = 0xe9;
extension = 4; /* 1 opcode + 4 displacement */
where_to_put_displacement = &opcode[1];
break;
-
+
default:
BAD_CASE(fragP->fr_subtype);
break;
@@ -1880,7 +1880,7 @@ fragS *frag;
symbolS *to_symbol;
{
long offset;
-
+
offset = to_addr - (from_addr + 2);
md_number_to_chars (ptr, (long) 0xeb, 1); /* opcode for byte-disp jump */
md_number_to_chars (ptr + 1, offset, 1);
@@ -1893,7 +1893,7 @@ fragS *frag;
symbolS *to_symbol;
{
long offset;
-
+
if (flagseen['m']) {
offset = to_addr - S_GET_VALUE(to_symbol);
md_number_to_chars (ptr, 0xe9, 1); /* opcode for long jmp */
@@ -1944,7 +1944,7 @@ long value; /* The value of the bits. */
int nbytes; /* Number of bytes in the output. */
{
register char * p = con;
-
+
switch (nbytes) {
case 1:
p[0] = value & 0xff;
@@ -1966,8 +1966,8 @@ int nbytes; /* Number of bytes in the output. */
/* Apply a fixup (fixS) to segment data, once it has been determined
- by our caller that we have all the info we need to fix it up.
-
+ by our caller that we have all the info we need to fix it up.
+
On the 386, immediates, displacements, and data pointers are all in
the same (little-endian) format, so we don't need to care about which
we are handling. */
@@ -1978,7 +1978,7 @@ fixS * fixP; /* The fix we're to put in */
long value; /* The value of the bits. */
{
register char * p = fixP->fx_where + fixP->fx_frag->fr_literal;
-
+
switch (fixP->fx_size) {
case 1:
*p = value;
@@ -2012,7 +2012,7 @@ int nbytes; /* Number of bytes in the input. */
return retval;
}
-/* Not needed for coff since relocation structure does not
+/* Not needed for coff since relocation structure does not
contain bitfields. */
#if defined(OBJ_AOUT) | defined(OBJ_BOUT)
#ifdef comment
@@ -2028,8 +2028,8 @@ struct reloc_info_generic *ri;
the_bytes[6] = (ri->r_symbolnum >> 16) & 0x0ff;
the_bytes[5] = (ri->r_symbolnum >> 8) & 0x0ff;
the_bytes[4] = ri->r_symbolnum & 0x0ff;
- the_bytes[7] = (((ri->r_extern << 3) & 0x08) | ((ri->r_length << 1) & 0x06) |
- ((ri->r_pcrel << 0) & 0x01)) & 0x0F;
+ the_bytes[7] = (((ri->r_extern << 3) & 0x08) | ((ri->r_length << 1) & 0x06) |
+ ((ri->r_pcrel << 0) & 0x01)) & 0x0F;
}
#endif /* comment */
@@ -2042,20 +2042,20 @@ relax_addressT segment_address_in_file;
* In: length of relocation (or of address) in chars: 1, 2 or 4.
* Out: GNU LD relocation length code: 0, 1, or 2.
*/
-
+
static unsigned char nbytes_r_length[] = { 42, 0, 1, 42, 2 };
long r_symbolnum;
-
+
know(fixP->fx_addsy != NULL);
-
+
md_number_to_chars(where,
fixP->fx_frag->fr_address + fixP->fx_where - segment_address_in_file,
4);
-
+
r_symbolnum = (S_IS_DEFINED(fixP->fx_addsy)
? S_GET_TYPE(fixP->fx_addsy)
: fixP->fx_addsy->sy_number);
-
+
#ifdef PIC
{
int extra_bits = 0;
@@ -2113,7 +2113,7 @@ relax_addressT segment_address_in_file;
| ((nbytes_r_length[fixP->fx_size] << 1) & 0x06)
| (((fixP->fx_pcrel << 0) & 0x01) & 0x0f));
#endif
-
+
return;
} /* tc_aout_fix_to_chars() */
@@ -2136,23 +2136,23 @@ int *sizeP;
LITTLENUM_TYPE words[MAX_LITTLENUMS];
LITTLENUM_TYPE *wordP;
char *t;
-
+
switch (type) {
case 'f':
case 'F':
prec = 2;
break;
-
+
case 'd':
case 'D':
prec = 4;
break;
-
+
case 'x':
case 'X':
prec = 5;
break;
-
+
default:
*sizeP=0;
return "Bad call to md_atof ()";
@@ -2160,7 +2160,7 @@ int *sizeP;
t = atof_ieee (input_line_pointer,type,words);
if (t)
input_line_pointer=t;
-
+
*sizeP = prec * sizeof(LITTLENUM_TYPE);
/* this loops outputs the LITTLENUMs in REVERSE order; in accord with
the bigendian 386 */
@@ -2187,7 +2187,7 @@ char *reg_string; /* reg_string starts *before* REGISTER_PREFIX */
register char *s = reg_string;
register char *p;
char reg_name_given[MAX_REG_NAME_SIZE];
-
+
s++; /* skip REGISTER_PREFIX */
for (p = reg_name_given; is_register_char (*s); p++, s++) {
*p = register_chars[*s];
@@ -2219,7 +2219,7 @@ char *name;
return 0;
}
-/* Parse an operand that is machine-specific.
+/* Parse an operand that is machine-specific.
We just return without modifying the expression if we have nothing
to do. */
@@ -2328,7 +2328,7 @@ static void s_bss()
subseg_new (SEG_BSS, (subsegT)temp);
demand_empty_rest_of_line();
}
-
+
/*
* Local Variables:
* comment-column: 0
diff --git a/gnu/usr.bin/as/config/tc-i386.h b/gnu/usr.bin/as/config/tc-i386.h
index 1369d2b..fd4d335 100644
--- a/gnu/usr.bin/as/config/tc-i386.h
+++ b/gnu/usr.bin/as/config/tc-i386.h
@@ -1,24 +1,24 @@
/* tc-i386.h -- Header file for tc-i386.c
Copyright (C) 1989, 1992 Free Software Foundation.
-
+
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, 675 Mass Ave, Cambridge, MA 02139, USA. */
/*
- * $Id: tc-i386.h,v 1.1 1993/11/03 00:54:25 paul Exp $
+ * $Id: tc-i386.h,v 1.2 1994/12/23 22:37:36 nate Exp $
*/
#ifndef TC_I386
@@ -62,19 +62,19 @@
/* register numbers */
#define EBP_REG_NUM 5
#define ESP_REG_NUM 4
-
+
/* modrm_byte.regmem for twobyte escape */
#define ESCAPE_TO_TWO_BYTE_ADDRESSING ESP_REG_NUM
/* index_base_byte.index for no index register addressing */
#define NO_INDEX_REGISTER ESP_REG_NUM
/* index_base_byte.base for no base register addressing */
#define NO_BASE_REGISTER EBP_REG_NUM
-
+
/* these are the att as opcode suffixes, making movl --> mov, for example */
#define DWORD_OPCODE_SUFFIX 'l'
#define WORD_OPCODE_SUFFIX 'w'
#define BYTE_OPCODE_SUFFIX 'b'
-
+
/* modrm.mode = REGMEM_FIELD_HAS_REG when a register is in there */
#define REGMEM_FIELD_HAS_REG 0x3 /* always = 0x3 */
#define REGMEM_FIELD_HAS_MEM (~REGMEM_FIELD_HAS_REG)
@@ -145,23 +145,23 @@
typedef struct {
/* instruction name sans width suffix ("mov" for movl insns) */
char *name;
-
+
/* how many operands */
unsigned int operands;
-
+
/* base_opcode is the fundamental opcode byte with a optional prefix(es). */
unsigned int base_opcode;
-
+
/* extension_opcode is the 3 bit extension for group <n> insns.
If this template has no extension opcode (the usual case) use None */
unsigned char extension_opcode;
#define None 0xff /* If no extension_opcode is possible. */
-
+
/* the bits in opcode_modifier are used to generate the final opcode from
the base_opcode. These bits also are used to detect alternate forms of
the same instruction */
unsigned int opcode_modifier;
-
+
/* opcode_modifier bits: */
#define W 0x1 /* set if operands are words or dwords */
#define D 0x2 /* D = 0 if Reg --> Regmem; D = 1 if Regmem --> Reg */
@@ -183,18 +183,18 @@ typedef struct {
#define JumpByte 0x4000
#define JumpDword 0x8000
#define ReverseRegRegmem 0x10000
-
+
/* (opcode_modifier & COMES_IN_ALL_SIZES) is true if the
instuction comes in byte, word, and dword sizes and is encoded into
machine code in the canonical way. */
#define COMES_IN_ALL_SIZES (W)
-
+
/* (opcode_modifier & COMES_IN_BOTH_DIRECTIONS) indicates that the
source and destination operands can be reversed by setting either
the D (for integer insns) or the FloatD (for floating insns) bit
in base_opcode. */
#define COMES_IN_BOTH_DIRECTIONS (D|FloatD)
-
+
/* operand_types[i] describes the type of operand i. This is made
by OR'ing together all of the possible type masks. (e.g.
'operand_types[i] = Reg|Imm' specifies that operand i can be
diff --git a/gnu/usr.bin/as/config/tc-i860.c b/gnu/usr.bin/as/config/tc-i860.c
index 0123138..4907990 100644
--- a/gnu/usr.bin/as/config/tc-i860.c
+++ b/gnu/usr.bin/as/config/tc-i860.c
@@ -1,18 +1,18 @@
/* tc-i860.c -- Assemble for the I860
Copyright (C) 1989, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -173,11 +173,11 @@ void
register char *retval = NULL;
int lose = 0;
register unsigned int i = 0;
-
+
op_hash = hash_new();
if (op_hash == NULL)
as_fatal("Virtual memory exhausted");
-
+
while (i < NUMOPCODES)
{
const char *name = i860_opcodes[i].name;
@@ -200,10 +200,10 @@ void
} while (i < NUMOPCODES
&& !strcmp(i860_opcodes[i].name, name));
}
-
+
if (lose)
as_fatal("Broken assembler. No assembly attempted.");
-
+
for (i = '0'; i < '8'; ++i)
octal[i] = 1;
for (i = '0'; i <= '9'; ++i)
@@ -229,21 +229,21 @@ char *str;
int no_opcodes = 1;
int i;
struct i860_it pseudo[3];
-
+
assert(str);
i860_ip(str);
-
+
/* check for expandable flag to produce pseudo-instructions */
if (the_insn.expand != 0 && the_insn.highlow == NO_SPEC) {
for (i = 0; i < 3; i++)
pseudo[i] = the_insn;
-
+
switch (the_insn.expand) {
-
+
case E_DELAY:
no_opcodes = 1;
break;
-
+
case E_MOV:
if (the_insn.exp.X_add_symbol == NULL &&
the_insn.exp.X_subtract_symbol == NULL &&
@@ -259,7 +259,7 @@ char *str;
pseudo[1].highlow = HIGH;
no_opcodes = 2;
break;
-
+
case E_ADDR:
if (the_insn.exp.X_add_symbol == NULL &&
the_insn.exp.X_subtract_symbol == NULL)
@@ -273,7 +273,7 @@ char *str;
pseudo[1].highlow = PAIR;
no_opcodes = 2;
break;
-
+
case E_U32: /* 2nd version emulates Intel as, not doc. */
if (the_insn.exp.X_add_symbol == NULL &&
the_insn.exp.X_subtract_symbol == NULL &&
@@ -295,7 +295,7 @@ char *str;
pseudo[1].highlow = PAIR;
no_opcodes = 2;
break;
-
+
case E_AND: /* 2nd version emulates Intel as, not doc. */
if (the_insn.exp.X_add_symbol == NULL &&
the_insn.exp.X_subtract_symbol == NULL &&
@@ -319,7 +319,7 @@ char *str;
pseudo[1].exp.X_add_number = -1 - the_insn.exp.X_add_number;
no_opcodes = 2;
break;
-
+
case E_S32:
if (the_insn.exp.X_add_symbol == NULL &&
the_insn.exp.X_subtract_symbol == NULL &&
@@ -337,11 +337,11 @@ char *str;
pseudo[2].reloc = NO_RELOC;
no_opcodes = 3;
break;
-
+
default:
as_fatal("failed sanity check.");
}
-
+
the_insn = pseudo[0];
/* check for expanded opcode after branch or in dual */
if (no_opcodes > 1 && last_expand == 1)
@@ -349,16 +349,16 @@ char *str;
if (no_opcodes > 1 && dual_mode != DUAL_OFF)
as_warn("Expanded opcode in dual mode: `%s'", str);
}
-
+
i = 0;
do { /* always produce at least one opcode */
toP = frag_more(4);
/* put out the opcode */
md_number_to_chars(toP, the_insn.opcode, 4);
-
+
/* check for expanded opcode after branch or in dual */
last_expand = the_insn.pcrel;
-
+
/* put out the symbol-dependent stuff */
if (the_insn.reloc != NO_RELOC) {
fix_new(frag_now, /* which frag */
@@ -373,7 +373,7 @@ char *str;
}
the_insn = pseudo[++i];
} while (--no_opcodes > 0);
-
+
}
static void
@@ -390,29 +390,29 @@ char *str;
unsigned int mask;
int match = 0;
int comma = 0;
-
-
+
+
for (s = str; islower(*s) || *s == '.' || *s == '3'; ++s)
;
switch (*s) {
-
+
case '\0':
break;
-
+
case ',':
comma = 1;
-
+
/*FALLTHROUGH*/
-
+
case ' ':
*s++ = '\0';
break;
-
+
default:
as_bad("Unknown opcode: `%s'", str);
exit(1);
}
-
+
if (strncmp(str, "d.", 2) == 0) { /* check for d. opcode prefix */
if (dual_mode == DUAL_ON)
dual_mode = DUAL_ONDDOT;
@@ -420,7 +420,7 @@ char *str;
dual_mode = DUAL_DDOT;
str += 2;
}
-
+
if ((insn = (struct i860_opcode *) hash_find(op_hash, str)) == NULL) {
if (dual_mode == DUAL_DDOT || dual_mode == DUAL_ONDDOT)
str -= 2;
@@ -435,20 +435,20 @@ char *str;
opcode = insn->match;
memset(&the_insn, '\0', sizeof(the_insn));
the_insn.reloc = NO_RELOC;
-
+
/*
* Build the opcode, checking as we go to make
* sure that the operands match
*/
for (args = insn->args; ; ++args) {
switch (*args) {
-
+
case '\0': /* end of args */
if (*s == '\0') {
match = 1;
}
break;
-
+
case '+':
case '(': /* these must match exactly */
case ')':
@@ -457,7 +457,7 @@ char *str;
if (*s++ == *args)
continue;
break;
-
+
case '#': /* must be at least one digit */
if (isdigit(*s++)) {
while (isdigit(*s)) {
@@ -466,12 +466,12 @@ char *str;
continue;
}
break;
-
+
case '1': /* next operand must be a register */
case '2':
case 'd':
switch (*s) {
-
+
case 'f': /* frame pointer */
s++;
if (*s++ == 'p') {
@@ -479,7 +479,7 @@ char *str;
break;
}
goto error;
-
+
case 's': /* stack pointer */
s++;
if (*s++ == 'p') {
@@ -487,7 +487,7 @@ char *str;
break;
}
goto error;
-
+
case 'r': /* any register */
s++;
if (!isdigit(c = *s++)) {
@@ -502,7 +502,7 @@ char *str;
}
mask= c;
break;
-
+
default: /* not this opcode */
goto error;
}
@@ -511,22 +511,22 @@ char *str;
* it goes in the opcode.
*/
switch (*args) {
-
+
case '1':
opcode |= mask << 11;
continue;
-
+
case '2':
opcode |= mask << 21;
continue;
-
+
case 'd':
opcode |= mask << 16;
continue;
-
+
}
break;
-
+
case 'e': /* next operand is a floating point register */
case 'f':
case 'g':
@@ -541,15 +541,15 @@ char *str;
mask -= '0';
}
switch (*args) {
-
+
case 'e':
opcode |= mask << 11;
continue;
-
+
case 'f':
opcode |= mask << 21;
continue;
-
+
case 'g':
opcode |= mask << 16;
if (dual_mode != DUAL_OFF)
@@ -564,7 +564,7 @@ char *str;
}
}
break;
-
+
case 'c': /* next operand must be a control register */
if (strncmp(s, "fir", 3) == 0) {
opcode |= 0x0 << 21;
@@ -597,7 +597,7 @@ char *str;
continue;
}
break;
-
+
case '5': /* 5 bit immediate in src1 */
memset(&the_insn, '\0', sizeof(the_insn));
if ( !getExpression(s)) {
@@ -610,18 +610,18 @@ char *str;
continue;
}
break;
-
+
case 'l': /* 26 bit immediate, relative branch */
the_insn.reloc = BRADDR;
the_insn.pcrel = 1;
goto immediate;
-
+
case 's': /* 16 bit immediate, split relative branch */
/* upper 5 bits of offset in dest field */
the_insn.pcrel = 1;
the_insn.reloc = SPLIT0;
goto immediate;
-
+
case 'S': /* 16 bit immediate, split (st), aligned */
if (opcode & (1 << 28))
if (opcode & 0x1)
@@ -631,7 +631,7 @@ char *str;
else
the_insn.reloc = SPLIT0;
goto immediate;
-
+
case 'I': /* 16 bit immediate, aligned */
if (opcode & (1 << 28))
if (opcode & 0x1)
@@ -641,12 +641,12 @@ char *str;
else
the_insn.reloc = LOW0;
goto immediate;
-
+
case 'i': /* 16 bit immediate */
the_insn.reloc = LOW0;
-
+
/*FALLTHROUGH*/
-
+
immediate:
if (*s == ' ')
s++;
@@ -660,19 +660,19 @@ char *str;
the_insn.highlow = PAIR;
s += 2;
}
- the_insn.expand = insn->expand;
-
+ the_insn.expand = insn->expand;
+
/* Note that if the getExpression() fails, we will still have
created U entries in the symbol table for the 'symbols'
in the input string. Try not to create U symbols for
registers, etc. */
-
+
if ( !getExpression(s)) {
s = expr_end;
continue;
}
break;
-
+
default:
as_fatal("failed sanity check.");
}
@@ -697,7 +697,7 @@ char *str;
}
break;
}
-
+
the_insn.opcode = opcode;
return;
}
@@ -708,11 +708,11 @@ char *str;
{
char *save_in;
segT seg;
-
+
save_in = input_line_pointer;
input_line_pointer = str;
switch (seg = expression(&the_insn.exp)) {
-
+
case SEG_ABSOLUTE:
case SEG_TEXT:
case SEG_DATA:
@@ -722,7 +722,7 @@ char *str;
case SEG_BIG:
case SEG_ABSENT:
break;
-
+
default:
the_insn.error = "bad segment";
expr_end = input_line_pointer;
@@ -738,7 +738,7 @@ char *str;
/*
This is identical to the md_atof in m68k.c. I think this is right,
but I'm not sure.
-
+
Turn a string in input_line_pointer into a floating point constant of type
type, and store the appropriate bytes in *litP. The number of LITTLENUMS
emitted is stored in *sizeP. An error message is returned, or NULL on OK.
@@ -758,33 +758,33 @@ int *sizeP;
LITTLENUM_TYPE *wordP;
char *t;
char *atof_ieee();
-
+
switch (type) {
-
+
case 'f':
case 'F':
case 's':
case 'S':
prec = 2;
break;
-
+
case 'd':
case 'D':
case 'r':
case 'R':
prec = 4;
break;
-
+
case 'x':
case 'X':
prec = 6;
break;
-
+
case 'p':
case 'P':
prec = 6;
break;
-
+
default:
*sizeP=0;
return "Bad call to MD_ATOF()";
@@ -810,7 +810,7 @@ long val;
int n;
{
switch (n) {
-
+
case 4:
*buf++ = val >> 24;
*buf++ = val >> 16;
@@ -819,7 +819,7 @@ int n;
case 1:
*buf = val;
break;
-
+
default:
as_fatal("failed sanity check.");
}
@@ -834,37 +834,37 @@ fixS *fixP;
{
enum reloc_type reloc = fixP->fx_r_type & 0xf;
enum highlow_type highlow = (fixP->fx_r_type >> 4) & 0x3;
-
+
assert(buf);
assert(n == 4); /* always on i860 */
-
+
switch (highlow) {
-
+
case HIGHADJ: /* adjusts the high-order 16-bits */
if (val & (1 << 15))
val += (1 << 16);
-
+
/*FALLTHROUGH*/
-
+
case HIGH: /* selects the high-order 16-bits */
val >>= 16;
break;
-
+
case PAIR: /* selects the low-order 16-bits */
val = val & 0xffff;
break;
-
+
default:
break;
}
-
+
switch (reloc) {
-
+
case BRADDR: /* br, call, bc, bc.t, bnc, bnc.t w/26-bit immediate */
if (fixP->fx_pcrel != 1)
as_bad("26-bit branch w/o pc relative set: 0x%08x", val);
val >>= 2; /* align pcrel offset, see manual */
-
+
if (val >= (1 << 25) || val < -(1 << 25)) /* check for overflow */
as_bad("26-bit branch offset overflow: 0x%08x", val);
buf[0] = (buf[0] & 0xfc) | ((val >> 24) & 0x3);
@@ -872,7 +872,7 @@ fixS *fixP;
buf[2] = val >> 8;
buf[3] = val;
break;
-
+
case SPLIT2: /* 16 bit immediate, 4-byte aligned */
if (val & 0x3)
as_bad("16-bit immediate 4-byte alignment error: 0x%08x", val);
@@ -891,9 +891,9 @@ fixS *fixP;
as_bad("16-bit branch offset overflow: 0x%08x", val);
buf[1] = (buf[1] & ~0x1f) | ((val >> 11) & 0x1f);
buf[2] = (buf[2] & ~0x7) | ((val >> 8) & 0x7);
- buf[3] |= val; /* perserve bottom opcode bits */
+ buf[3] |= val; /* perserve bottom opcode bits */
break;
-
+
case LOW4: /* fld,pfld,pst,flush 16-byte aligned */
if (val & 0xf)
as_bad("16-bit immediate 16-byte alignment error: 0x%08x", val);
@@ -919,9 +919,9 @@ fixS *fixP;
if (highlow != PAIR && (val >= (1 << 16) || val < -(1 << 15)))
as_bad("16-bit immediate overflow: 0x%08x", val);
buf[2] = val >> 8;
- buf[3] |= val; /* perserve bottom opcode bits */
+ buf[3] |= val; /* perserve bottom opcode bits */
break;
-
+
case RELOC_32:
md_number_to_chars(buf, val, 4);
break;
@@ -965,7 +965,7 @@ void *fix;
as_fatal("i860_number_to_field\n");
}
-/* the bit-field entries in the relocation_info struct plays hell
+/* the bit-field entries in the relocation_info struct plays hell
with the byte-order problems of cross-assembly. So as a hack,
I added this mach. dependent ri twiddler. Ugly, but it gets
you there. -KWK */
@@ -980,7 +980,7 @@ struct relocation_info *ri_p, ri;
{
#if 0
unsigned char the_bytes[sizeof(*ri_p)];
-
+
/* this is easy */
md_number_to_chars(the_bytes, ri.r_address, sizeof(ri.r_address));
/* now the fun stuff */
@@ -1030,22 +1030,22 @@ segT segtype;
/* for debugging only, must match enum reloc_type */
static char *Reloc[] = {
"NO_RELOC",
- "BRADDR",
- "LOW0",
- "LOW1",
- "LOW2",
- "LOW3",
- "LOW4",
- "SPLIT0",
- "SPLIT1",
- "SPLIT2",
- "RELOC_32",
+ "BRADDR",
+ "LOW0",
+ "LOW1",
+ "LOW2",
+ "LOW3",
+ "LOW4",
+ "SPLIT0",
+ "SPLIT1",
+ "SPLIT2",
+ "RELOC_32",
};
static char *Highlow[] = {
"NO_SPEC",
- "PAIR",
- "HIGH",
- "HIGHADJ",
+ "PAIR",
+ "HIGH",
+ "HIGHADJ",
};
static void
@@ -1062,11 +1062,11 @@ struct i860_it *insn;
fprintf(stderr, "exp = {\n");
fprintf(stderr, "\t\tX_add_symbol = %s\n",
insn->exp.X_add_symbol ?
- (S_GET_NAME(insn->exp.X_add_symbol) ?
+ (S_GET_NAME(insn->exp.X_add_symbol) ?
S_GET_NAME(insn->exp.X_add_symbol) : "???") : "0");
fprintf(stderr, "\t\tX_sub_symbol = %s\n",
insn->exp.X_subtract_symbol ?
- (S_GET_NAME(insn->exp.X_subtract_symbol) ?
+ (S_GET_NAME(insn->exp.X_subtract_symbol) ?
S_GET_NAME(insn->exp.X_subtract_symbol) : "???") : "0");
fprintf(stderr, "\t\tX_add_number = %d\n",
insn->exp.X_add_number);
@@ -1098,16 +1098,16 @@ relax_addressT segment_address_in_file;
register symbolS *symbolP;
extern char *next_object_file_charP;
long add_number;
-
+
memset((char *) &ri, '\0', sizeof(ri));
for (; fixP; fixP = fixP->fx_next) {
-
+
if (fixP->fx_r_type & ~0x3f) {
as_fatal("fixP->fx_r_type = %d\n", fixP->fx_r_type);
}
ri.r_pcrel = fixP->fx_pcrel;
ri.r_type = fixP->fx_r_type;
-
+
if ((symbolP = fixP->fx_addsy) != NULL) {
ri.r_address = fixP->fx_frag->fr_address +
fixP->fx_where - segment_address_in_file;
@@ -1128,7 +1128,7 @@ relax_addressT segment_address_in_file;
} else {
ri.r_addend = fixP->fx_addnumber;
}
-
+
md_ri_to_chars((char *) &ri, ri);
append(&next_object_file_charP, (char *)& ri, sizeof(ri));
}
@@ -1168,7 +1168,7 @@ relax_addressT segment_address_in_file;
long r_extern;
long r_addend = 0;
long r_address;
-
+
know(fixP->fx_addsy);
know(!(fixP->fx_r_type & ~0x3f));
@@ -1179,22 +1179,22 @@ relax_addressT segment_address_in_file;
r_extern = 0;
r_index = S_GET_TYPE(fixP->fx_addsy);
}
-
+
md_number_to_chars(where,
r_address = fixP->fx_frag->fr_address + fixP->fx_where - segment_address_in_file,
4);
-
+
where[4] = (r_index >> 16) & 0x0ff;
where[5] = (r_index >> 8) & 0x0ff;
where[6] = r_index & 0x0ff;
where[7] = (((fixP->fx_pcrel << 7) & 0x80)
| ((r_extern << 6) & 0x40)
| (fixP->fx_r_type & 0x3F));
-
+
if (fixP->fx_addsy->sy_frag) {
r_addend = fixP->fx_addsy->sy_frag->fr_address;
}
-
+
if (fixP->fx_pcrel) {
/* preserve actual offset vs. pc + 4 */
r_addend -= (r_address + 4);
@@ -1209,7 +1209,7 @@ relax_addressT segment_address_in_file;
#endif /* OBJ_AOUT */
-/* Parse an operand that is machine-specific.
+/* Parse an operand that is machine-specific.
We just return without modifying the expression if we have nothing
to do. */
@@ -1259,7 +1259,7 @@ long val;
/* fixme-soon: looks to me like i860 never has bit fixes. Let's see. xoxorich. */
know(fixP->fx_bit_fixP == NULL);
if (!fixP->fx_bit_fixP) {
-
+
/* fixme-soon: also looks like fx_im_disp is always 0. Let's see. xoxorich. */
know(fixP->fx_im_disp == 0);
switch (fixP->fx_im_disp) {
@@ -1281,7 +1281,7 @@ long val;
} else {
md_number_to_field(place, val, fixP->fx_bit_fixP);
}
-
+
return;
} /* md_apply_fix() */
diff --git a/gnu/usr.bin/as/config/tc-i960.c b/gnu/usr.bin/as/config/tc-i960.c
index 8f9091c..37089c3 100644
--- a/gnu/usr.bin/as/config/tc-i960.c
+++ b/gnu/usr.bin/as/config/tc-i960.c
@@ -1,18 +1,18 @@
/* tc-i960.c - All the i80960-specific stuff
Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
-
+
This file is part of GAS.
-
+
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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -188,15 +188,15 @@ const relax_typeS
const pseudo_typeS
md_pseudo_table[] = {
-
+
{ "bss", s_lcomm, 1 },
{ "extended", float_cons, 't' },
{ "leafproc", parse_po, S_LEAFPROC },
{ "sysproc", parse_po, S_SYSPROC },
-
+
{ "word", cons, 4 },
{ "quad", big_cons, 16 },
-
+
{ 0, 0, 0 }
};
@@ -205,14 +205,14 @@ const pseudo_typeS
#define subs(e) e.X_subtract_symbol
#define offs(e) e.X_add_number
#define segs(e) e.X_seg
-
-
+
+
/* Branch-prediction bits for CTRL/COBR format opcodes */
#define BP_MASK 0x00000002 /* Mask for branch-prediction bit */
#define BP_TAKEN 0x00000000 /* Value to OR in to predict branch */
#define BP_NOT_TAKEN 0x00000002 /* Value to OR in to predict no branch */
-
-
+
+
/* Some instruction opcodes that we need explicitly */
#define BE 0x12000000
#define BG 0x11000000
@@ -225,24 +225,24 @@ const pseudo_typeS
#define CHKBIT 0x5a002700
#define CMPI 0x5a002080
#define CMPO 0x5a002000
-
+
#define B 0x08000000
#define BAL 0x0b000000
#define CALL 0x09000000
#define CALLS 0x66003800
#define RET 0x0a000000
-
-
+
+
/* These masks are used to build up a set of MEMB mode bits. */
#define A_BIT 0x0400
#define I_BIT 0x0800
#define MEMB_BIT 0x1000
#define D_BIT 0x2000
-
-
+
+
/* Mask for the only mode bit in a MEMA instruction (if set, abase reg is used) */
#define MEMA_ABASE 0x2000
-
+
/* Info from which a MEMA or MEMB format instruction can be generated */
typedef struct {
long opcode; /* (First) 32 bits of instruction */
@@ -274,12 +274,12 @@ static struct {
{ "g4", 20 }, { "g5", 21 }, { "g6", 22 }, { "g7", 23 },
{ "g8", 24 }, { "g9", 25 }, { "g10", 26 }, { "g11", 27 },
{ "g12", 28 }, { "g13", 29 }, { "g14", 30 }, { "fp", 31 },
-
+
/* Numbers for special-function registers are for assembler internal
* use only: they are scaled back to range [0-31] for binary output.
*/
# define SF0 32
-
+
{ "sf0", 32 }, { "sf1", 33 }, { "sf2", 34 }, { "sf3", 35 },
{ "sf4", 36 }, { "sf5", 37 }, { "sf6", 38 }, { "sf7", 39 },
{ "sf8", 40 }, { "sf9", 41 }, { "sf10",42 }, { "sf11",43 },
@@ -288,14 +288,14 @@ static struct {
{ "sf20",52 }, { "sf21",53 }, { "sf22",54 }, { "sf23",55 },
{ "sf24",56 }, { "sf25",57 }, { "sf26",58 }, { "sf27",59 },
{ "sf28",60 }, { "sf29",61 }, { "sf30",62 }, { "sf31",63 },
-
+
/* Numbers for floating point registers are for assembler internal use
* only: they are scaled back to [0-3] for binary output.
*/
# define FP0 64
-
+
{ "fp0", 64 }, { "fp1", 65 }, { "fp2", 66 }, { "fp3", 67 },
-
+
{ NULL, 0 }, /* END OF LIST */
};
@@ -318,13 +318,13 @@ static struct {
{ "(g4)", 20 }, { "(g5)", 21 }, { "(g6)", 22 }, { "(g7)", 23 },
{ "(g8)", 24 }, { "(g9)", 25 }, { "(g10)", 26 }, { "(g11)", 27 },
{ "(g12)", 28 }, { "(g13)", 29 }, { "(g14)", 30 }, { "(fp)", 31 },
-
+
# define IPREL 32
/* for assembler internal use only: this number never appears in binary
* output.
*/
{ "(ip)", IPREL },
-
+
{ NULL, 0 }, /* END OF LIST */
};
@@ -417,32 +417,32 @@ void
int i; /* Loop counter */
const struct i960_opcode *oP; /* Pointer into opcode table */
char *retval; /* Value returned by hash functions */
-
+
if (((op_hash = hash_new()) == 0)
|| ((reg_hash = hash_new()) == 0)
|| ((areg_hash = hash_new()) == 0)) {
as_fatal("virtual memory exceeded");
}
-
+
retval = ""; /* For some reason, the base assembler uses an empty
* string for "no error message", instead of a NULL
* pointer.
*/
-
+
for (oP=i960_opcodes; oP->name && !*retval; oP++) {
retval = hash_insert(op_hash, oP->name, oP);
}
-
+
for (i=0; regnames[i].reg_name && !*retval; i++) {
retval = hash_insert(reg_hash, regnames[i].reg_name,
&regnames[i].reg_num);
}
-
+
for (i=0; aregs[i].areg_name && !*retval; i++){
retval = hash_insert(areg_hash, aregs[i].areg_name,
&aregs[i].areg_num);
}
-
+
if (*retval) {
as_fatal("Hashing returned \"%s\".", retval);
}
@@ -479,7 +479,7 @@ char *textP; /* Source text of instruction */
* replaced by decimal numbers
*/
int n_ops; /* Number of instruction operands */
-
+
struct i960_opcode *oP;
/* Pointer to instruction description */
int branch_predict;
@@ -491,17 +491,17 @@ char *textP; /* Source text of instruction */
* instructions.
*/
int n; /* Offset of last character in opcode mnemonic */
-
+
static const char bp_error_msg[] = "branch prediction invalid on this opcode";
-
-
+
+
/* Parse instruction into opcode and operands */
memset(args, '\0', sizeof(args));
n_ops = i_scan(textP, args);
if (n_ops == -1){
return; /* Error message already issued */
}
-
+
/* Do "macro substitution" (sort of) on 'ldconst' pseudo-instruction */
if (!strcmp(args[0],"ldconst")){
n_ops = parse_ldconst(args);
@@ -509,7 +509,7 @@ char *textP; /* Source text of instruction */
return;
}
}
-
+
/* Check for branch-prediction suffix on opcode mnemonic, strip it off */
n = strlen(args[0]) - 1;
branch_predict = 0;
@@ -523,7 +523,7 @@ char *textP; /* Source text of instruction */
bp_bits = (args[0][n] == 't') ? BP_TAKEN : BP_NOT_TAKEN;
args[0][n-1] = '\0'; /* Strip suffix from opcode mnemonic */
}
-
+
/* Look up opcode mnemonic in table and check number of operands.
* Check that opcode is legal for the target architecture.
* If all looks good, assemble instruction.
@@ -531,10 +531,10 @@ char *textP; /* Source text of instruction */
oP = (struct i960_opcode *) hash_find(op_hash, args[0]);
if (!oP || !targ_has_iclass(oP->iclass)) {
as_bad("invalid opcode, \"%s\".", args[0]);
-
+
} else if (n_ops != oP->num_ops) {
as_bad("improper number of operands. expecting %d, got %d", oP->num_ops, n_ops);
-
+
} else {
switch (oP->format){
case FBRA:
@@ -599,12 +599,12 @@ int n; /* Number of bytes to output (significant bytes
*buf++ = value;
value >>= 8;
}
-
+
/* XXX line number probably botched for this warning message. */
if (value != 0 && value != -1){
as_bad("Displacement too long for instruction field length.");
}
-
+
return;
} /* md_number_to_chars() */
@@ -618,7 +618,7 @@ unsigned char *val; /* Value in target byte order */
int n; /* Number of bytes in the input */
{
int retval;
-
+
for (retval=0; n--;){
retval <<= 8;
retval |= val[n];
@@ -652,47 +652,47 @@ int *sizeP;
int prec;
char *t;
char *atof_ieee();
-
+
switch (type) {
case 'f':
case 'F':
prec = 2;
break;
-
+
case 'd':
case 'D':
prec = 4;
break;
-
+
case 't':
case 'T':
prec = 5;
type = 'x'; /* That's what atof_ieee() understands */
break;
-
+
default:
*sizeP=0;
return "Bad call to md_atof()";
}
-
+
t = atof_ieee(input_line_pointer, type, words);
if (t){
input_line_pointer = t;
}
-
+
*sizeP = prec * LNUM_SIZE;
-
+
/* Output the LITTLENUMs in REVERSE order in accord with i80960
* word-order. (Dunno why atof_ieee doesn't do it in the right
* order in the first place -- probably because it's a hack of
* atof_m68k.)
*/
-
+
for (wordP = words + prec - 1; prec--;){
md_number_to_chars(litP, (long) (*wordP--), LNUM_SIZE);
litP += sizeof(LITTLENUM_TYPE);
}
-
+
return ""; /* Someone should teach Dean about null pointers */
}
@@ -740,11 +740,11 @@ bit_fixS *bfixP; /* Description of bit field to be fixed up */
int numbits; /* Length of bit field to be fixed */
long instr; /* 32-bit instruction to be fixed-up */
long sign; /* 0 or -1, according to sign bit of 'val' */
-
+
/* Convert instruction back to host byte order
*/
instr = md_chars_to_number(instrP, 4);
-
+
/* Surprise! -- we stored the number of bits
* to be modified rather than a pointer to a structure.
*/
@@ -753,9 +753,9 @@ bit_fixS *bfixP; /* Description of bit field to be fixed up */
/* This is a no-op, stuck here by reloc_callj() */
return;
}
-
+
know ((numbits == 13) || (numbits == 24));
-
+
/* Propagate sign bit of 'val' for the given number of bits.
* Result should be all 0 or all 1
*/
@@ -833,22 +833,22 @@ char ***vecP;
NULL, 0
};
struct tabentry *tp;
-
+
if (!strcmp(*argP,"norelax")){
norelax = 1;
-
+
} else if (**argP == 'b'){
instrument_branches = 1;
-
+
} else if (**argP == 'A'){
p = (*argP) + 1;
-
+
for (tp = arch_tab; tp->flag != NULL; tp++){
if (!strcmp(p,tp->flag)){
break;
}
}
-
+
if (tp->flag == NULL){
as_bad("unknown architecture: %s", p);
} else {
@@ -882,7 +882,7 @@ object_headers *headers;
fragS * fragP;
{
fixS *fixP; /* Structure describing needed address fix */
-
+
switch (fragP->fr_subtype){
case 1:
/* LEAVE SINGLE COBR INSTRUCTION */
@@ -894,7 +894,7 @@ fragS * fragP;
fragP->fr_offset,
1,
0);
-
+
fixP->fx_bit_fixP = (bit_fixS *) 13; /* size of bit field */
break;
case 2:
@@ -1009,7 +1009,7 @@ static char *
brlab_next()
{
static char buf[20];
-
+
sprintf(buf, "%s%d", BR_LABEL_BASE, br_cnt++);
return buf;
}
@@ -1039,18 +1039,18 @@ void
char buf[20];
char *p; /* Where the binary was output to */
fixS *fixP; /*->description of deferred address fixup */
-
+
if (!instrument_branches){
return;
}
-
+
subseg_new(SEG_DATA,0); /* .data */
frag_align(2,0); /* .align 2 */
record_alignment(now_seg,2);
colon(BR_TAB_NAME); /* BR_TAB_NAME: */
emit(0); /* .word 0 #link to next table */
emit(br_cnt); /* .word n #length of table */
-
+
for (i=0; i<br_cnt; i++){
sprintf(buf, "%s%d", BR_LABEL_BASE, i);
p = emit(0);
@@ -1087,10 +1087,10 @@ struct i960_opcode *oP;
* be emitted; 0 if an address fix
* should be emitted.
*/
-
+
instr = opcode;
n = oP->num_ops;
-
+
if (n >= 1) {
/* First operand (if any) of a COBR is always a register
* operand. Parse it.
@@ -1105,17 +1105,17 @@ struct i960_opcode *oP;
parse_regop(&regop, arg[2], oP->operand[1]);
instr |= (regop.n << 14) | regop.special;
}
-
-
+
+
if (n < 3){
emit(instr);
-
+
} else {
if (instrument_branches){
brcnt_emit();
colon(brlab_next());
}
-
+
/* A third operand to a COBR is always a displacement.
* Parse it; if it's relaxable (a cobr "j" directive, or any
* cobr other than bbs/bbc when the "-norelax" option is not in
@@ -1124,7 +1124,7 @@ struct i960_opcode *oP;
*/
var_frag = !norelax || (oP->format == COJ); /* TRUE or FALSE */
get_cdisp(arg[3], "COBR", instr, 13, var_frag, 0);
-
+
if (instrument_branches){
brcnt_emit();
}
@@ -1146,30 +1146,30 @@ int num_ops; /* Number of operands */
int instrument; /* TRUE iff we should add instrumentation to track
* how often the branch is taken
*/
-
-
+
+
if (num_ops == 0){
emit(opcode); /* Output opcode */
} else {
-
+
instrument = instrument_branches && (opcode != CALL)
&& (opcode != B) && (opcode != RET) && (opcode != BAL);
-
+
if (instrument){
brcnt_emit();
colon(brlab_next());
}
-
+
/* The operand MUST be an ip-relative displacment. Parse it
* and set up address fix for the instruction we just output.
*/
get_cdisp(targP, "CTRL", opcode, 24, 0, 0);
-
+
if (instrument){
brcnt_emit();
}
}
-
+
}
@@ -1186,7 +1186,7 @@ static
long instr; /* Word to be output, host byte order */
{
char *toP; /* Where to output it */
-
+
toP = frag_more(4); /* Allocate storage */
md_number_to_chars(toP, instr, 4); /* Convert to target byte order */
return toP;
@@ -1220,31 +1220,31 @@ char *args[]; /* Output arg: pointers to operands placed in args[1-3].
register char *to;
/* char buf[4]; */
/* int len; */
-
-
+
+
/* Skip lead white space */
while (*p == ' '){
p++;
}
-
+
if (*p == '\0'){
return 0;
}
-
+
n = 1;
args[1] = p;
-
+
/* Squeze blanks out by moving non-blanks toward start of string.
* Isolate operands, whenever comma is found.
*/
to = p;
while (*p != '\0'){
-
+
if (*p == ' '){
p++;
-
+
} else if (*p == ','){
-
+
/* Start of operand */
if (n == 3){
as_bad("too many operands");
@@ -1253,7 +1253,7 @@ char *args[]; /* Output arg: pointers to operands placed in args[1-3].
*to++ = '\0'; /* Terminate argument */
args[++n] = to; /* Start next argument */
p++;
-
+
} else {
*to++ = *p++;
}
@@ -1292,15 +1292,15 @@ int callj; /* 1 if callj relocation should be done; else 0 */
expressionS e; /* Parsed expression */
fixS *fixP; /* Structure describing needed address fix */
char *outP; /* Where instruction binary is output to */
-
+
fixP = NULL;
-
+
switch (parse_expr(dispP,&e)) {
-
+
case SEG_GOOF:
as_bad("expression syntax error");
break;
-
+
case SEG_TEXT:
case SEG_UNKNOWN:
if (var_frag) {
@@ -1321,9 +1321,9 @@ int callj; /* 1 if callj relocation should be done; else 0 */
offs(e),
1,
0);
-
+
fixP->fx_callj = callj;
-
+
/* We want to modify a bit field when the address is
* known. But we don't need all the garbage in the
* bit_fix structure. So we're going to lie and store
@@ -1332,12 +1332,12 @@ int callj; /* 1 if callj relocation should be done; else 0 */
fixP->fx_bit_fixP = (bit_fixS *) numbits;
}
break;
-
+
case SEG_DATA:
case SEG_BSS:
as_bad("attempt to branch into different segment");
break;
-
+
default:
as_bad("target of %s instruction must be a label", ifmtP);
break;
@@ -1362,21 +1362,21 @@ char *textP; /*->memory operand from source instruction, no white space */
{
char *start; /*->start of index specification */
char *end; /*->end of index specification */
-
+
/* Find opening square bracket, if any
*/
start = strchr(textP, '[');
-
+
if (start != NULL){
-
+
/* Eliminate '[', detach from rest of operand */
*start++ = '\0';
-
+
end = strchr(start, ']');
-
+
if (end == NULL){
as_bad("unmatched '['");
-
+
} else {
/* Eliminate ']' and make sure it was the last thing
* in the string.
@@ -1403,7 +1403,7 @@ static
char *regname; /* Suspected register name */
{
int *rP;
-
+
rP = (int *) hash_find(reg_hash, regname);
return (rP == NULL) ? -1 : *rP;
}
@@ -1433,7 +1433,7 @@ char *args[]; /* Output arg: pointers to opcode and operands placed
* here. MUST ACCOMMODATE 4 ENTRIES.
*/
{
-
+
/* Isolate opcode */
if (*(iP) == ' ') {
iP++;
@@ -1470,14 +1470,14 @@ struct i960_opcode *oP; /* Pointer to description of instruction */
char *outP; /* Where the binary was output to */
expressionS expr; /* Parsed expression */
fixS *fixP; /*->description of deferred address fixup */
-
+
memset(&instr, '\0', sizeof(memS));
instr.opcode = oP->opcode;
-
+
/* Process operands. */
for (i = 1; i <= oP->num_ops; i++){
opdesc = oP->operand[i-1];
-
+
if (MEMOP(opdesc)){
parse_memop(&instr, args[i], oP->format);
} else {
@@ -1485,21 +1485,21 @@ struct i960_opcode *oP; /* Pointer to description of instruction */
instr.opcode |= regop.n << 19;
}
}
-
+
/* Output opcode */
outP = emit(instr.opcode);
-
+
if (instr.disp == 0){
return;
}
-
+
/* Parse and process the displacement */
switch (parse_expr(instr.e,&expr)){
-
+
case SEG_GOOF:
as_bad("expression syntax error");
break;
-
+
case SEG_ABSOLUTE:
if (instr.disp == 32){
(void) emit(offs(expr)); /* Output displacement */
@@ -1521,7 +1521,7 @@ struct i960_opcode *oP; /* Pointer to description of instruction */
}
}
break;
-
+
case SEG_DIFFERENCE:
case SEG_TEXT:
case SEG_DATA:
@@ -1534,7 +1534,7 @@ struct i960_opcode *oP; /* Pointer to description of instruction */
*/
mema_to_memb(outP);
}
-
+
/* Output 0 displacement and set up address fixup for when
* this symbol's value becomes known.
*/
@@ -1549,7 +1549,7 @@ struct i960_opcode *oP; /* Pointer to description of instruction */
0);
fixP->fx_im_disp = 2; /* 32-bit displacement fix */
break;
-
+
default:
BAD_CASE(segs(expr));
break;
@@ -1572,18 +1572,18 @@ char *opcodeP; /* Where to find the opcode, in target byte order */
{
long opcode; /* Opcode in host byte order */
long mode; /* Mode bits for MEMB instruction */
-
+
opcode = md_chars_to_number(opcodeP, 4);
know(!(opcode & MEMB_BIT));
-
+
mode = MEMB_BIT | D_BIT;
if (opcode & MEMA_ABASE){
mode |= A_BIT;
}
-
+
opcode &= 0xffffc000; /* Clear MEMA offset and mode bits */
opcode |= mode; /* Set MEMB mode bits */
-
+
md_number_to_chars(opcodeP, opcode, 4);
} /* mema_to_memb() */
@@ -1611,19 +1611,19 @@ expressionS *expP; /* Where to put the results of parsing */
char *save_in; /* Save global here */
segT seg; /* Segment to which expression evaluates */
symbolS *symP;
-
+
know(textP);
-
+
if (*textP == '\0') {
/* Treat empty string as absolute 0 */
expP->X_add_symbol = expP->X_subtract_symbol = NULL;
expP->X_add_number = 0;
seg = expP->X_seg = SEG_ABSOLUTE;
-
+
} else {
save_in = input_line_pointer; /* Save global */
input_line_pointer = textP; /* Make parser work for us */
-
+
seg = expression(expP);
if (input_line_pointer - textP != strlen(textP)) {
/* Did not consume all of the input */
@@ -1634,7 +1634,7 @@ expressionS *expP; /* Where to put the results of parsing */
/* Register name in an expression */
seg = SEG_GOOF;
}
-
+
input_line_pointer = save_in; /* Restore global */
}
return seg;
@@ -1666,12 +1666,12 @@ char *arg[]; /* See above */
static char buf[5]; /* Literal for first operand */
static char buf2[5]; /* Literal for second operand */
expressionS e; /* Parsed expression */
-
-
+
+
arg[3] = NULL; /* So we can tell at the end if it got used or not */
-
+
switch (parse_expr(arg[1],&e)){
-
+
case SEG_TEXT:
case SEG_DATA:
case SEG_BSS:
@@ -1680,7 +1680,7 @@ char *arg[]; /* See above */
/* We're dependent on one or more symbols -- use "lda" */
arg[0] = "lda";
break;
-
+
case SEG_ABSOLUTE:
/* Try the following mappings:
* ldconst 0,<reg> ->mov 0,<reg>
@@ -1697,21 +1697,21 @@ char *arg[]; /* See above */
n = offs(e);
if ((0 <= n) && (n <= 31)){
arg[0] = "mov";
-
+
} else if ((-31 <= n) && (n <= -1)){
arg[0] = "subo";
arg[3] = arg[2];
sprintf(buf, "%d", -n);
arg[1] = buf;
arg[2] = "0";
-
+
} else if ((32 <= n) && (n <= 62)){
arg[0] = "addo";
arg[3] = arg[2];
arg[1] = "31";
sprintf(buf, "%d", n-31);
arg[2] = buf;
-
+
} else if ((shift = shift_ok(n)) != 0){
arg[0] = "shlo";
arg[3] = arg[2];
@@ -1719,12 +1719,12 @@ char *arg[]; /* See above */
arg[1] = buf;
sprintf(buf2, "%d", n >> shift);
arg[2] = buf2;
-
+
} else {
arg[0] = "lda";
}
break;
-
+
default:
as_bad("invalid constant");
return -1;
@@ -1780,7 +1780,7 @@ int optype; /* MEM1, MEM2, MEM4, MEM8, MEM12, or MEM16 */
*/
int mode; /* MEMB mode bits */
int *intP; /* Pointer to register number */
-
+
/* The following table contains the default scale factors for each
* type of memory instruction. It is accessed using (optype-MEM1)
* as an index -- thus it assumes the 'optype' constants are assigned
@@ -1794,10 +1794,10 @@ int optype; /* MEM1, MEM2, MEM4, MEM8, MEM12, or MEM16 */
-1, /* MEM12 -- no valid default */
16 /* MEM16 */
};
-
-
+
+
iprel_flag = mode = 0;
-
+
/* Any index present? */
indexP = get_ispec(argP);
if (indexP) {
@@ -1809,11 +1809,11 @@ int optype; /* MEM1, MEM2, MEM4, MEM8, MEM12, or MEM16 */
scale = def_scale[ optype - MEM1 ];
} else {
*p++ = '\0'; /* Eliminate '*' */
-
+
/* Now indexP->a '\0'-terminated register name,
* and p->a scale factor.
*/
-
+
if (!strcmp(p,"16")){
scale = 16;
} else if (strchr("1248",*p) && (p[1] == '\0')){
@@ -1822,13 +1822,13 @@ int optype; /* MEM1, MEM2, MEM4, MEM8, MEM12, or MEM16 */
scale = -1;
}
}
-
+
regnum = get_regnum(indexP); /* Get index reg. # */
if (!IS_RG_REG(regnum)){
as_bad("invalid index register");
return;
}
-
+
/* Convert scale to its binary encoding */
switch (scale){
case 1: scale = 0 << 7; break;
@@ -1838,11 +1838,11 @@ int optype; /* MEM1, MEM2, MEM4, MEM8, MEM12, or MEM16 */
case 16: scale = 4 << 7; break;
default: as_bad("invalid scale factor"); return;
};
-
+
memP->opcode |= scale | regnum; /* Set index bits in opcode */
mode |= I_BIT; /* Found a valid index spec */
}
-
+
/* Any abase (Register Indirect) specification present? */
if ((p = strrchr(argP,'(')) != NULL) {
/* "(" is there -- does it start a legal abase spec?
@@ -1862,13 +1862,13 @@ int optype; /* MEM1, MEM2, MEM4, MEM8, MEM12, or MEM16 */
}
}
}
-
+
/* Any expression present? */
memP->e = argP;
if (*argP != '\0'){
mode |= D_BIT;
}
-
+
/* Special-case ip-relative addressing */
if (iprel_flag){
if (mode & I_BIT){
@@ -1879,7 +1879,7 @@ int optype; /* MEM1, MEM2, MEM4, MEM8, MEM12, or MEM16 */
}
return;
}
-
+
/* Handle all other modes */
switch (mode){
case D_BIT | A_BIT:
@@ -1891,14 +1891,14 @@ int optype; /* MEM1, MEM2, MEM4, MEM8, MEM12, or MEM16 */
memP->opcode |= MEMA_ABASE;
memP->disp = 12;
break;
-
+
case D_BIT:
/* Go with MEMA instruction format for now (grow to MEMB later
* if 12 bits is not enough for the displacement).
*/
memP->disp = 12;
break;
-
+
case A_BIT:
/* For some reason, the bit string for this mode is not
* consistent: it should be 0 (exclusive of the MEMB bit),
@@ -1906,12 +1906,12 @@ int optype; /* MEM1, MEM2, MEM4, MEM8, MEM12, or MEM16 */
*/
memP->opcode |= MEMB_BIT;
break;
-
+
case A_BIT | I_BIT:
/* set MEMB bit in mode, and OR in mode bits */
memP->opcode |= mode | MEMB_BIT;
break;
-
+
case I_BIT:
/* Treat missing displacement as displacement of 0 */
mode |= D_BIT;
@@ -1924,7 +1924,7 @@ int optype; /* MEM1, MEM2, MEM4, MEM8, MEM12, or MEM16 */
memP->opcode |= mode | MEMB_BIT;
memP->disp = 32;
break;
-
+
default:
syntax();
break;
@@ -1950,9 +1950,9 @@ int po_num; /* Pseudo-op number: currently S_LEAFPROC or S_SYSPROC */
int n_ops; /* Number of operands */
char *p; /* Pointer to beginning of unparsed argument string */
char eol; /* Character that indicated end of line */
-
+
extern char is_end_of_line[];
-
+
/* Advance input pointer to end of line. */
p = input_line_pointer;
while (!is_end_of_line[ *input_line_pointer ]){
@@ -1960,20 +1960,20 @@ int po_num; /* Pseudo-op number: currently S_LEAFPROC or S_SYSPROC */
}
eol = *input_line_pointer; /* Save end-of-line char */
*input_line_pointer = '\0'; /* Terminate argument list */
-
+
/* Parse out operands */
n_ops = get_args(p, args);
if (n_ops == -1){
return;
}
-
+
/* Dispatch to correct handler */
switch (po_num){
case S_SYSPROC: s_sysproc(n_ops, args); break;
case S_LEAFPROC: s_leafproc(n_ops, args); break;
default: BAD_CASE(po_num); break;
}
-
+
/* Restore eol, so line numbers get updated correctly. Base assembler
* assumes we leave input pointer pointing at char following the eol.
*/
@@ -1995,7 +1995,7 @@ char opdesc; /* Descriptor byte: what's legal for this operand */
{
int n; /* Register number */
expressionS e; /* Parsed expression */
-
+
/* See if operand is a register */
n = get_regnum(optext);
if (n >= 0){
@@ -2037,7 +2037,7 @@ char opdesc; /* Descriptor byte: what's legal for this operand */
&& (optext[1] <= 'f') ){
optext += 2;
}
-
+
if (!strcmp(optext,"0.0") || !strcmp(optext,"0") ){
regopP->n = 0x10;
return;
@@ -2046,7 +2046,7 @@ char opdesc; /* Descriptor byte: what's legal for this operand */
regopP->n = 0x16;
return;
}
-
+
} else { /* fixed point literal acceptable */
if ((parse_expr(optext,&e) != SEG_ABSOLUTE)
|| (offs(e) < 0) || (offs(e) > 31)){
@@ -2057,7 +2057,7 @@ char opdesc; /* Descriptor byte: what's legal for this operand */
return;
}
}
-
+
/* Nothing worked */
syntax();
regopP->mode = 0; /* Register r0 is always a good one */
@@ -2076,14 +2076,14 @@ struct i960_opcode *oP; /* Pointer to description of instruction */
long instr; /* Binary to be output */
struct regop regop; /* Description of register operand */
int n_ops; /* Number of operands */
-
-
+
+
instr = oP->opcode;
n_ops = oP->num_ops;
-
+
if (n_ops >= 1){
parse_regop(&regop, args[1], oP->operand[0]);
-
+
if ((n_ops == 1) && !(instr & M3)){
/* 1-operand instruction in which the dst field should
* be used (instead of src1).
@@ -2101,10 +2101,10 @@ struct i960_opcode *oP; /* Pointer to description of instruction */
}
instr |= regop.n | regop.mode | regop.special;
}
-
+
if (n_ops >= 2) {
parse_regop(&regop, args[2], oP->operand[1]);
-
+
if ((n_ops == 2) && !(instr & M3)){
/* 2-operand instruction in which the dst field should
* be used instead of src2).
@@ -2181,7 +2181,7 @@ register fragS *fragP; /* fragP->fr_opcode is assumed to point to
long instr; /* A single i960 instruction */
char *iP; /*->instruction to be replaced */
fixS *fixP; /* Relocation that can be done at assembly time */
-
+
/* PICK UP & PARSE COBR INSTRUCTION */
iP = fragP->fr_opcode;
instr = md_chars_to_number(iP, 4);
@@ -2191,15 +2191,15 @@ register fragS *fragP; /* fragP->fr_opcode is assumed to point to
s2 = instr & 1;
src2 = (instr >> 14) & 0x1f;
bp_bits= instr & BP_MASK;
-
+
/* GENERATE AND OUTPUT COMPARE INSTRUCTION */
instr = coj[opcode].compare
| src1 | (m1 << 11) | (s2 << 6) | (src2 << 14);
md_number_to_chars(iP, instr, 4);
-
+
/* OUTPUT BRANCH INSTRUCTION */
md_number_to_chars(iP+4, coj[opcode].branch | bp_bits, 4);
-
+
/* SET UP ADDRESS FIXUP/RELOCATION */
fixP = fix_new(fragP,
iP+4 - fragP->fr_literal,
@@ -2209,9 +2209,9 @@ register fragS *fragP; /* fragP->fr_opcode is assumed to point to
fragP->fr_offset,
1,
0);
-
+
fixP->fx_bit_fixP = (bit_fixS *) 24; /* Store size of bit field */
-
+
fragP->fr_fix += 4;
frag_wane(fragP);
}
@@ -2241,28 +2241,28 @@ void reloc_callj(fixP)
fixS *fixP; /* Relocation that can be done at assembly time */
{
char *where; /*->the binary for the instruction being relocated */
-
+
if (!fixP->fx_callj) {
return;
} /* This wasn't a callj instruction in the first place */
-
+
where = fixP->fx_frag->fr_literal + fixP->fx_where;
-
+
if (TC_S_IS_SYSPROC(fixP->fx_addsy)) {
/* Symbol is a .sysproc: replace 'call' with 'calls'.
* System procedure number is (other-1).
*/
md_number_to_chars(where, CALLS|TC_S_GET_SYSPROC(fixP->fx_addsy), 4);
-
+
/* Nothing else needs to be done for this instruction.
* Make sure 'md_number_to_field()' will perform a no-op.
*/
fixP->fx_bit_fixP = (bit_fixS *) 1;
-
+
} else if (TC_S_IS_CALLNAME(fixP->fx_addsy)) {
/* Should not happen: see block comment above */
as_fatal("Trying to 'bal' to %s", S_GET_NAME(fixP->fx_addsy));
-
+
} else if (TC_S_IS_BALNAME(fixP->fx_addsy)) {
/* Replace 'call' with 'bal'; both instructions have
* the same format, so calling code should complete
@@ -2272,9 +2272,9 @@ fixS *fixP; /* Relocation that can be done at assembly time */
} else if (TC_S_IS_BADPROC(fixP->fx_addsy)) {
as_bad("Looks like a proc, but can't tell what kind.\n");
} /* switch on proc type */
-
+
/* else Symbol is neither a sysproc nor a leafproc */
-
+
return;
} /* reloc_callj() */
@@ -2300,38 +2300,38 @@ char *args[]; /* args[1]->1st operand, args[2]->2nd operand */
{
symbolS *callP; /* Pointer to leafproc 'call' entry point symbol */
symbolS *balP; /* Pointer to leafproc 'bal' entry point symbol */
-
+
if ((n_ops != 1) && (n_ops != 2)) {
as_bad("should have 1 or 2 operands");
return;
} /* Check number of arguments */
-
+
/* Find or create symbol for 'call' entry point. */
callP = symbol_find_or_make(args[1]);
-
+
if (TC_S_IS_CALLNAME(callP)) {
as_warn("Redefining leafproc %s", S_GET_NAME(callP));
} /* is leafproc */
-
+
/* If that was the only argument, use it as the 'bal' entry point.
* Otherwise, mark it as the 'call' entry point and find or create
* another symbol for the 'bal' entry point.
*/
if ((n_ops == 1) || !strcmp(args[1],args[2])) {
TC_S_FORCE_TO_BALNAME(callP);
-
+
} else {
TC_S_FORCE_TO_CALLNAME(callP);
-
+
balP = symbol_find_or_make(args[2]);
if (TC_S_IS_CALLNAME(balP)) {
as_warn("Redefining leafproc %s", S_GET_NAME(balP));
}
TC_S_FORCE_TO_BALNAME(balP);
-
+
tc_set_bal_of_call(callP, balP);
} /* if only one arg, or the args are the same */
-
+
return;
} /* s_leafproc() */
@@ -2354,12 +2354,12 @@ char *args[]; /* args[1]->1st operand, args[2]->2nd operand */
{
expressionS exp;
symbolS *symP;
-
+
if (n_ops != 2) {
as_bad("should have two operands");
return;
} /* bad arg count */
-
+
/* Parse "entry_num" argument and check it for validity. */
if ((parse_expr(args[2],&exp) != SEG_ABSOLUTE)
|| (offs(exp) < 0)
@@ -2367,17 +2367,17 @@ char *args[]; /* args[1]->1st operand, args[2]->2nd operand */
as_bad("'entry_num' must be absolute number in [0,31]");
return;
}
-
+
/* Find/make symbol and stick entry number (biased by +1) into it */
symP = symbol_find_or_make(args[1]);
-
+
if (TC_S_IS_SYSPROC(symP)) {
as_warn("Redefining entrynum for sysproc %s", S_GET_NAME(symP));
} /* redefining */
-
+
TC_S_SET_SYSPROC(symP, offs(exp)); /* encode entry number */
TC_S_FORCE_TO_SYSPROC(symP);
-
+
return;
} /* s_sysproc() */
@@ -2398,17 +2398,17 @@ static
int n; /* The constant of interest */
{
int shift; /* The shift count */
-
+
if (n <= 0){
/* Can't do it for negative numbers */
return 0;
}
-
+
/* Shift 'n' right until a 1 is about to be lost */
for (shift = 0; (n & 1) == 0; shift++){
n >>= 1;
}
-
+
if (n >= 32){
return 0;
}
@@ -2514,9 +2514,9 @@ fixS *fixP;
long val;
{
char *place = fixP->fx_where + fixP->fx_frag->fr_literal;
-
+
if (!fixP->fx_bit_fixP) {
-
+
switch (fixP->fx_im_disp) {
case 0:
fixP->fx_addnumber = val;
@@ -2536,7 +2536,7 @@ long val;
} else {
md_number_to_field(place, val, fixP->fx_bit_fixP);
}
-
+
return;
} /* md_apply_fix() */
@@ -2549,19 +2549,19 @@ relax_addressT segment_address_in_file;
static unsigned char nbytes_r_length[] = { 42, 0, 1, 42, 2 };
struct relocation_info ri;
symbolS *symbolP;
-
+
/* JF this is for paranoia */
memset((char *)&ri, '\0', sizeof(ri));
-
+
know((symbolP = fixP->fx_addsy) != 0);
-
+
/* These two 'cuz of NS32K */
ri.r_callj = fixP->fx_callj;
-
+
ri.r_length = nbytes_r_length[fixP->fx_size];
ri.r_pcrel = fixP->fx_pcrel;
ri.r_address = fixP->fx_frag->fr_address + fixP->fx_where - segment_address_in_file;
-
+
if (!S_IS_DEFINED(symbolP)) {
ri.r_extern = 1;
ri.r_index = symbolP->sy_number;
@@ -2569,10 +2569,10 @@ relax_addressT segment_address_in_file;
ri.r_extern = 0;
ri.r_index = S_GET_TYPE(symbolP);
}
-
+
/* Output the relocation information in machine-dependent form. */
md_ri_to_chars(where, &ri);
-
+
return;
} /* tc_bout_fix_to_chars() */
@@ -2592,7 +2592,7 @@ void tc_headers_hook(headers)
object_headers *headers;
{
/* FIXME: remove this line */ /* unsigned short arch_flag = 0; */
-
+
if ((iclasses_seen == I_BASE) || (iclasses_seen == 0)) {
headers->filehdr.f_flags |= F_I960CORE;
} else if (iclasses_seen & I_CX){
@@ -2604,7 +2604,7 @@ object_headers *headers;
} else {
headers->filehdr.f_flags |= F_I960KA;
} /* set arch flag */
-
+
if (flagseen['R']) {
headers->filehdr.f_magic = I960RWMAGIC;
headers->aouthdr.magic = OMAGIC;
@@ -2612,7 +2612,7 @@ object_headers *headers;
headers->filehdr.f_magic = I960ROMAGIC;
headers->aouthdr.magic = NMAGIC;
} /* set magic numbers */
-
+
return;
} /* tc_headers_hook() */
#endif /* OBJ_COFF */
@@ -2640,7 +2640,7 @@ void tc_crawl_symbol_chain(headers)
object_headers *headers;
{
symbolS *symbolP;
-
+
for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next(symbolP)) {
#ifdef OBJ_COFF
if (TC_S_IS_SYSPROC(symbolP)) {
@@ -2651,15 +2651,15 @@ object_headers *headers;
continue;
} /* rewrite sysproc */
#endif /* OBJ_COFF */
-
+
if (!TC_S_IS_BALNAME(symbolP) && !TC_S_IS_CALLNAME(symbolP)) {
continue;
} /* Not a leafproc symbol */
-
+
if (!S_IS_DEFINED(symbolP)) {
as_bad("leafproc symbol '%s' undefined", S_GET_NAME(symbolP));
} /* undefined leaf */
-
+
if (TC_S_IS_CALLNAME(symbolP)) {
symbolS *balP = tc_get_bal_of_call(symbolP);
if (S_IS_EXTERNAL(symbolP) != S_IS_EXTERNAL(balP)) {
@@ -2670,7 +2670,7 @@ object_headers *headers;
} /* externality mismatch */
} /* if callname */
} /* walk the symbol chain */
-
+
return;
} /* tc_crawl_symbol_chain() */
@@ -2687,14 +2687,14 @@ symbolS *balP;
{
know(TC_S_IS_CALLNAME(callP));
know(TC_S_IS_BALNAME(balP));
-
+
#ifdef OBJ_COFF
-
+
callP->sy_symbol.ost_auxent[1].x_bal.x_balntry = (int) balP;
S_SET_NUMBER_AUXILIARY(callP,2);
-
+
#elif defined(OBJ_AOUT) || defined(OBJ_BOUT)
-
+
/* If the 'bal' entry doesn't immediately follow the 'call'
* symbol, unlink it from the symbol list and re-insert it.
*/
@@ -2702,11 +2702,11 @@ symbolS *balP;
symbol_remove(balP, &symbol_rootP, &symbol_lastP);
symbol_append(balP, callP, &symbol_rootP, &symbol_lastP);
} /* if not in order */
-
+
#else
(as yet unwritten.);
#endif /* switch on OBJ_FORMAT */
-
+
return;
} /* tc_set_bal_of_call() */
@@ -2714,9 +2714,9 @@ char *_tc_get_bal_of_call(callP)
symbolS *callP;
{
symbolS *retval;
-
+
know(TC_S_IS_CALLNAME(callP));
-
+
#ifdef OBJ_COFF
retval = (symbolS *) (callP->sy_symbol.ost_auxent[1].x_bal.x_balntry);
#elif defined(OBJ_AOUT) || defined(OBJ_BOUT)
@@ -2724,7 +2724,7 @@ symbolS *callP;
#else
(as yet unwritten.);
#endif /* switch on OBJ_FORMAT */
-
+
know(TC_S_IS_BALNAME(retval));
return((char *) retval);
} /* _tc_get_bal_of_call() */
@@ -2735,7 +2735,7 @@ symbolS *symbolP;
if (TC_S_IS_CALLNAME(symbolP)) {
#ifdef OBJ_COFF
symbolS *balP = tc_get_bal_of_call(symbolP);
-
+
/* second aux entry contains the bal entry point */
/* S_SET_NUMBER_AUXILIARY(symbolP, 2); */
symbolP->sy_symbol.ost_auxent[1].x_bal.x_balntry = S_GET_VALUE(balP);
@@ -2745,7 +2745,7 @@ symbolS *symbolP;
S_SET_STORAGE_CLASS(balP, C_LABEL);
#endif /* OBJ_COFF */
} /* only on calls */
-
+
return;
} /* tc_coff_symbol_emit_hook() */
diff --git a/gnu/usr.bin/as/config/tc-i960.h b/gnu/usr.bin/as/config/tc-i960.h
index caad4d6..236c9b1 100644
--- a/gnu/usr.bin/as/config/tc-i960.h
+++ b/gnu/usr.bin/as/config/tc-i960.h
@@ -1,18 +1,18 @@
/* tc-i960.h - Basic 80960 instruction formats.
Copyright (C) 1989, 1990, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -39,7 +39,7 @@
* the instruction generated (a CTRL-format 'call') should have its relocation
* specially flagged for link-time replacement with a 'bal' or 'calls' if
* appropriate.
- */
+ */
/* tailor gas */
#define SYMBOLS_NEED_BACKPOINTERS
@@ -69,7 +69,7 @@
#define M2 0x1000
#define M3 0x2000
-/* Generate the 12-bit opcode for a REG format instruction by placing the
+/* Generate the 12-bit opcode for a REG format instruction by placing the
* high 8 bits in instruction bits 24-31, the low 4 bits in instruction bits
* 7-10.
*/
@@ -179,7 +179,7 @@
* 'bal' entry point to the procedure (see following). These
* entries come from '.leafproc' directives in which two different
* symbols are specified (the first one is represented here).
- *
+ *
*
* n_other == N_BALNAME
* the symbol is the 'bal' entry point to a leaf procedure.
@@ -252,9 +252,9 @@ struct relocation_info {
#else /* switch on OBJ */
you lose
#endif /* witch on OBJ */
-
+
#if __STDC__ == 1
-
+
void brtab_emit(void);
void reloc_callj(); /* this is really reloc_callj(fixS *fixP) but I don't want to change header inclusion order. */
void tc_set_bal_of_call(); /* this is really tc_set_bal_of_call(symbolS *callP, symbolS *balP) */
diff --git a/gnu/usr.bin/as/config/tc-m68851.h b/gnu/usr.bin/as/config/tc-m68851.h
index 5f70e42..8e69702 100644
--- a/gnu/usr.bin/as/config/tc-m68851.h
+++ b/gnu/usr.bin/as/config/tc-m68851.h
@@ -1,19 +1,19 @@
/* This file is tc-m68851.h
Copyright (C) 1987-1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -26,16 +26,16 @@
to us as part of the changes for the m68851 Memory Management Unit */
/* Copyright (C) 1987 Free Software Foundation, Inc.
-
+
This file is part of Gas, the GNU Assembler.
-
+
The GNU assembler is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the GNU Assembler General
Public License for full details.
-
+
Everyone is granted permission to copy, modify and redistribute
the GNU Assembler, but only under the conditions described in the
GNU Assembler General Public License. A copy of this license is
@@ -47,10 +47,10 @@
#ifdef m68851
/*
- I didn't use much imagination in choosing the
+ I didn't use much imagination in choosing the
following codes, so many of them aren't very
mnemonic. -rab
-
+
P pmmu register
Possible values:
000 TC Translation Control reg
@@ -58,28 +58,28 @@
101 VAL Validate Access Level
110 SCC Stack Change Control
111 AC Access Control
-
+
W wide pmmu registers
Possible values:
001 DRP Dma Root Pointer
010 SRP Supervisor Root Pointer
011 CRP Cpu Root Pointer
-
+
f function code register
0 SFC
1 DFC
-
+
V VAL register only
-
+
X BADx, BACx
100 BAD Breakpoint Acknowledge Data
101 BAC Breakpoint Acknowledge Control
-
+
Y PSR
Z PCSR
-
+
| memory (modes 2-6, 7.*)
-
+
*/
/*
@@ -136,8 +136,8 @@
{"pbwcw", one(0xf089), one(0xffbf), "Bc"},
{"pbws", one(0xf0c8), one(0xffbf), "Bc"},
{"pbwsw", one(0xf088), one(0xffbf), "Bc"},
-
-
+
+
{"pdbac", two(0xf048, 0x0007), two(0xfff8, 0xffff), "DsBw"},
{"pdbas", two(0xf048, 0x0006), two(0xfff8, 0xffff), "DsBw"},
{"pdbbc", two(0xf048, 0x0001), two(0xfff8, 0xffff), "DsBw"},
@@ -154,53 +154,53 @@
{"pdbss", two(0xf048, 0x0004), two(0xfff8, 0xffff), "DsBw"},
{"pdbwc", two(0xf048, 0x0009), two(0xfff8, 0xffff), "DsBw"},
{"pdbws", two(0xf048, 0x0008), two(0xfff8, 0xffff), "DsBw"},
-
+
{"pflusha", two(0xf000, 0x2400), two(0xffff, 0xffff), "" },
-
+
{"pflush", two(0xf000, 0x3010), two(0xffc0, 0xfe10), "T3T9" },
{"pflush", two(0xf000, 0x3810), two(0xffc0, 0xfe10), "T3T9&s" },
{"pflush", two(0xf000, 0x3008), two(0xffc0, 0xfe18), "D3T9" },
{"pflush", two(0xf000, 0x3808), two(0xffc0, 0xfe18), "D3T9&s" },
{"pflush", two(0xf000, 0x3000), two(0xffc0, 0xfe1e), "f3T9" },
{"pflush", two(0xf000, 0x3800), two(0xffc0, 0xfe1e), "f3T9&s" },
-
+
{"pflushs", two(0xf000, 0x3410), two(0xfff8, 0xfe10), "T3T9" },
{"pflushs", two(0xf000, 0x3c00), two(0xfff8, 0xfe00), "T3T9&s" },
{"pflushs", two(0xf000, 0x3408), two(0xfff8, 0xfe18), "D3T9" },
{"pflushs", two(0xf000, 0x3c08), two(0xfff8, 0xfe18), "D3T9&s" },
{"pflushs", two(0xf000, 0x3400), two(0xfff8, 0xfe1e), "f3T9" },
{"pflushs", two(0xf000, 0x3c00), two(0xfff8, 0xfe1e), "f3T9&s"},
-
+
{"pflushr", two(0xf000, 0xa000), two(0xffc0, 0xffff), "|s" },
-
+
{"ploadr", two(0xf000, 0x2210), two(0xffc0, 0xfff0), "T3&s" },
{"ploadr", two(0xf000, 0x2208), two(0xffc0, 0xfff8), "D3&s" },
{"ploadr", two(0xf000, 0x2200), two(0xffc0, 0xfffe), "f3&s" },
{"ploadw", two(0xf000, 0x2010), two(0xffc0, 0xfff0), "T3&s" },
{"ploadw", two(0xf000, 0x2008), two(0xffc0, 0xfff8), "D3&s" },
{"ploadw", two(0xf000, 0x2000), two(0xffc0, 0xfffe), "f3&s" },
-
+
/* TC, CRP, DRP, SRP, CAL, VAL, SCC, AC */
{"pmove", two(0xf000, 0x4000), two(0xffc0, 0xe3ff), "*sP8" },
{"pmove", two(0xf000, 0x4200), two(0xffc0, 0xe3ff), "P8%s" },
{"pmove", two(0xf000, 0x4000), two(0xffc0, 0xe3ff), "|sW8" },
{"pmove", two(0xf000, 0x4200), two(0xffc0, 0xe3ff), "W8~s" },
-
+
/* BADx, BACx */
{"pmove", two(0xf000, 0x6200), two(0xffc0, 0xe3e3), "*sX3" },
{"pmove", two(0xf000, 0x6000), two(0xffc0, 0xe3e3), "X3%s" },
-
+
/* PSR, PCSR */
/* {"pmove", two(0xf000, 0x6100), two(oxffc0, oxffff), "*sZ8" }, */
{"pmove", two(0xf000, 0x6000), two(0xffc0, 0xffff), "*sY8" },
{"pmove", two(0xf000, 0x6200), two(0xffc0, 0xffff), "Y8%s" },
{"pmove", two(0xf000, 0x6600), two(0xffc0, 0xffff), "Z8%s" },
-
+
{"prestore", one(0xf140), one(0xffc0), "&s"},
{"prestore", one(0xf158), one(0xfff8), "+s"},
{"psave", one(0xf100), one(0xffc0), "&s"},
{"psave", one(0xf100), one(0xffc0), "+s"},
-
+
{"psac", two(0xf040, 0x0007), two(0xffc0, 0xffff), "@s"},
{"psas", two(0xf040, 0x0006), two(0xffc0, 0xffff), "@s"},
{"psbc", two(0xf040, 0x0001), two(0xffc0, 0xffff), "@s"},
@@ -217,88 +217,88 @@
{"psss", two(0xf040, 0x0004), two(0xffc0, 0xffff), "@s"},
{"pswc", two(0xf040, 0x0009), two(0xffc0, 0xffff), "@s"},
{"psws", two(0xf040, 0x0008), two(0xffc0, 0xffff), "@s"},
-
+
{"ptestr", two(0xf000, 0x8210), two(0xffc0, 0xe3f0), "T3&sQ8" },
{"ptestr", two(0xf000, 0x8310), two(0xffc0, 0xe310), "T3&sQ8A9" },
{"ptestr", two(0xf000, 0x8208), two(0xffc0, 0xe3f8), "D3&sQ8" },
{"ptestr", two(0xf000, 0x8308), two(0xffc0, 0xe318), "D3&sQ8A9" },
{"ptestr", two(0xf000, 0x8200), two(0xffc0, 0xe3fe), "f3&sQ8" },
{"ptestr", two(0xf000, 0x8300), two(0xffc0, 0xe31e), "f3&sQ8A9" },
-
+
{"ptestw", two(0xf000, 0x8010), two(0xffc0, 0xe3f0), "T3&sQ8" },
{"ptestw", two(0xf000, 0x8110), two(0xffc0, 0xe310), "T3&sQ8A9" },
{"ptestw", two(0xf000, 0x8008), two(0xffc0, 0xe3f8), "D3&sQ8" },
{"ptestw", two(0xf000, 0x8108), two(0xffc0, 0xe318), "D3&sQ8A9" },
{"ptestw", two(0xf000, 0x8000), two(0xffc0, 0xe3fe), "f3&sQ8" },
{"ptestw", two(0xf000, 0x8100), two(0xffc0, 0xe31e), "f3&sQ8A9" },
-
+
{"ptrapacw", two(0xf07a, 0x0007), two(0xffff, 0xffff), "#w"},
{"ptrapacl", two(0xf07b, 0x0007), two(0xffff, 0xffff), "#l"},
{"ptrapac", two(0xf07c, 0x0007), two(0xffff, 0xffff), ""},
-
+
{"ptrapasw", two(0xf07a, 0x0006), two(0xffff, 0xffff), "#w"},
{"ptrapasl", two(0xf07b, 0x0006), two(0xffff, 0xffff), "#l"},
{"ptrapas", two(0xf07c, 0x0006), two(0xffff, 0xffff), ""},
-
+
{"ptrapbcw", two(0xf07a, 0x0001), two(0xffff, 0xffff), "#w"},
{"ptrapbcl", two(0xf07b, 0x0001), two(0xffff, 0xffff), "#l"},
{"ptrapbc", two(0xf07c, 0x0001), two(0xffff, 0xffff), ""},
-
+
{"ptrapbsw", two(0xf07a, 0x0000), two(0xffff, 0xffff), "#w"},
{"ptrapbsl", two(0xf07b, 0x0000), two(0xffff, 0xffff), "#l"},
{"ptrapbs", two(0xf07c, 0x0000), two(0xffff, 0xffff), ""},
-
+
{"ptrapccw", two(0xf07a, 0x000f), two(0xffff, 0xffff), "#w"},
{"ptrapccl", two(0xf07b, 0x000f), two(0xffff, 0xffff), "#l"},
{"ptrapcc", two(0xf07c, 0x000f), two(0xffff, 0xffff), ""},
-
+
{"ptrapcsw", two(0xf07a, 0x000e), two(0xffff, 0xffff), "#w"},
{"ptrapcsl", two(0xf07b, 0x000e), two(0xffff, 0xffff), "#l"},
{"ptrapcs", two(0xf07c, 0x000e), two(0xffff, 0xffff), ""},
-
+
{"ptrapgcw", two(0xf07a, 0x000d), two(0xffff, 0xffff), "#w"},
{"ptrapgcl", two(0xf07b, 0x000d), two(0xffff, 0xffff), "#l"},
{"ptrapgc", two(0xf07c, 0x000d), two(0xffff, 0xffff), ""},
-
+
{"ptrapgsw", two(0xf07a, 0x000c), two(0xffff, 0xffff), "#w"},
{"ptrapgsl", two(0xf07b, 0x000c), two(0xffff, 0xffff), "#l"},
{"ptrapgs", two(0xf07c, 0x000c), two(0xffff, 0xffff), ""},
-
+
{"ptrapicw", two(0xf07a, 0x000b), two(0xffff, 0xffff), "#w"},
{"ptrapicl", two(0xf07b, 0x000b), two(0xffff, 0xffff), "#l"},
{"ptrapic", two(0xf07c, 0x000b), two(0xffff, 0xffff), ""},
-
+
{"ptrapisw", two(0xf07a, 0x000a), two(0xffff, 0xffff), "#w"},
{"ptrapisl", two(0xf07b, 0x000a), two(0xffff, 0xffff), "#l"},
{"ptrapis", two(0xf07c, 0x000a), two(0xffff, 0xffff), ""},
-
+
{"ptraplcw", two(0xf07a, 0x0003), two(0xffff, 0xffff), "#w"},
{"ptraplcl", two(0xf07b, 0x0003), two(0xffff, 0xffff), "#l"},
{"ptraplc", two(0xf07c, 0x0003), two(0xffff, 0xffff), ""},
-
+
{"ptraplsw", two(0xf07a, 0x0002), two(0xffff, 0xffff), "#w"},
{"ptraplsl", two(0xf07b, 0x0002), two(0xffff, 0xffff), "#l"},
{"ptrapls", two(0xf07c, 0x0002), two(0xffff, 0xffff), ""},
-
+
{"ptrapscw", two(0xf07a, 0x0005), two(0xffff, 0xffff), "#w"},
{"ptrapscl", two(0xf07b, 0x0005), two(0xffff, 0xffff), "#l"},
{"ptrapsc", two(0xf07c, 0x0005), two(0xffff, 0xffff), ""},
-
+
{"ptrapssw", two(0xf07a, 0x0004), two(0xffff, 0xffff), "#w"},
{"ptrapssl", two(0xf07b, 0x0004), two(0xffff, 0xffff), "#l"},
{"ptrapss", two(0xf07c, 0x0004), two(0xffff, 0xffff), ""},
-
+
{"ptrapwcw", two(0xf07a, 0x0009), two(0xffff, 0xffff), "#w"},
{"ptrapwcl", two(0xf07b, 0x0009), two(0xffff, 0xffff), "#l"},
{"ptrapwc", two(0xf07c, 0x0009), two(0xffff, 0xffff), ""},
-
+
{"ptrapwsw", two(0xf07a, 0x0008), two(0xffff, 0xffff), "#w"},
{"ptrapwsl", two(0xf07b, 0x0008), two(0xffff, 0xffff), "#l"},
{"ptrapws", two(0xf07c, 0x0008), two(0xffff, 0xffff), ""},
-
+
{"pvalid", two(0xf000, 0x2800), two(0xffc0, 0xffff), "Vs&s"},
{"pvalid", two(0xf000, 0x2c00), two(0xffc0, 0xfff8), "A3&s" },
-
+
#endif /* m68851 */
/* end of tc-m68851.h */
diff --git a/gnu/usr.bin/as/config/tc-m68k.c b/gnu/usr.bin/as/config/tc-m68k.c
index 1aed016..2872103 100644
--- a/gnu/usr.bin/as/config/tc-m68k.c
+++ b/gnu/usr.bin/as/config/tc-m68k.c
@@ -1,20 +1,20 @@
/* tc-m68k.c All the m68020 specific stuff in one convenient, huge,
slow to compile, easy to find file.
-
+
Copyright (C) 1987, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -85,7 +85,7 @@ static struct obstack robyn;
#define PCLEA 6
/* Operands we can parse: (And associated modes)
-
+
numb: 8 bit num
numw: 16 bit num
numl: 32 bit num
@@ -97,7 +97,7 @@ static struct obstack robyn;
num2: like num
sz: w or l if omitted, l assumed
scale: 1 2 4 or 8 if omitted, 1 assumed
-
+
7.4 IMMED #num --> NUM
0.? DREG dreg --> dreg
1.? AREG areg --> areg
@@ -117,7 +117,7 @@ static struct obstack robyn;
*** MSCR otherreg --> Magic
With -l option
5.? AOFF apc@(num) --> *(apc+num) -- empty string and ZPC not allowed here still
-
+
examples:
#foo #0x35 #12
d2
@@ -129,11 +129,11 @@ static struct obstack robyn;
a1@(5,d2:w:1) @(45,d6:l:4)
pc@(a2) @(d4)
etc...
-
-
+
+
#name@(numw) -->turn into PC rel mode
apc@(num8,reg:sz:scale) --> *(apc+num8+reg*scale)
-
+
*/
enum operand_type {
@@ -174,7 +174,7 @@ enum _register {
DATA5,
DATA6,
DATA7,
-
+
ADDR,
ADDR0 = ADDR,
ADDR1,
@@ -184,12 +184,12 @@ enum _register {
ADDR5,
ADDR6,
ADDR7,
-
+
/* Note that COPNUM == processor #1 -- COPNUM+7 == #8, which stores as 000 */
/* I think... */
-
+
SP = ADDR7,
-
+
FPREG, /* Eight FP registers */
FP0 = FPREG,
FP1,
@@ -212,7 +212,7 @@ enum _register {
ZPC, /* Hack for Program space, but 0 addressing */
SR, /* Status Reg */
CCR, /* Condition code Reg */
-
+
/* These have to be in order for the movec instruction to work. */
USP, /* User Stack Pointer */
ISP, /* Interrupt stack pointer */
@@ -231,11 +231,11 @@ enum _register {
SRP,
URP,
/* end of movec ordering constraints */
-
+
FPI,
FPS,
FPC,
-
+
DRP,
CRP,
CAL,
@@ -262,12 +262,12 @@ enum _register {
BAC7,
PSR,
PCSR,
-
+
IC, /* instruction cache token */
DC, /* data cache token */
NC, /* no cache token */
BC, /* both caches token */
-
+
};
/* Internal form of an operand. */
@@ -287,15 +287,15 @@ struct m68k_it {
char *error;
char *args; /* list of opcode info */
int numargs;
-
+
int numo; /* Number of shorts in opcode */
short opcode[11];
-
+
struct m68k_op operands[6];
-
+
int nexp; /* number of exprs in use */
struct m68k_exp exprs[4];
-
+
int nfrag; /* Number of frags we have to produce */
struct {
int fragoff; /* Where in the current opcode[] the frag ends */
@@ -303,7 +303,7 @@ struct m68k_it {
long foff;
int fragty;
} fragb[4];
-
+
int nrel; /* Num of reloc strucs in use */
struct {
int n;
@@ -444,37 +444,37 @@ const relax_typeS
{ 1, 1, 0, 0 }, /* For no good reason except */
{ 1, 1, 0, 0 }, /* that the VAX doesn't either */
{ 1, 1, 0, 0 },
-
+
{ (127), (-128), 0, TAB(BRANCH,SHORT)},
{ (32767), (-32768), 2, TAB(BRANCH,LONG) },
{ 0, 0, 4, 0 },
{ 1, 1, 0, 0 },
-
+
{ 1, 1, 0, 0 }, /* FBRANCH doesn't come BYTE */
{ (32767), (-32768), 2, TAB(FBRANCH,LONG)},
{ 0, 0, 4, 0 },
{ 1, 1, 0, 0 },
-
+
{ 1, 1, 0, 0 }, /* PCREL doesn't come BYTE */
{ (32767), (-32768), 2, TAB(PCREL,LONG)},
{ 0, 0, 4, 0 },
{ 1, 1, 0, 0 },
-
+
{ (127), (-128), 0, TAB(BCC68000,SHORT)},
{ (32767), (-32768), 2, TAB(BCC68000,LONG) },
{ 0, 0, 6, 0 }, /* jmp long space */
{ 1, 1, 0, 0 },
-
+
{ 1, 1, 0, 0 }, /* DBCC doesn't come BYTE */
{ (32767), (-32768), 2, TAB(DBCC,LONG) },
{ 0, 0, 10, 0 }, /* bra/jmp long space */
{ 1, 1, 0, 0 },
-
+
{ 1, 1, 0, 0 }, /* PCLEA doesn't come BYTE */
{ 32767, -32768, 2, TAB(PCLEA,LONG) },
{ 0, 0, 6, 0 },
{ 1, 1, 0, 0 },
-
+
};
/* These are the machine dependent pseudo-ops. These are included so
@@ -559,14 +559,14 @@ register char **ccp;
char *p, *q;
register int n = 0,
ret = FAIL;
-
+
c[0] = mklower(ccp[0][0]);
#ifdef REGISTER_PREFIX
if (c[0] != REGISTER_PREFIX) {
return(FAIL);
} /* need prefix */
#endif
-
+
for (p = c, q = ccp[0]; p < c + MAX_REG_NAME_LEN; ++p, ++q)
{
if (*q == 0)
@@ -577,7 +577,7 @@ register char **ccp;
else
*p = mklower(*q);
} /* downcase */
-
+
switch (c[0]) {
case 'a':
if (c[1] >= '0' && c[1] <= '7') {
@@ -733,7 +733,7 @@ register char **ccp;
if (c[1] == 'c' && c[2] == 'c') {
n = 3;
ret = (SCC);
- } else
+ } else
#endif
if (c[1] == 'r') {
if (c[2] == 'p') {
@@ -806,7 +806,7 @@ register char **ccp;
* m68k_ip_op := '#' + <anything>
* | <register> + range_sep + get_regs
* ;
- *
+ *
* range_sep := '/' | '-' ;
*
* SKIP_WHITE := <empty> | ' ' ;
@@ -821,34 +821,34 @@ register struct m68k_op *opP;
char *strend;
long i;
char *parse_index();
-
+
if (*str == ' ') {
str++;
} /* Find the beginning of the string */
-
+
if (!*str) {
opP->error="Missing operand";
return FAIL;
} /* Out of gas */
-
+
for (strend = str; *strend; strend++) ;;
-
+
--strend;
-
+
if (*str == '#') {
str++;
opP->con1=add_exp(str,strend);
opP->mode=IMMED;
return OK;
} /* Guess what: A constant. Shar and enjoy */
-
+
i = m68k_reg_parse(&str);
-
+
/* is a register, is exactly a register, and is followed by '@' */
-
+
if ((i == FAIL || *str != '\0') && *str != '@') {
char *stmp;
-
+
if (i != FAIL && (*str == '/' || *str == '-')) {
opP->mode=REGLST;
return(get_regs(i,str,opP));
@@ -859,11 +859,11 @@ register struct m68k_op *opP;
opP->mode=AINDX;
return(OK);
}
-
+
if ((current_architecture & m68020up) == 0) {
return(FAIL);
} /* if target is not a '20 or better */
-
+
stmp++;
if (*stmp++ != '(' || *strend-- != ')') {
opP->error="Malformed operand";
@@ -871,7 +871,7 @@ register struct m68k_op *opP;
}
i=try_index(&stmp,opP);
opP->con2=add_exp(stmp,strend);
-
+
if (i == FAIL) {
opP->mode=AMIND;
} else {
@@ -883,9 +883,9 @@ register struct m68k_op *opP;
opP->con1 = add_exp(str,strend);
return(OK);
} /* not a register, not exactly a register, or no '@' */
-
+
opP->reg=i;
-
+
if (*str == '\0') {
if (i >= DATA+0 && i <= DATA+7)
opP->mode=DREG;
@@ -895,13 +895,13 @@ register struct m68k_op *opP;
opP->mode=MSCR;
return OK;
}
-
+
if ((i<ADDR+0 || i>ADDR+7) && i != PC && i != ZPC && i != FAIL) { /* Can't indirect off non address regs */
opP->error="Invalid indirect register";
return FAIL;
}
know(*str == '@');
-
+
str++;
switch (*str) {
case '\0':
@@ -925,7 +925,7 @@ register struct m68k_op *opP;
/* Didn't start with an index reg, maybe its offset or offset,reg */
if (i == FAIL) {
char *beg_str;
-
+
beg_str=str;
for (i=1;i;) {
switch (*str++) {
@@ -939,7 +939,7 @@ register struct m68k_op *opP;
}
/* if (str[-3] == ':') {
int siz;
-
+
switch (str[-2]) {
case 'b':
case 'B':
@@ -971,7 +971,7 @@ register struct m68k_op *opP;
}
}
/* We've now got offset) offset,reg) or reg) */
-
+
if (*str == '\0') {
/* Th-the-thats all folks */
if (opP->reg == FAIL) opP->mode = AINDX; /* Other form of indirect */
@@ -984,16 +984,16 @@ register struct m68k_op *opP;
opP->error = "junk after indirect";
return(FAIL);
}
-
+
if ((current_architecture & m68020up) == 0) {
return(FAIL);
} /* if target is not a '20 or better */
-
+
str+=2;
-
+
if (opP->ireg != FAIL) {
opP->mode = APRDX;
-
+
i = try_index(&str, opP);
if (i != FAIL) {
opP->error = "Two index registers! not allowed!";
@@ -1002,12 +1002,12 @@ register struct m68k_op *opP;
} else {
i = try_index(&str, opP);
}
-
+
if (i == FAIL) {
char *beg_str;
-
+
beg_str = str;
-
+
for (i = 1; i; ) {
switch (*str++) {
case '\0':
@@ -1018,22 +1018,22 @@ register struct m68k_op *opP;
case ')': --i; break;
}
}
-
+
opP->con2=add_exp(beg_str,str-2);
-
+
if (str[-1] == ',') {
if (opP->ireg != FAIL) {
opP->error = "Can't have two index regs";
return(FAIL);
}
-
+
i = try_index(&str, opP);
-
+
if (i == FAIL) {
opP->error = "malformed index reg";
return(FAIL);
}
-
+
opP->mode = APODX;
} else if (opP->ireg != FAIL) {
opP->mode = APRDX;
@@ -1043,7 +1043,7 @@ register struct m68k_op *opP;
} else {
opP->mode = APODX;
}
-
+
if (*str != '\0') {
opP->error="Junk after indirect";
return FAIL;
@@ -1052,7 +1052,7 @@ register struct m68k_op *opP;
} /* m68k_ip_op() */
/*
- *
+ *
* try_index := data_or_address_register + ')' + SKIP_W
* | data_or_address_register + ':' + SKIP_W + size_spec + SKIP_W + multiplier + ')' + SKIP_W
*
@@ -1075,7 +1075,7 @@ struct m68k_op *opP;
register int i;
char *ss;
#define SKIP_W() { ss++; if (*ss == ' ') ss++;}
-
+
ss= *s;
/* SKIP_W(); */
i=m68k_reg_parse(&ss);
@@ -1144,7 +1144,7 @@ main()
{
char buf[128];
struct m68k_op thark;
-
+
for (;;) {
if (!gets(buf))
break;
@@ -1216,80 +1216,80 @@ char *instring;
char *crack_operand();
LITTLENUM_TYPE words[6];
LITTLENUM_TYPE *wordp;
-
+
if (*instring == ' ')
instring++; /* skip leading whitespace */
-
+
/* Scan up to end of operation-code, which MUST end in end-of-string
or exactly 1 space. */
for (p = instring; *p != '\0'; p++)
if (*p == ' ')
break;
-
-
+
+
if (p == instring) {
the_ins.error = "No operator";
the_ins.opcode[0] = NULL;
/* the_ins.numo=1; */
return;
}
-
+
/* p now points to the end of the opcode name, probably whitespace.
make sure the name is null terminated by clobbering the whitespace,
- look it up in the hash table, then fix it back. */
+ look it up in the hash table, then fix it back. */
c = *p;
*p = '\0';
opcode = (struct m68k_incant *)hash_find (op_hash, instring);
*p = c;
-
+
if (opcode == NULL) {
the_ins.error = "Unknown operator";
the_ins.opcode[0] = NULL;
/* the_ins.numo=1; */
return;
}
-
+
/* found a legitimate opcode, start matching operands */
while (*p == ' ') ++p;
-
+
for (opP = &the_ins.operands[0]; *p; opP++) {
-
+
p = crack_operand(p, opP);
-
+
if (opP->error) {
the_ins.error=opP->error;
return;
}
}
-
+
opsfound = opP - &the_ins.operands[0];
-
+
/* This ugly hack is to support the floating pt opcodes in their standard form */
/* Essentially, we fake a first enty of type COP#1 */
if (opcode->m_operands[0] == 'I') {
int n;
-
+
for (n=opsfound;n>0;--n)
the_ins.operands[n]=the_ins.operands[n-1];
-
+
/* memcpy((char *)(&the_ins.operands[1]), (char *)(&the_ins.operands[0]), opsfound*sizeof(the_ins.operands[0])); */
memset((char *)(&the_ins.operands[0]), '\0', sizeof(the_ins.operands[0]));
the_ins.operands[0].mode=MSCR;
the_ins.operands[0].reg=COPNUM; /* COP #1 */
opsfound++;
}
-
+
/* We've got the operands. Find an opcode that'll accept them */
for (losing = 0; ; ) {
/* if we didn't get the right number of ops,
or we have no common model with this pattern
then reject this pattern. */
-
+
if (opsfound != opcode->m_opnum
|| ((opcode->m_arch & current_architecture) == 0)) {
-
+
++losing;
-
+
} else {
for (s=opcode->m_operands, opP = &the_ins.operands[0]; *s && !losing; s += 2, opP++) {
/* Warning: this switch is huge! */
@@ -1314,13 +1314,13 @@ char *instring;
|| opP->mode == REGLST)
losing++;
break;
-
+
case '#':
if (opP->mode != IMMED)
losing++;
else {
long t;
-
+
t=get_num(opP->con1,80);
if (s[1] == 'b' && !isbyte(t))
losing++;
@@ -1328,78 +1328,78 @@ char *instring;
losing++;
}
break;
-
+
case '^':
case 'T':
if (opP->mode != IMMED)
losing++;
break;
-
+
case '$':
if (opP->mode == MSCR || opP->mode == AREG ||
opP->mode == IMMED || opP->reg == PC || opP->reg == ZPC || opP->mode == REGLST)
losing++;
break;
-
+
case '%':
if (opP->mode == MSCR || opP->reg == PC ||
opP->reg == ZPC || opP->mode == REGLST)
losing++;
break;
-
-
+
+
case '&':
if (opP->mode == MSCR || opP->mode == DREG ||
opP->mode == AREG || opP->mode == IMMED || opP->reg == PC || opP->reg == ZPC ||
opP->mode == AINC || opP->mode == ADEC || opP->mode == REGLST)
losing++;
break;
-
+
case '*':
if (opP->mode == MSCR || opP->mode == REGLST)
losing++;
break;
-
+
case '+':
if (opP->mode != AINC)
losing++;
break;
-
+
case '-':
if (opP->mode != ADEC)
losing++;
break;
-
+
case '/':
if (opP->mode == MSCR || opP->mode == AREG ||
opP->mode == AINC || opP->mode == ADEC || opP->mode == IMMED || opP->mode == REGLST)
losing++;
break;
-
+
case ';':
if (opP->mode == MSCR || opP->mode == AREG || opP->mode == REGLST)
losing++;
break;
-
+
case '?':
if (opP->mode == MSCR || opP->mode == AREG ||
opP->mode == AINC || opP->mode == ADEC || opP->mode == IMMED || opP->reg == PC ||
opP->reg == ZPC || opP->mode == REGLST)
losing++;
break;
-
+
case '@':
if (opP->mode == MSCR || opP->mode == AREG ||
opP->mode == IMMED || opP->mode == REGLST)
losing++;
break;
-
+
case '~': /* For now! (JF FOO is this right?) */
if (opP->mode == MSCR || opP->mode == DREG ||
opP->mode == AREG || opP->mode == IMMED || opP->reg == PC || opP->reg == ZPC || opP->mode == REGLST)
losing++;
break;
-
+
case 'A':
if (opP->mode != AREG)
losing++;
@@ -1416,34 +1416,34 @@ char *instring;
&& instring[3] == 'r'))
losing++;
break;
-
+
case 'C':
if (opP->mode != MSCR || opP->reg != CCR)
losing++;
break;
-
+
case 'd': /* FOO This mode is a KLUDGE!! */
if (opP->mode != AOFF && (opP->mode != ABSL ||
opP->con1->e_beg[0] != '(' || opP->con1->e_end[0] != ')'))
losing++;
break;
-
+
case 'D':
if (opP->mode != DREG)
losing++;
break;
-
+
case 'F':
if (opP->mode != MSCR || opP->reg<(FPREG+0) || opP->reg>(FPREG+7))
losing++;
break;
-
+
case 'I':
if (opP->mode != MSCR || opP->reg<COPNUM ||
opP->reg >= COPNUM+7)
losing++;
break;
-
+
case 'J':
if (opP->mode != MSCR
|| opP->reg < USP
@@ -1468,12 +1468,12 @@ char *instring;
losing++;
} /* doesn't cut it */
break;
-
+
case 'k':
if (opP->mode != IMMED)
losing++;
break;
-
+
case 'l':
case 'L':
if (opP->mode == DREG || opP->mode == AREG || opP->mode == FPREG) {
@@ -1490,56 +1490,56 @@ char *instring;
else if (s[1] == '3' && opP->reg&0x7000000)
losing++;
break;
-
+
case 'M':
if (opP->mode != IMMED)
losing++;
else {
long t;
-
+
t=get_num(opP->con1,80);
if (!issbyte(t) || isvar(opP->con1))
losing++;
}
break;
-
+
case 'O':
if (opP->mode != DREG && opP->mode != IMMED)
losing++;
break;
-
+
case 'Q':
if (opP->mode != IMMED)
losing++;
else {
long t;
-
+
t=get_num(opP->con1,80);
if (t<1 || t>8 || isvar(opP->con1))
losing++;
}
break;
-
+
case 'R':
if (opP->mode != DREG && opP->mode != AREG)
losing++;
break;
-
+
case 's':
if (opP->mode != MSCR || !(opP->reg == FPI || opP->reg == FPS || opP->reg == FPC))
losing++;
break;
-
+
case 'S':
if (opP->mode != MSCR || opP->reg != SR)
losing++;
break;
-
+
case 'U':
if (opP->mode != MSCR || opP->reg != USP)
losing++;
break;
-
+
/* JF these are out of order. We could put them
in order if we were willing to put up with
bunches of #ifdef m68851s in the code */
@@ -1550,41 +1550,41 @@ char *instring;
opP->mode == AREG || opP->mode == REGLST)
losing++;
break;
-
+
case 'f':
if (opP->mode != MSCR || (opP->reg != SFC && opP->reg != DFC))
losing++;
break;
-
+
case 'P':
if (opP->mode != MSCR || (opP->reg != TC && opP->reg != CAL &&
opP->reg != VAL && opP->reg != SCC && opP->reg != AC))
losing++;
break;
-
+
case 'V':
if (opP->reg != VAL)
losing++;
break;
-
+
case 'W':
if (opP->mode != MSCR || (opP->reg != DRP && opP->reg != SRP &&
opP->reg != CRP))
losing++;
break;
-
+
case 'X':
if (opP->mode != MSCR ||
(!(opP->reg >= BAD && opP->reg <= BAD+7) &&
!(opP->reg >= BAC && opP->reg <= BAC+7)))
losing++;
break;
-
+
case 'Y':
if (opP->reg != PSR)
losing++;
break;
-
+
case 'Z':
if (opP->reg != PCSR)
losing++;
@@ -1598,7 +1598,7 @@ char *instring;
losing++;
} /* not a cache specifier. */
break;
-
+
case '_':
if (opP->mode != ABSL) {
++losing;
@@ -1609,38 +1609,38 @@ char *instring;
as_fatal("Internal error: Operand mode %c unknown in line %s of file \"%s\"",
*s, __LINE__, __FILE__);
} /* switch on type of operand */
-
+
if (losing) break;
} /* for each operand */
} /* if immediately wrong */
-
+
if (!losing) {
break;
} /* got it. */
-
+
opcode = opcode->m_next;
-
+
if (!opcode) {
the_ins.error = "instruction/operands mismatch";
return;
} /* Fell off the end */
-
+
losing = 0;
}
-
+
/* now assemble it */
-
+
the_ins.args=opcode->m_operands;
the_ins.numargs=opcode->m_opnum;
the_ins.numo=opcode->m_codenum;
the_ins.opcode[0]=getone(opcode);
the_ins.opcode[1]=gettwo(opcode);
-
+
for (s = the_ins.args, opP = &the_ins.operands[0]; *s; s += 2, opP++) {
/* This switch is a doozy.
Watch the first step; its a big one! */
switch (s[0]) {
-
+
#ifdef PIC
case ' ':
/* this operand is just here to indicate a jump-table branch */
@@ -1712,7 +1712,7 @@ char *instring;
addword(nextword);
baseo=0;
break;
-
+
case 'f':
baseo=2;
outro=8;
@@ -1735,7 +1735,7 @@ char *instring;
}
if (!baseo)
break;
-
+
if (literal) {
if (seg(opP->con1) == SEG_BIG)
goto bignum;
@@ -1747,7 +1747,7 @@ char *instring;
addword(nextword);
break;
}
-
+
/* We gotta put out some float */
if (seg(opP->con1) != SEG_BIG) {
int_to_gen(nextword);
@@ -1790,10 +1790,10 @@ char *instring;
tmpreg=0x18+opP->reg-ADDR; /* 3.areg */
break;
case AOFF:
-
+
nextword=get_num(opP->con1,80);
/* Force into index mode. Hope this works */
-
+
/* We do the first bit for 32-bit displacements,
and the second bit for 16 bit ones. It is
possible that we should make the default be
@@ -1801,13 +1801,13 @@ char *instring;
break GCC, so we put up with a little
inefficiency for the sake of working output.
*/
-
+
if ( !issword(nextword)
|| ( isvar(opP->con1)
&& ((opP->con1->e_siz == 0
&& flagseen['l'] == 0)
|| opP->con1->e_siz == 3))) {
-
+
if (opP->reg == PC)
tmpreg=0x3B; /* 7.3 */
else
@@ -1830,7 +1830,7 @@ char *instring;
tmpreg=0x3A; /* 7.2 */
else
tmpreg=0x28+opP->reg-ADDR; /* 5.areg */
-
+
if (isvar(opP->con1)) {
if (opP->reg == PC) {
add_fix('w',opP->con1,1,NO_RELOC);
@@ -1840,7 +1840,7 @@ char *instring;
}
addword(nextword);
break;
-
+
case APODX:
case AMIND:
case APRDX:
@@ -1860,14 +1860,14 @@ char *instring;
nextword|=0x80;
tmpreg=0x30; /* 6.garbage */
} else tmpreg=0x30+opP->reg-ADDR; /* 6.areg */
-
+
siz1= (opP->con1) ? opP->con1->e_siz : 0;
siz2= (opP->con2) ? opP->con2->e_siz : 0;
-
+
/* Index register stuff */
if (opP->ireg >= DATA+0 && opP->ireg <= ADDR+7) {
nextword|=(opP->ireg-DATA)<<12;
-
+
if (opP->isiz == 0 || opP->isiz == 3)
nextword|=0x800;
switch (opP->imul) {
@@ -1879,7 +1879,7 @@ char *instring;
}
/* IF its simple,
GET US OUT OF HERE! */
-
+
/* Must be INDEX, with an index
register. Address register
cannot be ZERO-PC, and either
@@ -1899,7 +1899,7 @@ char *instring;
}
} else
nextword|=0x40; /* No index reg */
-
+
/* It aint simple */
nextword|=0x100;
/* If the guy specified a width, we assume that
@@ -1912,7 +1912,7 @@ char *instring;
nextword|=0x30;
} else if (baseo == 0)
nextword|=0x10;
- else {
+ else {
nextword|=0x20;
siz1=2;
}
@@ -1926,7 +1926,7 @@ char *instring;
nextword|=0x30;
break;
}
-
+
/* Figure out innner displacement stuff */
if (opP->mode != AINDX) {
switch (siz2) {
@@ -1936,7 +1936,7 @@ char *instring;
nextword|=0x3;
} else if (outro == 0)
nextword|=0x1;
- else {
+ else {
nextword|=0x2;
siz2=2;
}
@@ -1954,7 +1954,7 @@ char *instring;
else if (opP->mode == AMIND) nextword|=0x40;
}
addword(nextword);
-
+
if (isvar(opP->con1)) {
if (opP->reg == PC || opP->reg == ZPC) {
add_fix(siz1 == 3 ? 'l' : 'w',opP->con1,1,NO_RELOC);
@@ -1966,7 +1966,7 @@ char *instring;
addword(baseo>>16);
if (siz1)
addword(baseo);
-
+
if (isvar(opP->con2)) {
if (opP->reg == PC || opP->reg == ZPC) {
add_fix(siz2 == 3 ? 'l' : 'w',opP->con2,1,NO_RELOC);
@@ -1978,9 +1978,9 @@ char *instring;
addword(outro>>16);
if (siz2)
addword(outro);
-
+
break;
-
+
case ABSL:
nextword=get_num(opP->con1,80);
switch (opP->con1->e_siz) {
@@ -2010,16 +2010,16 @@ char *instring;
case 3: /* Fall through into long */
if (isvar(opP->con1))
add_fix('l',opP->con1,0,NO_RELOC);
-
+
tmpreg=0x39; /* 7.1 mode */
addword(nextword>>16);
addword(nextword);
break;
-
+
case 2: /* Word */
if (isvar(opP->con1))
add_fix('w',opP->con1,0,NO_RELOC);
-
+
tmpreg=0x38; /* 7.0 mode */
addword(nextword);
break;
@@ -2032,7 +2032,7 @@ char *instring;
}
install_gen_operand(s[1],tmpreg);
break;
-
+
case '#':
case '^':
switch (s[1]) { /* JF: I hate floating point! */
@@ -2086,14 +2086,14 @@ char *instring;
as_fatal("Internal error: Unknown mode #%c in line %s of file \"%s\"", s[1], __LINE__, __FILE__);
}
break;
-
+
case '+':
case '-':
case 'A':
case 'a':
install_operand(s[1], opP->reg - ADDR);
break;
-
+
case 'B':
tmpreg = get_num(opP->con1, 80);
switch (s[1]) {
@@ -2129,7 +2129,7 @@ char *instring;
#endif /* PIC */
if (subs(opP->con1)) /* We can't relax it */
goto long_branch;
-
+
/* This could either be a symbol, or an
absolute address. No matter, the
frag hacking will finger it out.
@@ -2155,7 +2155,7 @@ char *instring;
add_frag(adds(opP->con1),offs(opP->con1),TAB(DBCC,SZ_UNDEF));
break;
}
-
+
/* Don't ask! */
opP->con1->e_exp.X_add_number+=2;
add_fix('w',opP->con1,1,NO_RELOC);
@@ -2191,16 +2191,16 @@ char *instring;
s[1], __LINE__, __FILE__);
}
break;
-
+
case 'C': /* Ignore it */
break;
-
+
case 'd': /* JF this is a kludge */
if (opP->mode == AOFF) {
install_operand('s',opP->reg-ADDR);
} else {
char *tmpP;
-
+
tmpP=opP->con1->e_end-2;
opP->con1->e_beg++;
opP->con1->e_end-=4; /* point to the , */
@@ -2218,22 +2218,22 @@ char *instring;
}
addword(tmpreg);
break;
-
+
case 'D':
install_operand(s[1],opP->reg-DATA);
break;
-
+
case 'F':
install_operand(s[1],opP->reg-FPREG);
break;
-
+
case 'I':
tmpreg=1+opP->reg-COPNUM;
if (tmpreg == 8)
tmpreg=0;
install_operand(s[1],tmpreg);
break;
-
+
case 'J': /* JF foo */
switch (opP->reg) {
case SFC: tmpreg=0x000; break;
@@ -2244,7 +2244,7 @@ char *instring;
case ITT1: tmpreg=0x005; break;
case DTT0: tmpreg=0x006; break;
case DTT1: tmpreg=0x007; break;
-
+
case USP: tmpreg=0x800; break;
case VBR: tmpreg=0x801; break;
case CAAR: tmpreg=0x802; break;
@@ -2258,12 +2258,12 @@ char *instring;
}
install_operand(s[1],tmpreg);
break;
-
+
case 'k':
tmpreg=get_num(opP->con1,55);
install_operand(s[1],tmpreg&0x7f);
break;
-
+
case 'l':
tmpreg=opP->reg;
if (s[1] == 'w') {
@@ -2276,7 +2276,7 @@ char *instring;
install_operand(s[1],reverse_8_bits(tmpreg>>16));
}
break;
-
+
case 'L':
tmpreg=opP->reg;
if (s[1] == 'w') {
@@ -2294,32 +2294,32 @@ char *instring;
install_operand(s[1],tmpreg>>16);
}
break;
-
+
case 'M':
install_operand(s[1],get_num(opP->con1,60));
break;
-
+
case 'O':
tmpreg= (opP->mode == DREG)
? 0x20+opP->reg-DATA
: (get_num(opP->con1,40)&0x1F);
install_operand(s[1],tmpreg);
break;
-
+
case 'Q':
tmpreg=get_num(opP->con1,10);
if (tmpreg == 8)
tmpreg=0;
install_operand(s[1],tmpreg);
break;
-
+
case 'R':
/* This depends on the fact that ADDR registers are
eight more than their corresponding DATA regs, so
the result will have the ADDR_REG bit set */
install_operand(s[1],opP->reg-DATA);
break;
-
+
case 's':
if (opP->reg == FPI) tmpreg=0x1;
else if (opP->reg == FPS) tmpreg=0x2;
@@ -2327,17 +2327,17 @@ char *instring;
else as_fatal("failed sanity check.");
install_operand(s[1],tmpreg);
break;
-
+
case 'S': /* Ignore it */
break;
-
+
case 'T':
install_operand(s[1],get_num(opP->con1,30));
break;
-
+
case 'U': /* Ignore it */
break;
-
+
case 'c':
switch (opP->reg) {
case NC: tmpreg = 0; break;
@@ -2364,7 +2364,7 @@ char *instring;
}
install_operand(s[1],tmpreg);
break;
-
+
case 'P':
switch (opP->reg) {
case TC:
@@ -2387,15 +2387,15 @@ char *instring;
}
install_operand(s[1],tmpreg);
break;
-
+
case 'V':
if (opP->reg == VAL)
break;
as_fatal("failed sanity check.");
-
+
case 'W':
switch (opP->reg) {
-
+
case DRP:
tmpreg=1;
break;
@@ -2410,19 +2410,19 @@ char *instring;
}
install_operand(s[1],tmpreg);
break;
-
+
case 'X':
switch (opP->reg) {
case BAD: case BAD+1: case BAD+2: case BAD+3:
case BAD+4: case BAD+5: case BAD+6: case BAD+7:
tmpreg = (4 << 10) | ((opP->reg - BAD) << 2);
break;
-
+
case BAC: case BAC+1: case BAC+2: case BAC+3:
case BAC+4: case BAC+5: case BAC+6: case BAC+7:
tmpreg = (5 << 10) | ((opP->reg - BAC) << 2);
break;
-
+
default:
as_fatal("failed sanity check.");
}
@@ -2454,12 +2454,12 @@ char *instring;
* | <empty>
* ;
*
-
+
* The idea here must be to scan in a set of registers but I don't
* understand it. Looks awfully sloppy to me but I don't have any doc on
* this format so...
-
- *
+
+ *
*
*/
@@ -2473,12 +2473,12 @@ char *str;
unsigned long cur_regs = 0;
int reg1,
reg2;
-
+
#define ADD_REG(x) { if (x == FPI) cur_regs|=(1<<24);\
else if (x == FPS) cur_regs|=(1<<25);\
else if (x == FPC) cur_regs|=(1<<26);\
else cur_regs|=(1<<(x-1)); }
-
+
reg1=i;
for (;;) {
if (*str == '/') {
@@ -2522,7 +2522,7 @@ int in;
{
int out=0;
int n;
-
+
static int mask[16] = {
0x0001,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,
0x0100,0x0200,0x0400,0x0800,0x1000,0x2000,0x4000,0x8000
@@ -2539,11 +2539,11 @@ int in;
{
int out=0;
int n;
-
+
static int mask[8] = {
0x0001,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,
};
-
+
for (n=0;n<8;n++) {
if (in&mask[n])
out|=mask[7-n];
@@ -2594,7 +2594,7 @@ int val;
the_ins.opcode[1]|=val<<5;
break;
#endif
-
+
case 't':
the_ins.opcode[1]|=(val<<10)|(val<<7);
break;
@@ -2673,7 +2673,7 @@ register struct m68k_op *opP;
register int parens;
register int c;
register char *beg_str;
-
+
if (!str) {
return str;
}
@@ -2782,8 +2782,8 @@ char *str;
int m,n = 0;
char *to_beg_P;
int shorts_this_frag;
-
-
+
+
if (current_architecture == 0) {
current_architecture = (m68020
#ifndef NO_68881
@@ -2794,7 +2794,7 @@ char *str;
#endif
);
} /* default current_architecture */
-
+
memset((char *)(&the_ins), '\0', sizeof(the_ins)); /* JF for paranoia sake */
m68k_ip(str);
er=the_ins.error;
@@ -2809,7 +2809,7 @@ char *str;
as_bad("\"%s\" -- Statement '%s' ignored",er,str);
return;
}
-
+
if (the_ins.nfrag == 0) { /* No frag hacking involved; just put it out */
toP=frag_more(2*the_ins.numo);
fromP= &the_ins.opcode[0];
@@ -2824,11 +2824,11 @@ char *str;
}
return;
}
-
+
/* There's some frag hacking */
for (n=0,fromP= &the_ins.opcode[0];n<the_ins.nfrag;n++) {
int wid;
-
+
if (n == 0) wid=2*the_ins.fragb[n].fragoff;
else wid=2*(the_ins.numo-the_ins.fragb[n-1].fragoff);
toP=frag_more(wid);
@@ -2888,17 +2888,17 @@ void
at compile time. Or even just xstr the table and use it as-is. But
my lord ghod hath spoken, so we do it this way. Excuse the ugly var
names. */
-
+
register const struct m68k_opcode *ins;
register struct m68k_incant *hack,
*slak;
register char *retval = 0; /* empty string, or error msg text */
register unsigned int i;
register char c;
-
+
if ((op_hash = hash_new()) == NULL)
as_fatal("Virtual memory exhausted");
-
+
obstack_begin(&robyn,4000);
for (ins = m68k_opcodes; ins < endop; ins++) {
hack=slak=(struct m68k_incant *)obstack_alloc(&robyn,sizeof(struct m68k_incant));
@@ -2919,16 +2919,16 @@ void
slak->m_next=0;
slak=slak->m_next;
} while (slak);
-
+
retval = hash_insert (op_hash, ins->name,(char *)hack);
/* Didn't his mommy tell him about null pointers? */
if (retval && *retval)
as_fatal("Internal Error: Can't hash %s: %s",ins->name,retval);
}
-
+
for (i = 0; i < sizeof(mklower_table) ; i++)
mklower_table[i] = (isupper(c = (char) i)) ? tolower(c) : c;
-
+
for (i = 0 ; i < sizeof(notend_table) ; i++) {
notend_table[i] = 0;
alt_notend_table[i] = 0;
@@ -2980,7 +2980,7 @@ int *sizeP;
LITTLENUM_TYPE *wordP;
char *t;
char *atof_ieee();
-
+
switch (type) {
case 'f':
case 'F':
@@ -2988,24 +2988,24 @@ int *sizeP;
case 'S':
prec = 2;
break;
-
+
case 'd':
case 'D':
case 'r':
case 'R':
prec = 4;
break;
-
+
case 'x':
case 'X':
prec = 6;
break;
-
+
case 'p':
case 'P':
prec = 6;
break;
-
+
default:
*sizeP=0;
return "Bad call to MD_ATOF()";
@@ -3013,7 +3013,7 @@ int *sizeP;
t=atof_ieee(input_line_pointer,type,words);
if (t)
input_line_pointer=t;
-
+
*sizeP=prec * sizeof(LITTLENUM_TYPE);
for (wordP=words;prec--;) {
md_number_to_chars(litP,(long)(*wordP++),sizeof(LITTLENUM_TYPE));
@@ -3060,7 +3060,7 @@ fixS *fixP;
long val;
{
char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;
-
+
switch (fixP->fx_size) {
case 1:
*buf++ = val;
@@ -3092,10 +3092,10 @@ register fragS *fragP;
{
long disp;
long ext = 0;
-
+
/* Address in object code of the displacement. */
register int object_address = fragP->fr_fix + fragP->fr_address;
-
+
#ifdef IBM_COMPILER_SUX
/* This is wrong but it convinces the native rs6000 compiler to
generate the code we want. */
@@ -3105,13 +3105,13 @@ register fragS *fragP;
/* Address in gas core of the place to store the displacement. */
register char *buffer_address = fragP->fr_fix + fragP->fr_literal;
#endif /* IBM_COMPILER_SUX */
-
+
/* No longer true: know(fragP->fr_symbol); */
-
+
/* The displacement of the address, from current location. */
disp = fragP->fr_symbol ? S_GET_VALUE(fragP->fr_symbol) : 0;
disp = (disp + fragP->fr_offset) - object_address;
-
+
switch (fragP->fr_subtype) {
case TAB(BCC68000,BYTE):
case TAB(BRANCH,BYTE):
@@ -3137,7 +3137,7 @@ register fragS *fragP;
fragP->fr_opcode[0]= 0x4E;
fragP->fr_opcode[1]= 0xB9; /* JBSR with ABSL LONG offset */
subseg_change(SEG_TEXT, 0);
-
+
fix_new(fragP,
fragP->fr_fix,
4,
@@ -3146,7 +3146,7 @@ register fragS *fragP;
fragP->fr_offset,
0,
FIX_NO_RELOC);
-
+
fragP->fr_fix+=4;
ext=0;
} else if (fragP->fr_opcode[0] == 0x60) {
@@ -3170,15 +3170,15 @@ register fragS *fragP;
/* change bcc into b!cc/jmp absl long */
fragP->fr_opcode[0] ^= 0x01; /* invert bcc */
fragP->fr_opcode[1] = 0x6; /* branch offset = 6 */
-
+
/* JF: these used to be fr_opcode[2,3], but they may be in a
different frag, in which case refering to them is a no-no.
Only fr_opcode[0,1] are guaranteed to work. */
- *buffer_address++ = 0x4e; /* put in jmp long (0x4ef9) */
- *buffer_address++ = 0xf9;
+ *buffer_address++ = 0x4e; /* put in jmp long (0x4ef9) */
+ *buffer_address++ = 0xf9;
fragP->fr_fix += 2; /* account for jmp instruction */
subseg_change(SEG_TEXT,0);
- fix_new(fragP, fragP->fr_fix, 4, fragP->fr_symbol, 0,
+ fix_new(fragP, fragP->fr_fix, 4, fragP->fr_symbol, 0,
fragP->fr_offset,0,
FIX_NO_RELOC);
fragP->fr_fix += 4;
@@ -3189,15 +3189,15 @@ register fragS *fragP;
/* change dbcc into dbcc/jmp absl long */
/* JF: these used to be fr_opcode[2-7], but that's wrong */
*buffer_address++ = 0x00; /* branch offset = 4 */
- *buffer_address++ = 0x04;
- *buffer_address++ = 0x60; /* put in bra pc+6 */
- *buffer_address++ = 0x06;
- *buffer_address++ = 0x4e; /* put in jmp long (0x4ef9) */
- *buffer_address++ = 0xf9;
-
+ *buffer_address++ = 0x04;
+ *buffer_address++ = 0x60; /* put in bra pc+6 */
+ *buffer_address++ = 0x06;
+ *buffer_address++ = 0x4e; /* put in jmp long (0x4ef9) */
+ *buffer_address++ = 0xf9;
+
fragP->fr_fix += 6; /* account for bra/jmp instructions */
subseg_change(SEG_TEXT,0);
- fix_new(fragP, fragP->fr_fix, 4, fragP->fr_symbol, 0,
+ fix_new(fragP, fragP->fr_fix, 4, fragP->fr_symbol, 0,
fragP->fr_offset,0,
FIX_NO_RELOC);
fragP->fr_fix += 4;
@@ -3247,15 +3247,15 @@ register fragS *fragP;
/* buffer_address+=2; */
ext=4;
break;
-
+
} /* switch on subtype */
-
+
if (ext) {
md_number_to_chars(buffer_address, (long) disp, (int) ext);
fragP->fr_fix += ext;
/* H_SET_TEXT_SIZE(headers, H_GET_TEXT_SIZE(headers) + ext); */
} /* if extending */
-
+
return;
} /* md_convert_frag() */
@@ -3268,12 +3268,12 @@ segT segment;
{
int old_fix;
register char *buffer_address = fragP->fr_fix + fragP->fr_literal;
-
+
old_fix = fragP->fr_fix;
-
+
/* handle SZ_UNDEF first, it can be changed to BYTE or SHORT */
switch (fragP->fr_subtype) {
-
+
case TAB(BRANCH,SZ_UNDEF): {
if ((fragP->fr_symbol != NULL) /* Not absolute */
&& S_GET_SEGMENT(fragP->fr_symbol) == segment) {
@@ -3286,7 +3286,7 @@ segT segment;
fragP->fr_opcode[0]= 0x4E;
fragP->fr_opcode[1]= 0xB9; /* JSR with ABSL LONG offset */
subseg_change(SEG_TEXT, 0);
- fix_new(fragP, fragP->fr_fix, 4,
+ fix_new(fragP, fragP->fr_fix, 4,
fragP->fr_symbol, 0, fragP->fr_offset, 0, FIX_NO_RELOC);
fragP->fr_fix+=4;
frag_wane(fragP);
@@ -3294,7 +3294,7 @@ segT segment;
fragP->fr_opcode[0]= 0x4E;
fragP->fr_opcode[1]= 0xF9; /* JMP with ABSL LONG offset */
subseg_change(SEG_TEXT, 0);
- fix_new(fragP, fragP->fr_fix, 4,
+ fix_new(fragP, fragP->fr_fix, 4,
fragP->fr_symbol, 0, fragP->fr_offset, 0, FIX_NO_RELOC);
fragP->fr_fix+=4;
frag_wane(fragP);
@@ -3322,10 +3322,10 @@ segT segment;
frag_wane(fragP);
break;
}
-
+
break;
} /* case TAB(BRANCH,SZ_UNDEF) */
-
+
case TAB(FBRANCH,SZ_UNDEF): {
if (S_GET_SEGMENT(fragP->fr_symbol) == segment || flagseen['l']) {
fragP->fr_subtype = TAB(FBRANCH,SHORT);
@@ -3336,7 +3336,7 @@ segT segment;
}
break;
} /* TAB(FBRANCH,SZ_UNDEF) */
-
+
case TAB(PCREL,SZ_UNDEF): {
if (S_GET_SEGMENT(fragP->fr_symbol) == segment || flagseen['l']) {
fragP->fr_subtype = TAB(PCREL,SHORT);
@@ -3347,7 +3347,7 @@ segT segment;
}
break;
} /* TAB(PCREL,SZ_UNDEF) */
-
+
case TAB(BCC68000,SZ_UNDEF): {
if ((fragP->fr_symbol != NULL)
&& S_GET_SEGMENT(fragP->fr_symbol) == segment) {
@@ -3360,28 +3360,28 @@ segT segment;
if (flagseen['l']) {
fragP->fr_opcode[1] = 0x04; /* branch offset = 6 */
/* JF: these were fr_opcode[2,3] */
- buffer_address[0] = 0x4e; /* put in jmp long (0x4ef9) */
+ buffer_address[0] = 0x4e; /* put in jmp long (0x4ef9) */
buffer_address[1] = 0xf8;
fragP->fr_fix += 2; /* account for jmp instruction */
subseg_change(SEG_TEXT,0);
- fix_new(fragP, fragP->fr_fix, 2, fragP->fr_symbol, 0,
+ fix_new(fragP, fragP->fr_fix, 2, fragP->fr_symbol, 0,
fragP->fr_offset, 0, FIX_NO_RELOC);
fragP->fr_fix += 2;
} else {
fragP->fr_opcode[1] = 0x06; /* branch offset = 6 */
/* JF: these were fr_opcode[2,3] */
- buffer_address[2] = 0x4e; /* put in jmp long (0x4ef9) */
+ buffer_address[2] = 0x4e; /* put in jmp long (0x4ef9) */
buffer_address[3] = 0xf9;
fragP->fr_fix += 2; /* account for jmp instruction */
subseg_change(SEG_TEXT,0);
- fix_new(fragP, fragP->fr_fix, 4, fragP->fr_symbol, 0,
+ fix_new(fragP, fragP->fr_fix, 4, fragP->fr_symbol, 0,
fragP->fr_offset, 0, FIX_NO_RELOC);
fragP->fr_fix += 4;
}
frag_wane(fragP);
break;
} /* case TAB(BCC68000,SZ_UNDEF) */
-
+
case TAB(DBCC,SZ_UNDEF): {
if (fragP->fr_symbol != NULL && S_GET_SEGMENT(fragP->fr_symbol) == segment) {
fragP->fr_subtype=TAB(DBCC,SHORT);
@@ -3392,9 +3392,9 @@ segT segment;
/* change dbcc into dbcc/jmp absl long */
/* JF: these used to be fr_opcode[2-4], which is wrong. */
buffer_address[0] = 0x00; /* branch offset = 4 */
- buffer_address[1] = 0x04;
+ buffer_address[1] = 0x04;
buffer_address[2] = 0x60; /* put in bra pc + ... */
-
+
if (flagseen['l']) {
/* JF: these were fr_opcode[5-7] */
buffer_address[3] = 0x04; /* plus 4 */
@@ -3402,25 +3402,25 @@ segT segment;
buffer_address[5] = 0xf8;
fragP->fr_fix += 6; /* account for bra/jmp instruction */
subseg_change(SEG_TEXT,0);
- fix_new(fragP, fragP->fr_fix, 2, fragP->fr_symbol, 0,
+ fix_new(fragP, fragP->fr_fix, 2, fragP->fr_symbol, 0,
fragP->fr_offset, 0, FIX_NO_RELOC);
fragP->fr_fix += 2;
} else {
/* JF: these were fr_opcode[5-7] */
buffer_address[3] = 0x06; /* Plus 6 */
- buffer_address[4] = 0x4e; /* put in jmp long (0x4ef9) */
- buffer_address[5] = 0xf9;
+ buffer_address[4] = 0x4e; /* put in jmp long (0x4ef9) */
+ buffer_address[5] = 0xf9;
fragP->fr_fix += 6; /* account for bra/jmp instruction */
subseg_change(SEG_TEXT,0);
- fix_new(fragP, fragP->fr_fix, 4, fragP->fr_symbol, 0,
+ fix_new(fragP, fragP->fr_fix, 4, fragP->fr_symbol, 0,
fragP->fr_offset, 0, FIX_NO_RELOC);
fragP->fr_fix += 4;
}
-
+
frag_wane(fragP);
break;
} /* case TAB(DBCC,SZ_UNDEF) */
-
+
case TAB(PCLEA,SZ_UNDEF): {
if ((S_GET_SEGMENT(fragP->fr_symbol)) == segment || flagseen['l']) {
fragP->fr_subtype=TAB(PCLEA,SHORT);
@@ -3431,12 +3431,12 @@ segT segment;
}
break;
} /* TAB(PCLEA,SZ_UNDEF) */
-
+
default:
break;
-
+
} /* switch on subtype looking for SZ_UNDEF's. */
-
+
/* now that SZ_UNDEF are taken care of, check others */
switch (fragP->fr_subtype) {
case TAB(BCC68000,BYTE):
@@ -3456,7 +3456,7 @@ segT segment;
}
#if defined(OBJ_AOUT) | defined(OBJ_BOUT)
-/* the bit-field entries in the relocation_info struct plays hell
+/* the bit-field entries in the relocation_info struct plays hell
with the byte-order problems of cross-assembly. So as a hack,
I added this mach. dependent ri twiddler. Ugly, but it gets
you there. -KWK */
@@ -3478,8 +3478,8 @@ struct reloc_info_generic *ri;
the_bytes[4] = (ri->r_symbolnum >> 16) & 0x0ff;
the_bytes[5] = (ri->r_symbolnum >> 8) & 0x0ff;
the_bytes[6] = ri->r_symbolnum & 0x0ff;
- the_bytes[7] = (((ri->r_pcrel << 7) & 0x80) | ((ri->r_length << 5) & 0x60) |
- ((ri->r_extern << 4) & 0x10));
+ the_bytes[7] = (((ri->r_pcrel << 7) & 0x80) | ((ri->r_length << 5) & 0x60) |
+ ((ri->r_extern << 4) & 0x10));
}
#endif /* comment */
@@ -3498,11 +3498,11 @@ relax_addressT segment_address_in_file;
int r_flags;
know(fixP->fx_addsy != NULL);
-
+
md_number_to_chars(where,
fixP->fx_frag->fr_address + fixP->fx_where - segment_address_in_file,
4);
-
+
r_symbolnum = (S_IS_DEFINED(fixP->fx_addsy)
? S_GET_TYPE(fixP->fx_addsy)
: fixP->fx_addsy->sy_number);
@@ -3535,12 +3535,12 @@ relax_addressT segment_address_in_file;
break;
}
#endif /* PIC */
-
+
where[4] = (r_symbolnum >> 16) & 0x0ff;
where[5] = (r_symbolnum >> 8) & 0x0ff;
where[6] = r_symbolnum & 0x0ff;
where[7] = r_flags;
-
+
return;
} /* tc_aout_fix_to_chars() */
@@ -3559,9 +3559,9 @@ fragS *frag;
symbolS *to_symbol;
{
long offset;
-
+
offset = to_addr - (from_addr+2);
-
+
md_number_to_chars(ptr ,(long)0x6000,2);
md_number_to_chars(ptr+2,(long)offset,2);
}
@@ -3575,7 +3575,7 @@ fragS *frag;
symbolS *to_symbol;
{
long offset;
-
+
if (cpu_of_arch(current_architecture) < m68020) {
offset=to_addr-S_GET_VALUE(to_symbol);
md_number_to_chars(ptr ,(long)0x4EF9,2);
@@ -3591,7 +3591,7 @@ symbolS *to_symbol;
#endif
/* Different values of OK tell what its OK to return. Things that aren't OK are an error (what a shock, no?)
-
+
0: Everything is OK
10: Absolute 1:8 only
20: Absolute 0:7 only
@@ -3602,7 +3602,7 @@ symbolS *to_symbol;
60: absolute -128:127 only
70: absolute 0:4095 only
80: No bignums
-
+
*/
static int get_num(exp,ok)
@@ -3611,7 +3611,7 @@ int ok;
{
#ifdef TEST2
long l = 0;
-
+
if (!exp->e_beg)
return 0;
if (*exp->e_beg == '0') {
@@ -3625,7 +3625,7 @@ int ok;
#else
char *save_in;
char c_save;
-
+
if (!exp) {
/* Can't do anything */
return 0;
@@ -3638,7 +3638,7 @@ int ok;
as_warn("Null expression defaults to %ld",offs(exp));
return 0;
}
-
+
exp->e_siz=0;
if (/* ok != 80 && */exp->e_end[-1] == ':' && (exp->e_end-exp->e_beg) >= 2) {
switch (exp->e_end[0]) {
@@ -3673,7 +3673,7 @@ int ok;
offs(exp)= (ok == 10) ? 1 : 0;
as_warn("Unknown expression: '%s' defaulting to %d",exp->e_beg,offs(exp));
break;
-
+
case SEG_ABSENT:
/* Do the same thing the VAX asm does */
seg(exp)=SEG_ABSOLUTE;
@@ -3744,7 +3744,7 @@ int ok;
case SEG_BIG:
if (ok == 80 && offs(exp)<0) { /* HACK! Turn it into a long */
LITTLENUM_TYPE words[6];
-
+
gen_to_words(words,2,8L);/* These numbers are magic! */
seg(exp)=SEG_ABSOLUTE;
adds(exp)=0;
@@ -3804,7 +3804,7 @@ static void s_bss() {
static void s_even() {
register int temp;
register long temp_fill;
-
+
temp = 1; /* JF should be 2? */
temp_fill = get_absolute_expression ();
if ( ! need_pass_2 ) /* Never make frag if expect extra pass. */
@@ -3851,20 +3851,20 @@ char ***vecP;
case 'l': /* -l means keep external to 2 bit offset
rather than 16 bit one */
break;
-
+
case 'S': /* -S means that jbsr's always turn into jsr's. */
break;
-
+
case 'A':
(*argP)++;
/* intentional fall-through */
case 'm':
(*argP)++;
-
+
if (**argP == 'c') {
(*argP)++;
} /* allow an optional "c" */
-
+
if (!strcmp(*argP, "68000")
|| !strcmp(*argP, "68008")) {
current_architecture |= m68000;
@@ -3873,37 +3873,37 @@ char ***vecP;
omagic= 1<<16|OMAGIC;
#endif
current_architecture |= m68010;
-
- } else if (!strcmp(*argP, "68020")) {
+
+ } else if (!strcmp(*argP, "68020")) {
current_architecture |= m68020 | MAYBE_FLOAT_TOO;
-
- } else if (!strcmp(*argP, "68030")) {
+
+ } else if (!strcmp(*argP, "68030")) {
current_architecture |= m68030 | MAYBE_FLOAT_TOO;
-
- } else if (!strcmp(*argP, "68040")) {
+
+ } else if (!strcmp(*argP, "68040")) {
current_architecture |= m68040 | MAYBE_FLOAT_TOO;
-
+
#ifndef NO_68881
} else if (!strcmp(*argP, "68881")) {
current_architecture |= m68881;
-
+
} else if (!strcmp(*argP, "68882")) {
current_architecture |= m68882;
-
+
#endif /* NO_68881 */
#ifndef NO_68851
- } else if (!strcmp(*argP,"68851")) {
+ } else if (!strcmp(*argP,"68851")) {
current_architecture |= m68851;
-
+
#endif /* NO_68851 */
} else {
as_warn("Unknown architecture, \"%s\". option ignored", *argP);
} /* switch on architecture */
-
+
while (**argP) (*argP)++;
-
+
break;
-
+
case 'p':
if (!strcmp(*argP,"pic")) {
(*argP) += 3;
@@ -3911,7 +3911,7 @@ char ***vecP;
} else {
return(0);
} /* pic or not */
-
+
#ifdef PIC
case 'k':
/* Predefine GOT symbol */
@@ -3937,7 +3937,7 @@ main()
char buf[120];
char *cp;
int n;
-
+
m68k_ip_begin();
for (;;) {
if (!gets(buf) || !*buf)
@@ -3994,20 +3994,20 @@ char *str;
#endif
/* Possible states for relaxation:
-
+
0 0 branch offset byte (bra, etc)
0 1 word
0 2 long
-
+
1 0 indexed offsets byte a0@(32,d4:w:1) etc
1 1 word
1 2 long
-
+
2 0 two-offset index word-word a0@(32,d4)@(45) etc
2 1 word-long
2 2 long-word
2 3 long-long
-
+
*/
@@ -4023,7 +4023,7 @@ print_frags()
{
fragS *fragP;
extern fragS *text_frag_root;
-
+
for (fragP=text_frag_root;fragP;fragP=fragP->fr_next) {
printf("addr %lu next 0x%x fix %ld var %ld symbol 0x%x offset %ld\n",
fragP->fr_address,fragP->fr_next,fragP->fr_fix,fragP->fr_var,fragP->fr_symbol,fragP->fr_offset);
@@ -4045,7 +4045,7 @@ char *name;
return 0;
}
-/* Parse an operand that is machine-specific.
+/* Parse an operand that is machine-specific.
We just return without modifying the expression if we have nothing
to do. */
diff --git a/gnu/usr.bin/as/config/tc-m68k.h b/gnu/usr.bin/as/config/tc-m68k.h
index 4ea7482..33d8d96 100644
--- a/gnu/usr.bin/as/config/tc-m68k.h
+++ b/gnu/usr.bin/as/config/tc-m68k.h
@@ -1,26 +1,26 @@
/* This file is tc-m68k.h
Copyright (C) 1987-1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
/*
* This file is tp-generic.h and is intended to be a template for
- * target processor specific header files.
+ * target processor specific header files.
*/
#define MID_M68K 135
@@ -35,7 +35,7 @@
#define AOUT_MACHTYPE MID_MACHINE
#define LOCAL_LABELS_FB
-
+
#define tc_crawl_symbol_chain(a) {;} /* not used */
#define tc_headers_hook(a) {;} /* not used */
#define tc_aout_pre_write_hook(x) {;} /* not used */
diff --git a/gnu/usr.bin/as/config/tc-m68kmote.h b/gnu/usr.bin/as/config/tc-m68kmote.h
index 8d98baf..70afae3 100644
--- a/gnu/usr.bin/as/config/tc-m68kmote.h
+++ b/gnu/usr.bin/as/config/tc-m68kmote.h
@@ -1,26 +1,26 @@
/* This file is tc-m68kmote.h
Copyright (C) 1987-1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
/*
* This file is tp-generic.h and is intended to be a template for
- * target processor specific header files.
+ * target processor specific header files.
*/
#define TC_M68K 1
@@ -32,11 +32,11 @@
#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (2<<16|OMAGIC); /* Magic byte for file header */
#endif /* TE_SUN3 */
-
+
#define AOUT_MACHTYPE 0x2
#define REVERSE_SORT_RELOCS /* FIXME-NOW: this line can be removed. */
#define LOCAL_LABELS_FB
-
+
#define tc_crawl_symbol_chain(a) {;} /* not used */
#define tc_headers_hook(a) {;} /* not used */
#define tc_aout_pre_write_hook(x) {;} /* not used */
@@ -52,7 +52,7 @@
if (aim == 0 && this_state == 4) { /* hard encoded from tc-m68k.c */ \
aim=this_type->rlx_forward+1; /* Force relaxation into word mode */ \
}
-#define MRI
+#define MRI
/*
* Local Variables:
diff --git a/gnu/usr.bin/as/config/tc-m88k.c b/gnu/usr.bin/as/config/tc-m88k.c
index fd7dd86..34c6ba3 100644
--- a/gnu/usr.bin/as/config/tc-m88k.c
+++ b/gnu/usr.bin/as/config/tc-m88k.c
@@ -4,17 +4,17 @@
Copyright (C) 1989-1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -861,7 +861,7 @@ get_vec9 (param, valp)
return param;
}
-
+
#define hexval(z) \
(isdigit (z) ? (z) - '0' : \
islower (z) ? (z) - 'a' + 10 : \
@@ -1018,33 +1018,33 @@ fixS *fixP;
long val;
{
char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;
-
+
fixP->fx_addnumber = val;
-
-
+
+
switch (fixP->fx_r_type) {
-
+
case RELOC_IW16:
buf[2] = val >> 8;
buf[3] = val;
break;
-
+
case RELOC_LO16:
buf[0] = val >> 8;
buf[1] = val;
break;
-
+
case RELOC_HI16:
buf[0] = val >> 24;
buf[1] = val >> 16;
break;
-
+
case RELOC_PC16:
val += 4;
buf[0] = val >> 10;
buf[1] = val >> 2;
break;
-
+
case RELOC_PC26:
val += 4;
buf[0] |= (val >> 26) & 0x03;
@@ -1052,14 +1052,14 @@ long val;
buf[2] = val >> 10;
buf[3] = val >> 2;
break;
-
+
case RELOC_32:
buf[0] = val >> 24;
buf[1] = val >> 16;
buf[2] = val >> 8;
buf[3] = val;
break;
-
+
case NO_RELOC:
switch (fixP->fx_size) {
case 4:
@@ -1070,16 +1070,16 @@ long val;
case 1:
*buf = val;
break;
-
+
default:
abort ();
}
-
+
default:
as_bad("bad relocation type: 0x%02x", fixP->fx_r_type);
break;
}
-
+
return;
} /* md_apply_fix() */
@@ -1267,7 +1267,7 @@ emit_relocations (fixP, segment_address_in_file)
ri.r_type = fixP->fx_r_type;
if (fixP->fx_pcrel) {
/* ri.r_addend -= fixP->fx_where; */
- ri.r_addend -= ri.r_address;
+ ri.r_addend -= ri.r_address;
} else {
ri.r_addend = fixP->fx_addnumber;
}
@@ -1281,7 +1281,7 @@ emit_relocations (fixP, segment_address_in_file)
#endif /* comment */
/* Translate internal representation of relocation info to target format.
-
+
On m88k: first 4 bytes are normal unsigned long address,
next three bytes are index, most sig. byte first.
Byte 7 is broken up with bit 7 as external,
@@ -1298,9 +1298,9 @@ relax_addressT segment_address_in_file;
long r_extern;
long r_addend = 0;
long r_address;
-
+
know(fixP->fx_addsy);
-
+
if (!S_IS_DEFINED(fixP->fx_addsy)) {
r_extern = 1;
r_index = fixP->fx_addsy->sy_number;
@@ -1308,31 +1308,31 @@ relax_addressT segment_address_in_file;
r_extern = 0;
r_index = S_GET_TYPE(fixP->fx_addsy);
}
-
+
/* this is easy */
md_number_to_chars(where,
r_address = fixP->fx_frag->fr_address + fixP->fx_where - segment_address_in_file,
4);
-
+
/* now the fun stuff */
where[4] = (r_index >> 16) & 0x0ff;
where[5] = (r_index >> 8) & 0x0ff;
where[6] = r_index & 0x0ff;
where[7] = ((r_extern << 7) & 0x80) | (0 & 0x70) | (fixP->fx_r_type & 0xf);
-
+
/* Also easy */
if (fixP->fx_addsy->sy_frag) {
r_addend = fixP->fx_addsy->sy_frag->fr_address;
}
-
+
if (fixP->fx_pcrel) {
r_addend -= r_address;
} else {
r_addend = fixP->fx_addnumber;
}
-
+
md_number_to_chars(&where[8], r_addend, 4);
-
+
return;
} /* tc_aout_fix_to_chars() */
diff --git a/gnu/usr.bin/as/config/tc-m88k.h b/gnu/usr.bin/as/config/tc-m88k.h
index d5960d1..f518085 100644
--- a/gnu/usr.bin/as/config/tc-m88k.h
+++ b/gnu/usr.bin/as/config/tc-m88k.h
@@ -4,17 +4,17 @@
Copyright (C) 1989-1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
diff --git a/gnu/usr.bin/as/config/tc-ns32k.c b/gnu/usr.bin/as/config/tc-ns32k.c
index 5843fe5..33fceb5 100644
--- a/gnu/usr.bin/as/config/tc-ns32k.c
+++ b/gnu/usr.bin/as/config/tc-ns32k.c
@@ -1,18 +1,18 @@
/* ns32k.c -- Assemble on the National Semiconductor 32k series
Copyright (C) 1987, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -33,7 +33,7 @@
#include "obstack.h"
/* Macros */
-#define IIF_ENTRIES 13 /* number of entries in iif */
+#define IIF_ENTRIES 13 /* number of entries in iif */
#define PRIVATE_SIZE 256 /* size of my garbage memory */
#define MAX_ARGS 4
#define DEFAULT -1 /* addr_mode returns this value when plain constant or label is encountered */
@@ -91,7 +91,7 @@ addr_modeS addr_modeP;
char EXP_CHARS[] = "eE";
char FLT_CHARS[] = "fd"; /* we don't want to support lowercase, do we */
-/* UPPERCASE denotes live names
+/* UPPERCASE denotes live names
* when an instruction is built, IIF is used as an intermidiate form to store
* the actual parts of the instruction. A ns32k machine instruction can
* be divided into a couple of sub PARTs. When an instruction is assembled
@@ -116,7 +116,7 @@ typedef struct {
displacement */
int im_disp; /* True if the object is a displacement */
relax_substateT relax_substate; /* Initial relaxsubstate */
- bit_fixS *bit_fixP; /* Pointer at bit_fix struct */
+ bit_fixS *bit_fixP; /* Pointer at bit_fix struct */
int addr_mode; /* What addrmode do we associate with this iif-entry */
char bsr; /* Sequent hack */
}iif_entryT; /* Internal Instruction Format */
@@ -128,7 +128,7 @@ struct int_ins_form {
struct int_ins_form iif;
expressionS exprP;
char *input_line_pointer;
-/* description of the PARTs in IIF
+/* description of the PARTs in IIF
*object[n]:
* 0 total length in bytes of entries in iif
* 1 opcode
@@ -142,7 +142,7 @@ char *input_line_pointer;
* 9 imm_b
* 10 implied1
* 11 implied2
- *
+ *
* For every entry there is a datalength in bytes. This is stored in size[n].
* 0, the objectlength is not explicitly given by the instruction
* and the operand is undefined. This is a case for relaxation.
@@ -309,12 +309,12 @@ const pseudo_typeS md_pseudo_table[]={ /* so far empty */
#define IND(x,y) (((x)<<2)+(y))
-/* those are index's to relax groups in md_relax_table
+/* those are index's to relax groups in md_relax_table
ie it must be multiplied by 4 to point at a group start. Viz IND(x,y)
Se function relax_segment in write.c for more info */
#define BRANCH 1
-#define PCREL 2
+#define PCREL 2
/* those are index's to entries in a relax group */
@@ -337,7 +337,7 @@ const relax_typeS md_relax_table[] = {
{ 1, 1, 0, 0 },
{ 1, 1, 0, 0 },
{ 1, 1, 0, 0 },
-
+
{ (63), (-64), 1, IND(BRANCH,WORD) },
{ (8191), (-8192), 2, IND(BRANCH,DOUBLE) },
{ 0, 0, 4, 0 },
@@ -381,12 +381,12 @@ static void md_number_to_imm();
#endif /* not __STDC__ */
-/* Parses a general operand into an addressingmode struct
-
+/* Parses a general operand into an addressingmode struct
+
in: pointer at operand in ascii form
pointer at addr_mode struct for result
the level of recursion. (always 0 or 1)
-
+
out: data in addr_mode struct
*/
int addr_mode(operand,addr_modeP,recursive_level)
@@ -412,7 +412,7 @@ int recursive_level;
addr_modeP->disp[1]=NULL;
str=operand;
if (str[0] == 0) {return (0);} /* we don't want this */
- strl=strlen(str);
+ strl=strlen(str);
switch (str[0]) {
/* the following three case statements controls the mode-chars
this is the place to ed if you want to change them */
@@ -469,7 +469,7 @@ int recursive_level;
break;
default:;
}
- strl=strlen(str);
+ strl=strlen(str);
switch (strl) {
case 2:
switch (str[0]) {
@@ -642,7 +642,7 @@ addr_modeS *addr_modeP;
register int i;
register char *toP;
register char *fromP;
-
+
addr_modeP->pcrel=0;
if (disp_test[addr_modeP->mode]) { /* there is a displacement */
if (addr_modeP->mode == 27 || addr_modeP->scaled_mode == 27) { /* do we have pcrel. mode */
@@ -699,7 +699,7 @@ unsigned long *default_map; /* default pattern and output */
register int i,j,k,strlen1,strlen2;
register char *patternP,*strP;
strlen1=strlen(str);
- if (strlen1<1) {
+ if (strlen1<1) {
as_fatal("Very short instr to option, ie you can't do it on a NULLstr");
}
for (i = 0; optionP[i].pattern != 0; i++) {
@@ -717,7 +717,7 @@ unsigned long *default_map; /* default pattern and output */
}
}
}
-/* search struct for symbols
+/* search struct for symbols
This function is used to get the short integer form of reg names
in the instructions lmr, smr, lpr, spr
return true if str is found in list */
@@ -787,8 +787,8 @@ char opcode_bit_ptr;
get_addr_mode(argv[i],&addr_modeP);
iif.instr_size+=addr_modeP.am_size;
if (opcode_bit_ptr == desc->opcode_size) b = 4; else b = 6;
- for (j=b;j<(b+2);j++) {
- if (addr_modeP.disp[j-b]) {
+ for (j=b;j<(b+2);j++) {
+ if (addr_modeP.disp[j-b]) {
IIF(j,
2,
addr_modeP.disp_suffix[j-b],
@@ -805,7 +805,7 @@ char opcode_bit_ptr;
}
opcode_bit_ptr-=5;
iif.iifP[1].object|=((long)addr_modeP.mode)<<opcode_bit_ptr;
- if (addr_modeP.scaled_reg) {
+ if (addr_modeP.scaled_reg) {
j=b/2;
IIF(j,1,1, (unsigned long)addr_modeP.index_byte,0,0,0,0,0, NULL,-1,0);
}
@@ -920,7 +920,7 @@ int recursive_level;
char sqr,sep;
char suffix[MAX_ARGS],*argv[MAX_ARGS];/* no more than 4 operands */
if (recursive_level <= 0) { /* called from md_assemble */
- for (lineptr=line; (*lineptr) != '\0' && (*lineptr) != ' '; lineptr++);
+ for (lineptr=line; (*lineptr) != '\0' && (*lineptr) != ' '; lineptr++);
c = *lineptr;
*lineptr = '\0';
desc = (struct ns32k_opcode*) hash_find(inst_hash_handle,line);
@@ -1001,16 +1001,16 @@ int recursive_level;
} else {
as_fatal("Wrong number of operands");
}
-
+
}
for (i = 0; i < IIF_ENTRIES; i++) {
iif.iifP[i].type = 0; /* mark all entries as void*/
}
-
+
/* build opcode iif-entry */
iif.instr_size = desc->opcode_size / 8;
IIF(1,1,iif.instr_size,desc->opcode_seed,0,0,0,0,0,0,-1,0);
-
+
/* this call encodes operands to iif format */
if (argc) {
encode_operand(argc,
@@ -1064,7 +1064,7 @@ void convert_iif() {
evaluate_expr(&exprP, (char *)iif.iifP[i].object);
if (exprP.X_add_symbol || exprP.X_subtract_symbol)
pcrel_symbols++;
- }
+ }
}
for (i=0;i<IIF_ENTRIES;i++) {
if (type=iif.iifP[i].type) { /* the object exist, so handle it */
@@ -1129,7 +1129,7 @@ void convert_iif() {
}
} else { /* flonum */
LITTLENUM_TYPE words[4];
-
+
switch (size) {
case 4:
gen_to_words(words,2,8);
@@ -1168,7 +1168,7 @@ void convert_iif() {
bit_fixP,
iif.iifP[i].bsr, /* sequent hack */
reloc_mode);
-
+
} else { /* good, just put them bytes out */
switch (iif.iifP[i].im_disp) {
case 0:
@@ -1218,7 +1218,7 @@ void convert_iif() {
rem_size-=4;
break; /* exit this absolute hack */
}
-
+
if (exprP.X_add_symbol || exprP.X_subtract_symbol) { /* frag it */
if (exprP.X_subtract_symbol) { /* We cant relax this case */
as_fatal("Can't relax difference");
@@ -1231,7 +1231,7 @@ void convert_iif() {
obstack_blank_fast(&frags,temp);
/* we rewind none, some or all of the requested size we
requested by the first frag_more for this iif chunk.
- Note: that we allocate 4 bytes to an object we NOT YET
+ Note: that we allocate 4 bytes to an object we NOT YET
know the size of, thus rem_size-4.
*/
(void) frag_variant(rs_machine_dependent,
@@ -1339,12 +1339,12 @@ int *sizeP;
LITTLENUM_TYPE *wordP;
extern char *atof_ns32k();
char *t;
-
+
switch (type) {
case 'f':
prec = 2;
break;
-
+
case 'd':
prec = 4;
break;
@@ -1355,7 +1355,7 @@ int *sizeP;
t = atof_ns32k(input_line_pointer, type, words);
if (t)
input_line_pointer=t;
-
+
*sizeP = prec * sizeof(LITTLENUM_TYPE);
for (wordP = words +prec; prec--;) {
md_number_to_chars(litP, (long)(*--wordP), sizeof(LITTLENUM_TYPE));
@@ -1386,19 +1386,19 @@ int nbytes;
is the fact that ns32k uses Huffman coded displacements. This implies
that the bit order is reversed in displacements and that they are prefixed
with a size-tag.
-
+
binary: msb->lsb
0xxxxxxx byte
10xxxxxx xxxxxxxx word
11xxxxxx xxxxxxxx xxxxxxxx xxxxxxxx double word
-
- This must be taken care of and we do it here!
+
+ This must be taken care of and we do it here!
*/
static void md_number_to_disp(buf, val, n)
char *buf;
long val;
char n;
-{
+{
switch (n) {
case 1:
if (val < -64 || val > 63)
@@ -1464,7 +1464,7 @@ static void md_number_to_imm(buf,val,n)
char *buf;
long val;
char n;
-{
+{
switch (n) {
case 1:
#ifdef SHOW_NUM
@@ -1506,13 +1506,13 @@ char n;
}
/* Translate internal representation of relocation info into target format.
-
+
OVE: on a ns32k the twiddling continues at an even deeper level
here we have to distinguish between displacements and immediates.
-
+
The sequent has a bit for this. It also has a bit for relocobjects that
points at the target for a bsr (BranchSubRoutine) !?!?!?!
-
+
This md_ri.... is tailored for sequent.
*/
@@ -1521,7 +1521,7 @@ void
md_ri_to_chars(the_bytes, ri)
char *the_bytes;
struct reloc_info_generic *ri;
-{
+{
if (ri->r_bsr) { ri->r_pcrel = 0; } /* sequent seems to want this */
md_number_to_chars(the_bytes, ri->r_address, sizeof(ri->r_address));
md_number_to_chars(the_bytes+4, ((long)(ri->r_symbolnum )
@@ -1551,11 +1551,11 @@ relax_addressT segment_address_in_file;
int r_flags;
know(fixP->fx_addsy != NULL);
-
+
md_number_to_chars(where,
fixP->fx_frag->fr_address + fixP->fx_where - segment_address_in_file,
4);
-
+
r_symbolnum = (S_IS_DEFINED(fixP->fx_addsy)
? S_GET_TYPE(fixP->fx_addsy)
: fixP->fx_addsy->sy_number);
@@ -1597,12 +1597,12 @@ relax_addressT segment_address_in_file;
break;
}
#endif /* PIC */
-
+
where[4] = r_symbolnum & 0x0ff;
where[5] = (r_symbolnum >> 8) & 0x0ff;
where[6] = (r_symbolnum >> 16) & 0x0ff;
where[7] = r_flags;
-
+
return;
} /* tc_aout_fix_to_chars() */
@@ -1645,7 +1645,7 @@ static void
register char *buf;
register long val;
register bit_fixS *field_ptr;
-{
+{
register unsigned long object;
register unsigned long mask;
/* define ENDIAN on a ns32k machine */
@@ -1706,9 +1706,9 @@ register bit_fixS *field_ptr;
/* Apply a fixS (fixup of an instruction or data that we didn't have
enough info to complete immediately) to the data in a frag.
-
+
On the ns32k, everything is in a different format, so we have broken
- out separate functions for each kind of thing we could be fixing.
+ out separate functions for each kind of thing we could be fixing.
They all get called from here. */
void
@@ -1717,21 +1717,21 @@ fixS *fixP;
long val;
{
char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;
-
+
if (fixP->fx_bit_fixP) { /* Bitfields to fix, sigh */
md_number_to_field (buf, val, fixP->fx_bit_fixP);
} else switch (fixP->fx_im_disp) {
-
+
case 0: /* Immediate field */
md_number_to_imm (buf, val, fixP->fx_size);
break;
-
+
case 1: /* Displacement field */
- md_number_to_disp (buf,
+ md_number_to_disp (buf,
fixP->fx_pcrel? val + fixP->fx_pcrel_adjust: val,
fixP->fx_size);
break;
-
+
case 2: /* Pointer in a data object */
md_number_to_chars (buf, val, fixP->fx_size);
break;
@@ -1747,18 +1747,18 @@ register fragS *fragP;
{
long disp;
long ext = 0;
-
+
/* Address in gas core of the place to store the displacement. */
register char *buffer_address = fragP->fr_fix + fragP->fr_literal;
/* Address in object code of the displacement. */
register int object_address = fragP->fr_fix + fragP->fr_address;
-
+
know(fragP->fr_symbol);
-
+
/* The displacement of the address, from current location. */
disp = (S_GET_VALUE(fragP->fr_symbol) + fragP->fr_offset) - object_address;
disp += fragP->fr_pcrel_adjust;
-
+
switch (fragP->fr_subtype) {
case IND(BRANCH,BYTE):
ext = 1;
@@ -1835,7 +1835,7 @@ fragS *frag;
symbolS *to_symbol;
{
long offset;
-
+
offset = to_addr - from_addr;
md_number_to_chars(ptr, (long)0xEA ,1);
md_number_to_disp(ptr+1,(long)offset,2);
@@ -1850,7 +1850,7 @@ fragS *frag;
symbolS *to_symbol;
{
long offset;
-
+
offset= to_addr - from_addr;
md_number_to_chars(ptr, (long)0xEA, 2);
md_number_to_disp(ptr+2,(long)offset,4);
@@ -1866,7 +1866,7 @@ char ***vecP;
switch (**argP) {
case 'm':
(*argP)++;
-
+
if (!strcmp(*argP,"32032")) {
cpureg = cpureg_032;
mmureg = mmureg_032;
@@ -1875,7 +1875,7 @@ char ***vecP;
mmureg = mmureg_532;
} else
as_warn("Unknown -m option ignored");
-
+
while (**argP)
(*argP)++;
break;
@@ -1912,9 +1912,9 @@ long max; /* Signextended max for bitfield */
long add; /* Add mask, used for huffman prefix */
{
register bit_fixS * bit_fixP;
-
+
bit_fixP = (bit_fixS *)obstack_alloc(&notes,sizeof(bit_fixS));
-
+
bit_fixP->fx_bit_size = size;
bit_fixP->fx_bit_offset = offset;
bit_fixP->fx_bit_base = base_type;
@@ -1922,7 +1922,7 @@ long add; /* Add mask, used for huffman prefix */
bit_fixP->fx_bit_max = max;
bit_fixP->fx_bit_min = min;
bit_fixP->fx_bit_add = add;
-
+
return(bit_fixP);
}
@@ -1969,7 +1969,7 @@ char *name;
return 0;
}
-/* Parse an operand that is machine-specific.
+/* Parse an operand that is machine-specific.
We just return without modifying the expression if we have nothing
to do. */
diff --git a/gnu/usr.bin/as/config/tc-ns32k.h b/gnu/usr.bin/as/config/tc-ns32k.h
index e66c21f..8f97304 100644
--- a/gnu/usr.bin/as/config/tc-ns32k.h
+++ b/gnu/usr.bin/as/config/tc-ns32k.h
@@ -1,18 +1,18 @@
/* tc-ns32k.h -- Opcode table for National Semi 32k processor
Copyright (C) 1987, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
diff --git a/gnu/usr.bin/as/config/tc-sparc.c b/gnu/usr.bin/as/config/tc-sparc.c
index c503ab0..238e5f7 100644
--- a/gnu/usr.bin/as/config/tc-sparc.c
+++ b/gnu/usr.bin/as/config/tc-sparc.c
@@ -1,24 +1,24 @@
/* tc-sparc.c -- Assemble for the SPARC
Copyright (C) 1989, 1990, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef lint
-static char rcsid[] = "$Id: tc-sparc.c,v 1.2 1993/12/12 17:02:13 jkh Exp $";
+static char rcsid[] = "$Id: tc-sparc.c,v 1.3 1994/12/23 22:37:40 nate Exp $";
#endif
#define cypress 1234
@@ -182,48 +182,48 @@ static void s_reserve() {
int size;
int temp;
symbolS *symbolP;
-
+
name = input_line_pointer;
c = get_symbol_end();
p = input_line_pointer;
*p = c;
SKIP_WHITESPACE();
-
+
if (*input_line_pointer != ',') {
as_bad("Expected comma after name");
ignore_rest_of_line();
return;
}
-
+
++input_line_pointer;
-
+
if ((size = get_absolute_expression()) < 0) {
as_bad("BSS length (%d.) <0! Ignored.", size);
ignore_rest_of_line();
return;
} /* bad length */
-
+
*p = 0;
symbolP = symbol_find_or_make(name);
*p = c;
-
+
if (strncmp(input_line_pointer, ",\"bss\"", 6) != 0) {
as_bad("bad .reserve segment: `%s'", input_line_pointer);
return;
} /* if not bss */
-
+
input_line_pointer += 6;
SKIP_WHITESPACE();
-
+
if (*input_line_pointer == ',') {
++input_line_pointer;
-
+
SKIP_WHITESPACE();
if (*input_line_pointer == '\n') {
as_bad("Missing alignment");
return;
}
-
+
align = get_absolute_expression();
if (align > max_alignment){
align = max_alignment;
@@ -238,23 +238,23 @@ static void s_reserve() {
#else
record_alignment(SEG_BSS, align);
#endif
-
+
/* convert to a power of 2 alignment */
for (temp = 0; (align & 1) == 0; align >>= 1, ++temp) ;;
-
+
if (align != 1) {
as_bad("Alignment not a power of 2");
ignore_rest_of_line();
return;
} /* not a power of two */
-
+
align = temp;
-
+
/* Align */
align = ~((~0) << align); /* Convert to a mask */
local_bss_counter = (local_bss_counter + align) & (~align);
} /* if has optional alignment */
-
+
if (S_GET_OTHER(symbolP) == 0
&& S_GET_DESC(symbolP) == 0
&& ((S_GET_SEGMENT(symbolP) == SEG_BSS
@@ -268,7 +268,7 @@ static void s_reserve() {
as_warn("Ignoring attempt to re-define symbol from %d. to %d.",
S_GET_VALUE(symbolP), local_bss_counter);
} /* if not redefining */
-
+
demand_empty_rest_of_line();
return;
} /* s_reserve() */
@@ -279,7 +279,7 @@ static void s_common() {
register char *p;
register int temp;
register symbolS * symbolP;
-
+
name = input_line_pointer;
c = get_symbol_end();
/* just after name is now '\0' */
@@ -332,7 +332,7 @@ static void s_common() {
} /* s_common() */
static void s_seg() {
-
+
if (strncmp(input_line_pointer, "\"text\"", 6) == 0) {
input_line_pointer += 6;
s_text();
@@ -369,7 +369,7 @@ static void s_data1() {
static void s_proc() {
extern char is_end_of_line[];
-
+
while (!is_end_of_line[*input_line_pointer]) {
++input_line_pointer;
}
@@ -390,18 +390,18 @@ s_empty()
demand_empty_rest_of_line();
return;
} /* s_empty() */
-
+
/* This function is called once, at assembler startup time. It should
set up all the tables, etc. that the MD part of the assembler will need. */
void md_begin() {
register char *retval = NULL;
int lose = 0;
register unsigned int i = 0;
-
+
op_hash = hash_new();
if (op_hash == NULL)
as_fatal("Virtual memory exhausted");
-
+
while (i < NUMOPCODES) {
const char *name = sparc_opcodes[i].name;
retval = hash_insert(op_hash, name, &sparc_opcodes[i]);
@@ -421,10 +421,10 @@ void md_begin() {
} while (i < NUMOPCODES
&& !strcmp(sparc_opcodes[i].name, name));
}
-
+
if (lose)
as_fatal("Broken assembler. No assembly attempted.");
-
+
for (i = '0'; i < '8'; ++i)
octal[i] = 1;
for (i = '0'; i <= '9'; ++i)
@@ -449,10 +449,10 @@ char *str;
{
char *toP;
int rsd;
-
+
know(str);
sparc_ip(str);
-
+
/* See if "set" operand is absolute and small; skip sethi if so. */
if (special_case == SPECIAL_CASE_SET && the_insn.exp.X_seg == SEG_ABSOLUTE) {
if (the_insn.exp.X_add_number >= -(1<<12)
@@ -464,11 +464,11 @@ char *str;
the_insn.reloc = NO_RELOC; /* No longer relocated */
}
}
-
+
toP = frag_more(4);
/* put out the opcode */
md_number_to_chars(toP, the_insn.opcode, 4);
-
+
/* put out the symbol-dependent stuff */
if (the_insn.reloc != NO_RELOC) {
fix_new(frag_now, /* which frag */
@@ -482,7 +482,7 @@ char *str;
the_insn.exp.X_got_symbol);
}
switch (special_case) {
-
+
case SPECIAL_CASE_SET:
special_case = 0;
know(the_insn.reloc == RELOC_HI22 ||
@@ -505,7 +505,7 @@ char *str;
the_insn.reloc==RELOC_BASE22?RELOC_BASE10:RELOC_LO10,
the_insn.exp.X_got_symbol);
return;
-
+
case SPECIAL_CASE_FDIV:
/* According to information leaked from Sun, the "fdiv" instructions
on early SPARC machines would produce incorrect results sometimes.
@@ -519,10 +519,10 @@ char *str;
the_insn.opcode = 0x81A00020 | (rsd << 25) | rsd; /* fmovs dest,dest */
md_number_to_chars(toP, the_insn.opcode, 4);
return;
-
+
case 0:
return;
-
+
default:
as_fatal("md_assemble: failed sanity check.");
}
@@ -541,23 +541,23 @@ char *str;
unsigned int mask = 0;
int match = 0;
int comma = 0;
-
+
for (s = str; islower(*s) || (*s >= '0' && *s <= '3'); ++s)
;
switch (*s) {
-
+
case '\0':
break;
-
+
case ',':
comma = 1;
-
+
/*FALLTHROUGH */
-
+
case ' ':
*s++ = '\0';
break;
-
+
default:
as_bad("Unknown opcode: `%s'", str);
exit(1);
@@ -574,49 +574,49 @@ char *str;
opcode = insn->match;
memset(&the_insn, '\0', sizeof(the_insn));
the_insn.reloc = NO_RELOC;
-
+
/*
* Build the opcode, checking as we go to make
* sure that the operands match
*/
for (args = insn->args; ; ++args) {
switch (*args) {
-
+
case 'M':
case 'm':
if (strncmp(s, "%asr", 4) == 0) {
s += 4;
-
+
if (isdigit(*s)) {
long num = 0;
-
+
while (isdigit(*s)) {
num = num*10 + *s-'0';
++s;
}
-
+
if (num < 16 || 31 < num) {
error_message = ": asr number must be between 15 and 31";
goto error;
} /* out of range */
-
+
opcode |= (*args == 'M' ? RS1(num) : RD(num));
continue;
} else {
error_message = ": expecting %asrN";
goto error;
} /* if %asr followed by a number. */
-
+
} /* if %asr */
break;
-
-
+
+
case '\0': /* end of args */
if (*s == '\0') {
match = 1;
}
break;
-
+
case '+':
if (*s == '+') {
++s;
@@ -626,7 +626,7 @@ char *str;
continue;
}
break;
-
+
case '[': /* these must match exactly */
case ']':
case ',':
@@ -634,7 +634,7 @@ char *str;
if (*s++ == *args)
continue;
break;
-
+
case '#': /* must be at least one digit */
if (isdigit(*s++)) {
while (isdigit(*s)) {
@@ -643,14 +643,14 @@ char *str;
continue;
}
break;
-
+
case 'C': /* coprocessor state register */
if (strncmp(s, "%csr", 4) == 0) {
s += 4;
continue;
}
break;
-
+
case 'b': /* next operand is a coprocessor register */
case 'c':
case 'D':
@@ -665,22 +665,22 @@ char *str;
mask -= '0';
}
switch (*args) {
-
+
case 'b':
opcode |= mask << 14;
continue;
-
+
case 'c':
opcode |= mask;
continue;
-
+
case 'D':
opcode |= mask << 25;
continue;
}
}
break;
-
+
case 'r': /* next operand must be a register */
case 's':
case '1':
@@ -689,49 +689,49 @@ char *str;
case 'x':
if (*s++ == '%') {
switch (c = *s++) {
-
+
case 'f': /* frame pointer */
if (*s++ == 'p') {
mask = 0x1e;
break;
}
goto error;
-
+
case 'g': /* global register */
if (isoctal(c = *s++)) {
mask = c - '0';
break;
}
goto error;
-
+
case 'i': /* in register */
if (isoctal(c = *s++)) {
mask = c - '0' + 24;
break;
}
goto error;
-
+
case 'l': /* local register */
if (isoctal(c = *s++)) {
mask= (c - '0' + 16) ;
break;
}
goto error;
-
+
case 'o': /* out register */
if (isoctal(c = *s++)) {
mask= (c - '0' + 8) ;
break;
}
goto error;
-
+
case 's': /* stack pointer */
if (*s++ == 'p') {
mask= 0xe;
break;
}
goto error;
-
+
case 'r': /* any register */
if (!isdigit(c = *s++)) {
goto error;
@@ -748,7 +748,7 @@ char *str;
}
mask= c;
break;
-
+
case 'x':
opcode |= (mask << 25) | mask;
continue;
@@ -761,19 +761,19 @@ char *str;
* it goes in the opcode.
*/
switch (*args) {
-
+
case '1':
opcode |= mask << 14;
continue;
-
+
case '2':
opcode |= mask;
continue;
-
+
case 'd':
opcode |= mask << 25;
continue;
-
+
case 'r':
opcode |= (mask << 25) | (mask << 14);
continue;
@@ -783,32 +783,32 @@ char *str;
}
}
break;
-
+
case 'e': /* next operand is a floating point register */
case 'v':
case 'V':
-
+
case 'f':
case 'B':
case 'R':
-
+
case 'g':
case 'H':
case 'J': {
char format;
-
+
if (*s++ == '%'
-
+
&& ((format = *s) == 'f')
-
+
&& isdigit(*++s)) {
-
-
-
+
+
+
for (mask = 0; isdigit(*s); ++s) {
mask = 10 * mask + (*s - '0');
} /* read the number */
-
+
if ((*args == 'u'
|| *args == 'v'
|| *args == 'B'
@@ -816,7 +816,7 @@ char *str;
&& (mask & 1)) {
break;
} /* register must be even numbered */
-
+
if ((*args == 'U'
|| *args == 'V'
|| *args == 'R'
@@ -824,7 +824,7 @@ char *str;
&& (mask & 3)) {
break;
} /* register must be multiple of 4 */
-
+
if (format == 'f') {
if (mask >= 32) {
error_message = ": There are only 32 f registers; [0-31]";
@@ -832,40 +832,40 @@ char *str;
} /* on error */
} /* if not an 'f' register. */
} /* on error */
-
+
switch (*args) {
-
+
case 'v':
case 'V':
case 'e':
opcode |= RS1(mask);
continue;
-
-
+
+
case 'f':
case 'B':
case 'R':
opcode |= RS2(mask);
continue;
-
+
case 'g':
case 'H':
case 'J':
opcode |= RD(mask);
continue;
} /* pack it in. */
-
+
know(0);
break;
} /* float arg */
-
+
case 'F':
if (strncmp(s, "%fsr", 4) == 0) {
s += 4;
continue;
}
break;
-
+
case 'h': /* high 22 bits */
/*
* In the case of a `set' pseudo instruction
@@ -876,12 +876,12 @@ char *str;
else
the_insn.reloc = RELOC_22;
goto immediate;
-
+
case 'l': /* 22 bit PC relative immediate */
the_insn.reloc = RELOC_WDISP22;
the_insn.pcrel = 1;
goto immediate;
-
+
case 'L': /* 30 bit immediate */
the_insn.reloc =
#ifdef PIC
@@ -890,16 +890,16 @@ char *str;
RELOC_WDISP30;
the_insn.pcrel = 1;
goto immediate;
-
+
case 'n': /* 22 bit immediate */
the_insn.reloc = RELOC_22;
goto immediate;
-
+
case 'i': /* 13 bit immediate */
the_insn.reloc = RELOC_13;
-
+
/*FALLTHROUGH */
-
+
immediate:
if (*s == ' ')
s++;
@@ -920,18 +920,18 @@ char *str;
will still have created U entries in the
symbol table for the 'symbols' in the input
string. Try not to create U symbols for
- registers, etc. */
+ registers, etc. */
{
/* This stuff checks to see if the
expression ends in +%reg If it does,
it removes the register from the
expression, and re-sets 's' to point
to the right place */
-
+
char *s1;
-
+
for (s1 = s; *s1 && *s1 != ',' && *s1 != ']'; s1++) ;;
-
+
if (s1 != s && isdigit(s1[-1])) {
if (s1[-2] == '%' && s1[-3] == '+') {
s1 -= 3;
@@ -990,51 +990,51 @@ char *str;
#endif
s = expr_end;
continue;
-
+
case 'a':
if (*s++ == 'a') {
opcode |= ANNUL;
continue;
}
break;
-
+
case 'A': {
char *push = input_line_pointer;
expressionS e;
-
+
input_line_pointer = s;
-
+
if (expression(&e) == SEG_ABSOLUTE) {
opcode |= e.X_add_number << 5;
s = input_line_pointer;
input_line_pointer = push;
continue;
} /* if absolute */
-
+
break;
} /* alternate space */
-
+
case 'p':
if (strncmp(s, "%psr", 4) == 0) {
s += 4;
continue;
}
break;
-
+
case 'q': /* floating point queue */
if (strncmp(s, "%fq", 3) == 0) {
s += 3;
continue;
}
break;
-
+
case 'Q': /* coprocessor queue */
if (strncmp(s, "%cq", 3) == 0) {
s += 3;
continue;
}
break;
-
+
case 'S':
if (strcmp(str, "set") == 0) {
special_case = SPECIAL_CASE_SET;
@@ -1044,25 +1044,25 @@ char *str;
continue;
}
break;
-
+
case 't':
if (strncmp(s, "%tbr", 4) != 0)
break;
s += 4;
continue;
-
+
case 'w':
if (strncmp(s, "%wim", 4) != 0)
break;
s += 4;
continue;
-
+
case 'y':
if (strncmp(s, "%y", 2) != 0)
break;
s += 2;
continue;
-
+
default:
as_fatal("sparc_ip: failed sanity check.");
} /* switch on arg code */
@@ -1083,14 +1083,14 @@ char *str;
} else {
if (insn->architecture > current_architecture) {
if (!architecture_requested || warn_on_bump) {
-
+
if (warn_on_bump) {
as_warn("architecture bumped from \"%s\" to \"%s\" on \"%s\"",
architecture_pname[current_architecture],
architecture_pname[insn->architecture],
str);
} /* if warning */
-
+
current_architecture = insn->architecture;
} else {
as_bad("architecture mismatch on \"%s\" (\"%s\"). current architecture is \"%s\"",
@@ -1101,10 +1101,10 @@ char *str;
} /* if bump ok else error */
} /* if architecture higher */
} /* if no match */
-
+
break;
} /* forever looking for a match */
-
+
the_insn.opcode = opcode;
#if DEBUG_SPARC
if (flagseen['D'])
@@ -1118,11 +1118,11 @@ char *str;
{
char *save_in;
segT seg;
-
+
save_in = input_line_pointer;
input_line_pointer = str;
switch (seg = expression(&the_insn.exp)) {
-
+
case SEG_ABSOLUTE:
case SEG_TEXT:
case SEG_DATA:
@@ -1132,7 +1132,7 @@ char *str;
case SEG_BIG:
case SEG_ABSENT:
break;
-
+
default:
the_insn.error = "bad segment";
expr_end = input_line_pointer;
@@ -1149,7 +1149,7 @@ char *str;
/*
This is identical to the md_atof in m68k.c. I think this is right,
but I'm not sure.
-
+
Turn a string in input_line_pointer into a floating point constant of type
type, and store the appropriate bytes in *litP. The number of LITTLENUMS
emitted is stored in *sizeP. An error message is returned, or NULL on OK.
@@ -1168,33 +1168,33 @@ int *sizeP;
LITTLENUM_TYPE *wordP;
char *t;
char *atof_ieee();
-
+
switch (type) {
-
+
case 'f':
case 'F':
case 's':
case 'S':
prec = 2;
break;
-
+
case 'd':
case 'D':
case 'r':
case 'R':
prec = 4;
break;
-
+
case 'x':
case 'X':
prec = 6;
break;
-
+
case 'p':
case 'P':
prec = 6;
break;
-
+
default:
*sizeP=0;
return "Bad call to MD_ATOF()";
@@ -1218,9 +1218,9 @@ char *buf;
long val;
int n;
{
-
+
switch (n) {
-
+
case 4:
*buf++ = val >> 24;
*buf++ = val >> 16;
@@ -1229,7 +1229,7 @@ int n;
case 1:
*buf = val;
break;
-
+
default:
as_fatal("md_number_to_chars: failed sanity check.");
}
@@ -1292,9 +1292,9 @@ long val;
assert(fixP->fx_size == 4);
assert(fixP->fx_r_type < NO_RELOC);
-
+
fixP->fx_addnumber = val; /* Remember value for emit_reloc */
-
+
/*
* This is a hack. There should be a better way to
* handle this.
@@ -1302,7 +1302,7 @@ long val;
if (fixP->fx_r_type == RELOC_WDISP30 && fixP->fx_addsy) {
val += fixP->fx_where + fixP->fx_frag->fr_address;
}
-
+
switch (fixP->fx_r_type) {
/* Michael Bloom <mb@ttidca.tti.com> says... [This] change was
@@ -1330,7 +1330,7 @@ long val;
buf[3] = 0;
}
break;
-
+
case RELOC_JMP_TBL:
if (!fixP->fx_addsy) {
val = (val >>= 2) + 1;
@@ -1346,13 +1346,13 @@ long val;
case RELOC_WDISP30:
val = (val >>= 2) + 1;
reloc_check(val, 30, fixP);
-
+
buf[0] |= (val >> 24) & 0x3f;
buf[1]= (val >> 16);
buf[2] = val >> 8;
buf[3] = val;
break;
-
+
case RELOC_WDISP22:
val = (val >>= 2) + 1;
reloc_check(val, 22, fixP);
@@ -1439,7 +1439,7 @@ long val;
case RELOC_JMP_SLOT:
case RELOC_RELATIVE:
#endif
-
+
case NO_RELOC:
default:
as_bad("bad relocation type: 0x%02x", fixP->fx_r_type);
@@ -1459,7 +1459,7 @@ symbolS *to_symbol;
} /* md_create_short_jump() */
/* Translate internal representation of relocation info to target format.
-
+
On sparc: first 4 bytes are normal unsigned long address, next three
bytes are index, most sig. byte first. Byte 7 is broken up with
bit 7 as external, bits 6 & 5 unused, and the lower
@@ -1477,9 +1477,9 @@ relax_addressT segment_address_in_file;
#ifdef PIC
int kflag = 0;
#endif
-
+
know(fixP->fx_addsy);
-
+
if (!S_IS_DEFINED(fixP->fx_addsy)) {
r_extern = 1;
r_index = fixP->fx_addsy->sy_number;
@@ -1511,23 +1511,23 @@ relax_addressT segment_address_in_file;
}
#endif
}
-
+
/* this is easy */
md_number_to_chars(where,
r_address = fixP->fx_frag->fr_address + fixP->fx_where - segment_address_in_file,
4);
-
+
/* now the fun stuff */
where[4] = (r_index >> 16) & 0x0ff;
where[5] = (r_index >> 8) & 0x0ff;
where[6] = r_index & 0x0ff;
where[7] = ((r_extern << 7) & 0x80) | (0 & 0x60) | (fixP->fx_r_type & 0x1F);
-
+
/* Also easy */
if (fixP->fx_addsy->sy_frag) {
r_addend = fixP->fx_addsy->sy_frag->fr_address;
}
-
+
if (fixP->fx_pcrel) {
#ifdef PIC
if (fixP->fx_gotsy) {
@@ -1544,9 +1544,9 @@ relax_addressT segment_address_in_file;
#endif
r_addend = fixP->fx_addnumber;
}
-
+
md_number_to_chars(&where[8], r_addend, 4);
-
+
return;
} /* tc_aout_fix_to_chars() */
@@ -1582,7 +1582,7 @@ segT segtype;
static void print_insn(insn)
struct sparc_it *insn;
{
-
+
if (insn->error) {
fprintf(stderr, "ERROR: %s\n", insn->error);
}
@@ -1634,14 +1634,14 @@ relax_addressT segment_address_in_file;
register symbolS *symbolP;
extern char *next_object_file_charP;
/* long add_number; */
-
+
memset((char *) &ri, '\0', sizeof(ri));
for (; fixP; fixP = fixP->fx_next) {
-
+
if (fixP->fx_r_type >= NO_RELOC) {
as_fatal("fixP->fx_r_type = %d\n", fixP->fx_r_type);
}
-
+
if ((symbolP = fixP->fx_addsy) != NULL) {
ri.r_address = fixP->fx_frag->fr_address +
fixP->fx_where - segment_address_in_file;
@@ -1662,7 +1662,7 @@ relax_addressT segment_address_in_file;
} else {
ri.r_addend = fixP->fx_addnumber;
}
-
+
md_ri_to_chars(next_object_file_charP, &ri);
next_object_file_charP += md_reloc_size;
}
@@ -1692,7 +1692,7 @@ relax_addressT segment_address_in_file;
*
* If an architecture is specified, all instructions must match
* that architecture. Any higher level instructions are flagged
- * as errors.
+ * as errors.
*
* if both an architecture and -bump are specified, the
* architecture starts at the specified level, but bumps are
@@ -1706,19 +1706,19 @@ char ***vecP;
{
char *p;
const char **arch;
-
+
if (!strcmp(*argP,"bump")){
warn_on_bump = 1;
-
+
} else if (**argP == 'A'){
p = (*argP) + 1;
-
+
for (arch = architecture_pname; *arch != NULL; ++arch){
if (strcmp(p, *arch) == 0){
break;
} /* found a match */
} /* walk the pname table */
-
+
if (*arch == NULL){
as_bad("unknown architecture: %s", p);
} else {
diff --git a/gnu/usr.bin/as/config/tc-sparc.h b/gnu/usr.bin/as/config/tc-sparc.h
index f21baf1..c6dfa31 100644
--- a/gnu/usr.bin/as/config/tc-sparc.h
+++ b/gnu/usr.bin/as/config/tc-sparc.h
@@ -1,24 +1,24 @@
/* tc-sparc.h - Macros and type defines for the sparc.
Copyright (C) 1989, 1990, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
/*
- * $Id: tc-sparc.h,v 1.1 1993/11/03 00:54:54 paul Exp $
+ * $Id: tc-sparc.h,v 1.2 1994/12/23 22:37:41 nate Exp $
*/
#define TC_SPARC 1
diff --git a/gnu/usr.bin/as/config/tc-tahoe.c b/gnu/usr.bin/as/config/tc-tahoe.c
index 68dc5b9..4cd1a82 100644
--- a/gnu/usr.bin/as/config/tc-tahoe.c
+++ b/gnu/usr.bin/as/config/tc-tahoe.c
@@ -162,7 +162,7 @@ States for Tahoe address relaxing.
Always, 1 byte opcode, then displacement/absolute.
If word or longword, change opcode to brw or jmp.
-
+
2. TAHOE_WIDTH_CONDITIONAL_JUMP (?)
J<cond> where <cond> is a simple flag test.
Format: "b?"
@@ -355,7 +355,7 @@ md_begin()
struct tot *tP;
char *errorval = "";
int synthetic_too = 1; /* If 0, just use real opcodes. */
-
+
if ((op_hash = hash_new())){
for (tP= totstrs; *tP->name && !*errorval; tP++){
errorval = hash_insert (op_hash, tP->name, &tP->detail);
@@ -389,7 +389,7 @@ md_parse_option (argP, cntP, vecP)
switch (**argP){
case 'a':
as_warn("The -a option doesn't exits. (Dispite what the man page says!");
-
+
case 'J':
as_warn("JUMPIFY (-J) not implemented, use psuedo ops instead.");
break;
@@ -517,7 +517,7 @@ md_ri_to_chars (ri_p, ri)
/* This is easy */
md_number_to_chars (the_bytes, ri.r_address, sizeof(ri.r_address));
-
+
/* now the fun stuff */
the_bytes[4] = (ri.r_symbolnum >> 16) & 0x0ff;
the_bytes[5] = (ri.r_symbolnum >> 8) & 0x0ff;
@@ -546,20 +546,20 @@ relax_addressT segment_address_in_file;
* In: length of relocation (or of address) in chars: 1, 2 or 4.
* Out: GNU LD relocation length code: 0, 1, or 2.
*/
-
+
static unsigned char nbytes_r_length[] = { 42, 0, 1, 42, 2 };
long r_symbolnum;
-
+
know(fixP->fx_addsy != NULL);
-
+
md_number_to_chars(where,
fixP->fx_frag->fr_address + fixP->fx_where - segment_address_in_file,
4);
-
+
r_symbolnum = (S_IS_DEFINED(fixP->fx_addsy)
? S_GET_TYPE(fixP->fx_addsy)
: fixP->fx_addsy->sy_number);
-
+
where[4] = (r_symbolnum >> 16) & 0x0ff;
where[5] = (r_symbolnum >> 8) & 0x0ff;
where[6] = r_symbolnum & 0x0ff;
@@ -741,7 +741,7 @@ object_headers *headers;
register char *addressP; /* -> _var to change. */
register char *opcodeP; /* -> opcode char(s) to change. */
register short int length_code; /* 2=long 1=word 0=byte */
- register short int extension = 0; /* Size of relaxed address.
+ register short int extension = 0; /* Size of relaxed address.
Added to fr_fix: incl. ALL var chars. */
register symbolS *symbolP;
register long int where;
@@ -788,7 +788,7 @@ object_headers *headers;
*addressP = target_address - (address_of_var + 1);
extension = 1;
break;
-
+
case ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, STATE_WORD):
*opcodeP ^= 0x10; /* Reverse sense of test. */
*addressP++ = 3; /* Jump over word branch */
@@ -796,7 +796,7 @@ object_headers *headers;
md_number_to_chars (addressP, target_address - (address_of_var + 4), 2);
extension = 4;
break;
-
+
case ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, STATE_LONG):
*opcodeP ^= 0x10; /* Reverse sense of test. */
*addressP++ = 6;
@@ -810,13 +810,13 @@ object_headers *headers;
*addressP = target_address - (address_of_var + 1);
extension = 1;
break;
-
+
case ENCODE_RELAX (STATE_ALWAYS_BRANCH, STATE_WORD):
*opcodeP = TAHOE_BRW;
md_number_to_chars (addressP, target_address - (address_of_var + 2), 2);
extension = 2;
break;
-
+
case ENCODE_RELAX (STATE_ALWAYS_BRANCH, STATE_LONG):
*opcodeP = TAHOE_JMP;
*addressP++ = TAHOE_PC_REL_LONG;
@@ -828,7 +828,7 @@ object_headers *headers;
md_number_to_chars (addressP, target_address - (address_of_var + 2), 2);
extension = 2;
break;
-
+
case ENCODE_RELAX (STATE_BIG_REV_BRANCH, STATE_LONG):
*opcodeP ^= 0x10;
*addressP++ = 0;
@@ -843,7 +843,7 @@ object_headers *headers;
md_number_to_chars (addressP, target_address - (address_of_var + 2), 2);
extension = 2;
break;
-
+
case ENCODE_RELAX (STATE_BIG_NON_REV_BRANCH, STATE_LONG):
*addressP++ = 0;
*addressP++ = 2;
@@ -1034,7 +1034,7 @@ tip_op (optex,topP)
com_width = (width == 'b' ? 1 :
(width == 'w' ? 2 :
(width == 'l' ? 4 : 0)));
-
+
*optex = '\0'; /* This is kind of a back stop for all
the searches to fail on if needed.*/
if (*point == '*') { /* A dereference? */
@@ -1052,7 +1052,7 @@ tip_op (optex,topP)
* The default is 'w' as an offset, so that's what I use.
* Stick with `, it does the same, and isn't ambig.
*/
-
+
if (*point != '\0' && ((point[1] == '^') || (point[1] == '`')))
switch(*point){
case 'b':
@@ -1088,18 +1088,18 @@ tip_op (optex,topP)
if(end != point) /* Null string? */
end--;
-
+
if (end > point && *end == ' ' && end[-1] != '\'')
end--; /* Hop white space */
-
+
/* Is this an index reg. */
if ((*end == ']') && (end[-1] != '\'')){
temp = end;
-
+
/* Find opening brace. */
for(--end;(*end != '[' && end != point);end--)
;
-
+
/* If I found the opening brace, get the index register number. */
if (*end == '['){
tp = end + 1; /* tp should point to the start of a reg. */
@@ -1129,11 +1129,11 @@ tip_op (optex,topP)
/* register in parens? */
if ((*end == ')') && (end[-1] != '\'')){
temp = end;
-
+
/* Find opening paren. */
for(--end;(*end != '(' && end != point);end--)
;
-
+
/* If I found the opening paren, get the register number. */
if (*end == '('){
tp = end + 1;
@@ -1150,7 +1150,7 @@ tip_op (optex,topP)
end = point; /* Force all the rest of the tests to fail. */
}
}
-
+
/* Pre decrement? */
if (*end == '-'){
if (dec_inc != ' '){
@@ -1167,7 +1167,7 @@ tip_op (optex,topP)
* Everything between point and end is the 'expression', unless it's
* a register name.
*/
-
+
c = end[1];
end[1] = '\0';
@@ -1179,7 +1179,7 @@ tip_op (optex,topP)
point = tp;
imreg = -1;
}
-
+
if (imreg != -1 && reg != -1)
op_bad = "I parsed 2 registers in this operand.";
@@ -1257,7 +1257,7 @@ tip_op (optex,topP)
}
end[1] = c;
-
+
/* I'm done, so restore optex */
*optex = segfault;
@@ -1304,15 +1304,15 @@ tip_op (optex,topP)
op_bad = "For quad access, the register must be even and < 14.";
else if (call_width)
op_bad = "You can't cast a direct register.";
-
+
if (*op_bad == '\0'){
/* No errors, check for warnings */
if (width == 'q' && imreg == 12)
as_warn("Using reg 14 for quadwords can tromp the FP register.");
-
+
reg = imreg;
}
-
+
/* We know: imm = -1 */
}else if (dec_inc == '-'){
/* -(SP) */
@@ -1401,7 +1401,7 @@ tip_op (optex,topP)
}
}
}
-
+
/*
* At this point, all the errors we can do have be checked for.
* We can build the 'top'. */
@@ -1563,7 +1563,7 @@ md_assemble (instruction_string)
/* Decode the operand. */
tip(&t, instruction_string);
-
+
/*
* Check to see if this operand decode properly.
* Notice that we haven't made any frags yet.
@@ -1589,7 +1589,7 @@ md_assemble (instruction_string)
Legality of indexed mode already checked: it is OK */
FRAG_APPEND_1_CHAR(0x40 + operandP->top_ndx);
} /* if(top_ndx>=0) */
-
+
/* Here to make main operand frag(s). */
this_add_number = expP->X_add_number;
this_add_symbol = expP->X_add_symbol;
@@ -1663,12 +1663,12 @@ md_assemble (instruction_string)
/* to_seg != now_seg && to_seg != seg_unknown (still in branch)
In other words, I'm jumping out of my segment so extend the
branches to jumps, and let GAS fix them. */
-
+
/* These are "branches" what will always be branches around a jump
to the correct addresss in real life.
If to_seg is SEG_ABSOLUTE, just encode the branch in,
else let GAS fix the address. */
-
+
switch (operandP->top_width){
/* The theory:
For SEG_ABSOLUTE, then mode is ABSOLUTE_ADDR, jump
@@ -1764,14 +1764,14 @@ md_assemble (instruction_string)
case TAHOE_AUTO_INC_DEFERRED:
FRAG_APPEND_1_CHAR(operandP->top_mode);
break;
-
+
/* Numbered Register only access. Only thing needed is the
mode + Register number */
case TAHOE_DIRECT_REG:
case TAHOE_REG_DEFERRED:
FRAG_APPEND_1_CHAR(operandP->top_mode + operandP->top_reg);
break;
-
+
/* An absolute address. It's size is always 5 bytes.
(mode_type + 4 byte address). */
case TAHOE_ABSOLUTE_ADDR:
@@ -1780,7 +1780,7 @@ md_assemble (instruction_string)
*p = TAHOE_ABSOLUTE_ADDR;
md_number_to_chars(p+1,this_add_number,4);
break;
-
+
/* Immediate data. If the size isn't known, then it's an address
+ and offset, which is 4 bytes big. */
case TAHOE_IMMEDIATE:
@@ -1814,7 +1814,7 @@ md_assemble (instruction_string)
}
}
break;
-
+
/* Distance from the PC. If the size isn't known, we have to relax
into it. The difference between this and disp(sp) is that
this offset is pc_rel, and disp(sp) isn't.
@@ -1824,7 +1824,7 @@ md_assemble (instruction_string)
case TAHOE_DISP_REL_DEFERRED:
operandP->top_reg = PC_REG;
pc_rel = 1;
-
+
/* Register, plus a displacement mode. Save the register number,
and weather its deffered or not, and relax the size if it isn't
known. */
@@ -1844,7 +1844,7 @@ md_assemble (instruction_string)
if ((dispsize == 0 && !pc_rel) ||
(to_seg != now_seg && !is_undefined && to_seg != SEG_ABSOLUTE))
dispsize = 4;
-
+
if (dispsize == 0){
/*
* We have a SEG_UNKNOWN symbol, or the size isn't cast.
diff --git a/gnu/usr.bin/as/config/tc-tahoe.h b/gnu/usr.bin/as/config/tc-tahoe.h
index e63cb63..4593a76 100644
--- a/gnu/usr.bin/as/config/tc-tahoe.h
+++ b/gnu/usr.bin/as/config/tc-tahoe.h
@@ -1,19 +1,19 @@
/* This file is tc-tahoe.h
Copyright (C) 1987-1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
diff --git a/gnu/usr.bin/as/config/tc-vax.c b/gnu/usr.bin/as/config/tc-vax.c
index 9133c84..2b1970a 100644
--- a/gnu/usr.bin/as/config/tc-vax.c
+++ b/gnu/usr.bin/as/config/tc-vax.c
@@ -1,18 +1,18 @@
/* tc-vax.c - vax-specific -
Copyright (C) 1987, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -77,12 +77,12 @@ FLONUM_TYPE float_operand[VIT_MAX_OPERANDS];
* The "how long" refers merely to the displacement length.
* The address usually has some constant bytes in it as well.
*
-
+
groups for VAX address relaxing.
-
+
1. "foo" pc-relative.
length of byte, word, long
-
+
2a. J<cond> where <cond> is a simple flag test.
length of byte, word, long.
VAX opcodes are: (Hex)
@@ -100,7 +100,7 @@ FLONUM_TYPE float_operand[VIT_MAX_OPERANDS];
blssu/bcs 1f
Always, you complement 0th bit to reverse condition.
Always, 1-byte opcode, then 1-byte displacement.
-
+
2b. J<cond> where cond tests a memory bit.
length of byte, word, long.
Vax opcodes are: (Hex)
@@ -114,7 +114,7 @@ FLONUM_TYPE float_operand[VIT_MAX_OPERANDS];
bbcci e7
Always, you complement 0th bit to reverse condition.
Always, 1-byte opcde, longword-address, byte-address, 1-byte-displacement
-
+
2c. J<cond> where cond tests low-order memory bit
length of byte,word,long.
Vax opcodes are: (Hex)
@@ -122,7 +122,7 @@ FLONUM_TYPE float_operand[VIT_MAX_OPERANDS];
blbc e9
Always, you complement 0th bit to reverse condition.
Always, 1-byte opcode, longword-address, 1-byte displacement.
-
+
3. Jbs/Jbr.
length of byte,word,long.
Vax opcodes are: (Hex)
@@ -130,7 +130,7 @@ FLONUM_TYPE float_operand[VIT_MAX_OPERANDS];
brb 11
These are like (2) but there is no condition to reverse.
Always, 1 byte opcode, then displacement/absolute.
-
+
4a. JacbX
length of word, long.
Vax opcodes are: (Hex)
@@ -146,7 +146,7 @@ FLONUM_TYPE float_operand[VIT_MAX_OPERANDS];
The double-byte op-codes don't hurt: we never want to modify the
opcode, so we don't care how many bytes are between the opcode and
the operand.
-
+
4b. JXobXXX
length of long, long, byte.
Vax opcodes are: (Hex)
@@ -156,14 +156,14 @@ FLONUM_TYPE float_operand[VIT_MAX_OPERANDS];
sobgtr f5
Always, we cannot reverse the sense of the branch; we have a byte
displacement.
-
+
The only time we need to modify the opcode is for class 2 instructions.
After relax() we may complement the lowest order bit of such instruction
to reverse sense of branch.
-
+
For class 2 instructions, we store context of "where is the opcode literal".
We can change an opcode's lowest order bit without breaking anything else.
-
+
We sometimes store context in the operand literal. This way we can figure out
after relax() what the original addressing mode was.
*/
@@ -263,11 +263,11 @@ void
char *errtxt;
FLONUM_TYPE *fP;
int i;
-
+
if (*(errtxt = vip_begin (1, "$", "*", "`"))) {
as_fatal("VIP_BEGIN error:%s", errtxt);
}
-
+
for (i = 0, fP = float_operand;
fP < float_operand + VIT_MAX_OPERANDS;
i++, fP++) {
@@ -290,7 +290,7 @@ int nbytes; /* Number of bytes in the output. */
{
int n;
long v;
-
+
n = nbytes;
v = value;
while (nbytes--) {
@@ -312,7 +312,7 @@ long value; /* The value of the bits. */
{
char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;
int nbytes; /* Number of bytes in the output. */
-
+
nbytes = fixP->fx_size;
while (nbytes--) {
*buf++ = value; /* Lint wants & MASK_CHAR. */
@@ -343,7 +343,7 @@ char *instruction_string; /* A string: assemble 1 instruction. */
int is_undefined; /* 1 if operand expression's */
/* segment not known yet. */
int length_code;
-
+
char *p;
register struct vop *operandP;/* An operand. Scans all operands. */
char *save_input_line_pointer;
@@ -354,13 +354,13 @@ char *instruction_string; /* A string: assemble 1 instruction. */
register struct vop *end_operandP; /* -> slot just after last operand */
/* Limit of the for (each operand). */
register expressionS *expP; /* -> expression values for this operand */
-
+
/* These refer to an instruction operand expression. */
segT to_seg; /* Target segment of the address. */
register valueT this_add_number;
register struct symbol *this_add_symbol; /* +ve (minuend) symbol. */
register struct symbol *this_subtract_symbol; /* -ve(subtrahend) symbol. */
-
+
long opcode_as_number; /* As a number. */
char *opcode_as_chars; /* Least significant byte 1st. */
/* As an array of characters. */
@@ -374,7 +374,7 @@ char *instruction_string; /* A string: assemble 1 instruction. */
char *vip ();
LITTLENUM_TYPE literal_float[8];
/* Big enough for any floating point literal. */
-
+
if (*(p = vip (&v, instruction_string))) {
as_fatal("vax_assemble\"%s\" in=\"%s\"", p, instruction_string);
}
@@ -397,16 +397,16 @@ char *instruction_string; /* A string: assemble 1 instruction. */
expP = exp_of_operand,
floatP = float_operand,
end_operandP = v.vit_operand + v.vit_operands;
-
+
operandP < end_operandP;
-
+
operandP++, expP++, floatP++) { /* for each operand */
if (*(operandP->vop_error)) {
as_warn ("Ignoring statement because \"%s\"", (operandP->vop_error));
goofed = 1;
} else { /* statement has no syntax goofs: lets sniff the expression */
int can_be_short = 0; /* 1 if a bignum can be reduced to a short literal. */
-
+
input_line_pointer = operandP->vop_expr_begin;
c_save = operandP->vop_expr_end[1];
operandP->vop_expr_end[1] = '\0';
@@ -428,7 +428,7 @@ char *instruction_string; /* A string: assemble 1 instruction. */
case SEG_ABSOLUTE:
case SEG_UNKNOWN:
break;
-
+
case SEG_DIFFERENCE:
case SEG_PASS1:
/*
@@ -447,7 +447,7 @@ char *instruction_string; /* A string: assemble 1 instruction. */
need_pass_2 = 1;
as_warn("Can't relocate expression");
break;
-
+
case SEG_BIG:
/* Preserve the bits. */
if (expP->X_add_number > 0) {
@@ -465,7 +465,7 @@ char *instruction_string; /* A string: assemble 1 instruction. */
(literal_float[0] & 0xFC0F) == 0x4000
&& literal_float[1] == 0;
break;
-
+
case 'd':
can_be_short =
(literal_float[0] & 0xFC0F) == 0x4000
@@ -473,7 +473,7 @@ char *instruction_string; /* A string: assemble 1 instruction. */
&& literal_float[2] == 0
&& literal_float[3] == 0;
break;
-
+
case 'g':
can_be_short =
(literal_float[0] & 0xFF81) == 0x4000
@@ -481,7 +481,7 @@ char *instruction_string; /* A string: assemble 1 instruction. */
&& literal_float[2] == 0
&& literal_float[3] == 0;
break;
-
+
case 'h':
can_be_short = ((literal_float[0] & 0xFFF8) == 0x4000
&& (literal_float[1] & 0xE000) == 0
@@ -492,14 +492,14 @@ char *instruction_string; /* A string: assemble 1 instruction. */
&& literal_float[6] == 0
&& literal_float[7] == 0);
break;
-
+
default:
BAD_CASE(-expP->X_add_number);
break;
} /* switch (float type) */
} /* if (could want to become S^#...) */
} /* bignum or flonum ? */
-
+
if (operandP->vop_short == 's'
|| operandP->vop_short == 'i'
|| (operandP->vop_short == ' '
@@ -543,27 +543,27 @@ char *instruction_string; /* A string: assemble 1 instruction. */
operandP->vop_reg = 0xF; /* VAX PC. */
} else { /* Encode short literal now. */
int temp = 0;
-
+
switch (-expP->X_add_number) {
case 'f':
case 'd':
temp = literal_float[0] >> 4;
break;
-
+
case 'g':
temp = literal_float[0] >> 1;
break;
-
+
case 'h':
temp = ((literal_float[0] << 3) & 070)
| ((literal_float[1] >> 13) & 07);
break;
-
+
default:
BAD_CASE(-expP->X_add_number);
break;
}
-
+
floatP->low[0] = temp & 077;
floatP->low[1] = 0;
} /* if can be short literal float */
@@ -592,7 +592,7 @@ char *instruction_string; /* A string: assemble 1 instruction. */
* 32 bits of the number to X_add_number.
*/
break;
-
+
default:
BAD_CASE (to_seg);
break;
@@ -604,14 +604,14 @@ char *instruction_string; /* A string: assemble 1 instruction. */
operandP->vop_expr_end[1] = c_save;
}
} /* for (each operand) */
-
+
input_line_pointer = save_input_line_pointer;
-
+
if (need_pass_2 || goofed) {
return;
}
-
+
/* Emit op-code. */
/* Remember where it is, in case we want to modify the op-code later. */
opcode_low_byteP = frag_more (v.vit_opcode_nbytes);
@@ -621,9 +621,9 @@ char *instruction_string; /* A string: assemble 1 instruction. */
expP = exp_of_operand,
floatP = float_operand,
end_operandP = v.vit_operand + v.vit_operands;
-
+
operandP < end_operandP;
-
+
operandP++,
floatP++,
expP++) { /* for each operand */
@@ -632,7 +632,7 @@ char *instruction_string; /* A string: assemble 1 instruction. */
/* Legality of indexed mode already checked: it is OK */
FRAG_APPEND_1_CHAR (0x40 + operandP->vop_ndx);
} /* if (vop_ndx >= 0) */
-
+
/* Here to make main operand frag(s). */
this_add_number = expP->X_add_number;
this_add_symbol = expP->X_add_symbol;
@@ -973,7 +973,7 @@ char *instruction_string; /* A string: assemble 1 instruction. */
* We stored our constant as LITTLENUMs, not bytes.
*/
LITTLENUM_TYPE *lP;
-
+
lP = floatP->low;
if (nbytes & 1) {
know(nbytes == 1);
@@ -997,12 +997,12 @@ char *instruction_string; /* A string: assemble 1 instruction. */
if (length == 0) {
if (to_seg == SEG_ABSOLUTE) {
register long test;
-
+
test = this_add_number;
-
+
if (test < 0)
test = ~test;
-
+
length = test & 0xffff8000 ? 4
: test & 0xffffff80 ? 2
: 1;
@@ -1047,7 +1047,7 @@ register segT segment;
{
register char *p;
register int old_fr_fix;
-
+
old_fr_fix = fragP->fr_fix;
switch (fragP->fr_subtype) {
case ENCODE_RELAX (STATE_PC_RELATIVE, STATE_UNDF):
@@ -1062,7 +1062,7 @@ register segT segment;
frag_wane(fragP);
}
break;
-
+
case ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, STATE_UNDF):
if (S_GET_SEGMENT(fragP->fr_symbol) == segment) {
fragP->fr_subtype = ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, STATE_BYTE);
@@ -1078,7 +1078,7 @@ register segT segment;
frag_wane(fragP);
}
break;
-
+
case ENCODE_RELAX (STATE_COMPLEX_BRANCH, STATE_UNDF):
if (S_GET_SEGMENT(fragP->fr_symbol) == segment) {
fragP->fr_subtype = ENCODE_RELAX (STATE_COMPLEX_BRANCH, STATE_WORD);
@@ -1096,7 +1096,7 @@ register segT segment;
frag_wane(fragP);
}
break;
-
+
case ENCODE_RELAX (STATE_COMPLEX_HOP, STATE_UNDF):
if (S_GET_SEGMENT(fragP->fr_symbol) == segment) {
fragP->fr_subtype = ENCODE_RELAX (STATE_COMPLEX_HOP, STATE_BYTE);
@@ -1113,7 +1113,7 @@ register segT segment;
frag_wane(fragP);
}
break;
-
+
case ENCODE_RELAX (STATE_ALWAYS_BRANCH, STATE_UNDF):
if (S_GET_SEGMENT(fragP->fr_symbol) == segment) {
fragP->fr_subtype = ENCODE_RELAX (STATE_ALWAYS_BRANCH, STATE_BYTE);
@@ -1127,7 +1127,7 @@ register segT segment;
frag_wane(fragP);
}
break;
-
+
default:
break;
}
@@ -1161,7 +1161,7 @@ register fragS *fragP;
/* Where, in file space, is _var of *fragP? */
long target_address = 0;
/* Where, in file space, does addr point? */
-
+
know(fragP->fr_type == rs_machine_dependent);
length_code = fragP->fr_subtype & 3; /* depends on ENCODE_RELAX() */
know(length_code >= 0 && length_code < 3);
@@ -1174,33 +1174,33 @@ register fragS *fragP;
address_of_var = fragP->fr_address + where;
switch (fragP->fr_subtype) {
-
+
case ENCODE_RELAX(STATE_PC_RELATIVE, STATE_BYTE):
know(*addressP == 0 || *addressP == 0x10); /* '@' bit. */
addressP[0] |= 0xAF; /* Byte displacement. */
addressP[1] = target_address - (address_of_var + 2);
extension = 2;
break;
-
+
case ENCODE_RELAX(STATE_PC_RELATIVE, STATE_WORD):
know(*addressP == 0 || *addressP == 0x10); /* '@' bit. */
addressP[0] |= 0xCF; /* Word displacement. */
md_number_to_chars(addressP + 1, target_address - (address_of_var + 3), 2);
extension = 3;
break;
-
+
case ENCODE_RELAX(STATE_PC_RELATIVE, STATE_LONG):
know(*addressP == 0 || *addressP == 0x10); /* '@' bit. */
addressP[0] |= 0xEF; /* Long word displacement. */
md_number_to_chars(addressP + 1, target_address - (address_of_var + 5), 4);
extension = 5;
break;
-
+
case ENCODE_RELAX(STATE_CONDITIONAL_BRANCH, STATE_BYTE):
addressP[0] = target_address - (address_of_var + 1);
extension = 1;
break;
-
+
case ENCODE_RELAX(STATE_CONDITIONAL_BRANCH, STATE_WORD):
opcodeP[0] ^= 1; /* Reverse sense of test. */
addressP[0] = 3;
@@ -1208,7 +1208,7 @@ register fragS *fragP;
md_number_to_chars(addressP + 2, target_address - (address_of_var + 4), 2);
extension = 4;
break;
-
+
case ENCODE_RELAX(STATE_CONDITIONAL_BRANCH, STATE_LONG):
opcodeP[0] ^= 1; /* Reverse sense of test. */
addressP[0] = 6;
@@ -1217,30 +1217,30 @@ register fragS *fragP;
md_number_to_chars(addressP + 3, target_address, 4);
extension = 7;
break;
-
+
case ENCODE_RELAX(STATE_ALWAYS_BRANCH, STATE_BYTE):
addressP[0] = target_address - (address_of_var + 1);
extension = 1;
break;
-
+
case ENCODE_RELAX(STATE_ALWAYS_BRANCH, STATE_WORD):
opcodeP[0] += VAX_WIDEN_WORD; /* brb -> brw, bsbb -> bsbw */
md_number_to_chars(addressP, target_address - (address_of_var + 2), 2);
extension = 2;
break;
-
+
case ENCODE_RELAX(STATE_ALWAYS_BRANCH, STATE_LONG):
opcodeP[0] += VAX_WIDEN_LONG; /* brb -> jmp, bsbb -> jsb */
addressP[0] = VAX_PC_RELATIVE_MODE;
md_number_to_chars(addressP + 1, target_address - (address_of_var + 5), 4);
extension = 5;
break;
-
+
case ENCODE_RELAX(STATE_COMPLEX_BRANCH, STATE_WORD):
md_number_to_chars(addressP, target_address - (address_of_var + 2), 2);
extension = 2;
break;
-
+
case ENCODE_RELAX(STATE_COMPLEX_BRANCH, STATE_LONG):
addressP[0] = 2;
addressP[1] = 0;
@@ -1251,12 +1251,12 @@ register fragS *fragP;
md_number_to_chars(addressP + 6, target_address, 4);
extension = 10;
break;
-
+
case ENCODE_RELAX(STATE_COMPLEX_HOP, STATE_BYTE):
addressP[0] = target_address - (address_of_var + 1);
extension = 1;
break;
-
+
case ENCODE_RELAX(STATE_COMPLEX_HOP, STATE_WORD):
addressP[0] = 2;
addressP[1] = VAX_BRB;
@@ -1265,7 +1265,7 @@ register fragS *fragP;
md_number_to_chars(addressP + 4, target_address - (address_of_var + 6), 2);
extension = 6;
break;
-
+
case ENCODE_RELAX(STATE_COMPLEX_HOP, STATE_LONG):
addressP[0] = 2;
addressP[1] = VAX_BRB;
@@ -1275,7 +1275,7 @@ register fragS *fragP;
md_number_to_chars(addressP + 5, target_address, 4);
extension = 9;
break;
-
+
default:
BAD_CASE(fragP->fr_subtype);
break;
@@ -1284,13 +1284,13 @@ register fragS *fragP;
} /* md_convert_frag() */
/* Translate internal format of relocation info into target format.
-
+
On vax: first 4 bytes are normal unsigned long, next three bytes
are symbolnum, least sig. byte first. Last byte is broken up with
the upper nibble as nuthin, bit 3 as extern, bits 2 & 1 as length, and
bit 0 as pcrel. */
#ifdef comment
-void
+void
md_ri_to_chars (the_bytes, ri)
char *the_bytes;
struct reloc_info_generic ri;
@@ -1315,27 +1315,27 @@ relax_addressT segment_address_in_file;
* In: length of relocation (or of address) in chars: 1, 2 or 4.
* Out: GNU LD relocation length code: 0, 1, or 2.
*/
-
+
static unsigned char nbytes_r_length[] = { 42, 0, 1, 42, 2 };
long r_symbolnum;
-
+
know(fixP->fx_addsy != NULL);
-
+
md_number_to_chars(where,
fixP->fx_frag->fr_address + fixP->fx_where - segment_address_in_file,
4);
-
+
r_symbolnum = (S_IS_DEFINED(fixP->fx_addsy)
? S_GET_TYPE(fixP->fx_addsy)
: fixP->fx_addsy->sy_number);
-
+
where[6] = (r_symbolnum >> 16) & 0x0ff;
where[5] = (r_symbolnum >> 8) & 0x0ff;
where[4] = r_symbolnum & 0x0ff;
where[7] = ((((!S_IS_DEFINED(fixP->fx_addsy)) << 3) & 0x08)
| ((nbytes_r_length[fixP->fx_size] << 1) & 0x06)
| (((fixP->fx_pcrel << 0) & 0x01) & 0x0f));
-
+
return;
} /* tc_aout_fix_to_chars() */
/*
@@ -1418,7 +1418,7 @@ static struct hash_control *op_hash = NULL; /* handle of the OPCODE hash table *
static const short int vax_operand_width_size[256] =
{
-
+
#define _ 0
_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
@@ -1489,12 +1489,12 @@ static const short int vax_operand_width_size[256] =
You have just broken the encoding below, which assumes the sign bit
means 'I am an imaginary instruction'.
#endif
-
+
#if (VIT_OPCODE_SPECIAL != 0x40000000)
You have just broken the encoding below, which assumes the 0x40 M bit means
'I am not to be "optimised" the way normal branches are'.
#endif
-
+
static const struct vot
synthetic_votstrs[] =
{
@@ -1519,7 +1519,7 @@ You have just broken the encoding below, which assumes the 0x40 M bit means
{"jcc", {"b?", 0x8000001e}},
{"jlssu", {"b?", 0x8000001f}},
{"jcs", {"b?", 0x8000001f}},
-
+
{"jacbw", {"rwrwmwb!", 0xC000003d}},
{"jacbf", {"rfrfmfb!", 0xC000004f}},
{"jacbd", {"rdrdmdb!", 0xC000006f}},
@@ -1527,7 +1527,7 @@ You have just broken the encoding below, which assumes the 0x40 M bit means
{"jacbl", {"rlrlmlb!", 0xC00000f1}},
{"jacbg", {"rgrgmgb!", 0xC0004ffd}},
{"jacbh", {"rhrhmhb!", 0xC0006ffd}},
-
+
{"jbs", {"rlvbb?", 0x800000e0}},
{"jbc", {"rlvbb?", 0x800000e1}},
{"jbss", {"rlvbb?", 0x800000e2}},
@@ -1538,17 +1538,17 @@ You have just broken the encoding below, which assumes the 0x40 M bit means
{"jbcci", {"rlvbb?", 0x800000e7}},
{"jlbs", {"rlb?", 0x800000e8}}, /* JF changed from rlvbb? */
{"jlbc", {"rlb?", 0x800000e9}}, /* JF changed from rlvbb? */
-
+
{"jaoblss", {"rlmlb:", 0xC00000f2}},
{"jaobleq", {"rlmlb:", 0xC00000f3}},
{"jsobgeq", {"mlb:", 0xC00000f4}}, /* JF was rlmlb: */
{"jsobgtr", {"mlb:", 0xC00000f5}}, /* JF was rlmlb: */
-
+
/* CASEx has no branch addresses in our conception of it. */
/* You should use ".word ..." statements after the "case ...". */
-
+
{"", ""} /* empty is end sentinel */
-
+
}; /* synthetic_votstrs */
/*
@@ -1569,7 +1569,7 @@ char *immediate, *indirect, *displen;
{
const struct vot *vP; /* scan votstrs */
char *retval; /* error text */
-
+
if ((op_hash = hash_new())) {
retval = ""; /* OK so far */
for (vP = votstrs; *vP->vot_name && !*retval; vP++) {
@@ -1586,7 +1586,7 @@ char *immediate, *indirect, *displen;
#ifndef CONST_TABLE
vip_op_defaults(immediate, indirect, displen);
#endif
-
+
return (retval);
}
@@ -1642,9 +1642,9 @@ char *instring; /* Text of a vax instruction: we modify. */
register char c; /* Remember char, (we clobber it */
/* with '\0' temporarily). */
register vax_opcodeT oc; /* Op-code of this instruction. */
-
+
char *vip_op ();
-
+
bug = "";
if (*instring == ' ')
++instring; /* Skip leading whitespace. */
@@ -1754,7 +1754,7 @@ main ()
{
char *p;
char *vip_begin ();
-
+
printf ("0 means no synthetic instructions. ");
printf ("Value for vip_begin? ");
gets (answer);
@@ -1865,9 +1865,9 @@ int /* return -1 or 0:15 */
char c1, c2, c3; /* c3 == 0 if 2-character reg name */
{
register int retval; /* return -1:15 */
-
+
retval = -1;
-
+
if (isupper (c1))
c1 = tolower (c1);
if (isupper (c2))
@@ -2041,7 +2041,7 @@ static const char
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _/*P Q R S T U V W X Y Z [ \ ] ^ _*/
D _ _ _ _ _ _ _ _ _ _ _ _ _ _ _/*` a b c d e f g h i j k l m n o*/
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _/*p q r s t u v w x y z { | } ~ ^?*/
-
+
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
@@ -2070,7 +2070,7 @@ int bit;
char *syms;
{
unsigned char t;
-
+
while (t= *syms++)
vip_metacharacters[t]|=bit;
}
@@ -2191,26 +2191,26 @@ struct vop *vopP; /* In: vop_access, vop_width. */
*/
char access; /* vop_access. */
char width; /* vop_width. */
-
+
int vax_reg_parse (); /* returns 0:15 or -1 if not a register */
-
+
access = vopP->vop_access;
width = vopP->vop_width;
bug = /* none of our code bugs (yet) */
err = /* no user text errors */
wrn = ""; /* no warnings even */
-
+
p = optext;
-
+
if (*p == ' ') /* Expect all whitespace reduced to ' '. */
p++; /* skip over whitespace */
-
+
if (at = INDIRECTP (*p)) { /* 1 if *p == '@'(or '*' for Un*x) */
p++; /* at is determined */
if (*p == ' ') /* Expect all whitespace reduced to ' '. */
p++; /* skip over whitespace */
}
-
+
/*
* This code is subtle. It tries to detect all legal (letter)'^'
* but it doesn't waste time explicitly testing for premature '\0' because
@@ -2218,7 +2218,7 @@ struct vop *vopP; /* In: vop_access, vop_width. */
*/
{
register char c;
-
+
c = *p;
if (isupper (c))
c = tolower (c);
@@ -2227,13 +2227,13 @@ struct vop *vopP; /* In: vop_access, vop_width. */
else /* no (letter) '^' seen */
len = ' '; /* len is determined */
}
-
+
if (*p == ' ') /* Expect all whitespace reduced to ' '. */
p++; /* skip over whitespace */
-
+
if (hash = IMMEDIATEP (*p)) /* 1 if *p == '#' ('$' for Un*x) */
p++; /* hash is determined */
-
+
/*
* p points to what may be the beginning of an expression.
* We have peeled off the front all that is peelable.
@@ -2241,7 +2241,7 @@ struct vop *vopP; /* In: vop_access, vop_width. */
*
* Lets point q at the end of the text and parse that (backwards).
*/
-
+
for (q = p; *q; q++)
;
q--; /* now q points at last char of text */
@@ -2250,7 +2250,7 @@ struct vop *vopP; /* In: vop_access, vop_width. */
q--;
/* reverse over whitespace, but don't */
/* run back over *p */
-
+
/*
* As a matter of policy here, we look for [Rn], although both Rn and S^#
* forbid [Rn]. This is because it is easy, and because only a sick
@@ -2289,7 +2289,7 @@ struct vop *vopP; /* In: vop_access, vop_width. */
}
} else
ndx = -1; /* no ']', so no iNDeX register */
-
+
/*
* If err = "..." then we lost: run away.
* Otherwise ndx == -1 if there was no "[...]".
@@ -2302,12 +2302,12 @@ struct vop *vopP; /* In: vop_access, vop_width. */
/* run back over *p */
if (!*err) {
sign = 0; /* no ()+ or -() seen yet */
-
+
if (q > p + 3 && *q == '+' && q[-1] == ')') {
sign = 1; /* we saw a ")+" */
q--; /* q points to ')' */
}
-
+
if (*q == ')' && q > p + 2) {
paren = 1; /* assume we have "(...)" */
while (q >= p && *q != '(')
@@ -2403,7 +2403,7 @@ struct vop *vopP; /* In: vop_access, vop_width. */
/*
* have reg. -1:absent; else 0:15
*/
-
+
/*
* We have: err, at, len, hash, ndx, sign, paren, reg.
* Also, any remaining expression is from *p through *q inclusive.
@@ -2416,7 +2416,7 @@ struct vop *vopP; /* In: vop_access, vop_width. */
* We want: len, mode, reg, ndx, err, p, q, wrn, bug.
* We will deliver a 4-bit reg, and a 4-bit mode.
*/
-
+
/*
* Case of branch operand. Different. No L^B^W^I^S^ allowed for instance.
*
@@ -2588,7 +2588,7 @@ struct vop *vopP; /* In: vop_access, vop_width. */
at = 1;
paren = 0;
}
-
+
/*
* Case of (Rn)+, which is slightly different.
*
@@ -2654,11 +2654,11 @@ struct vop *vopP; /* In: vop_access, vop_width. */
reg = -1; /* no register any more */
}
err = " "; /* win */
-
+
/* JF a bugfix, I think! */
if (at && access == 'a')
vopP->vop_nbytes=4;
-
+
mode = (at ? 9 : 8);
reg = PC;
if ((access == 'm' || access == 'w') && !at)
@@ -2750,7 +2750,7 @@ struct vop *vopP; /* In: vop_access, vop_width. */
break;
}
}
-
+
/*
* here with completely specified mode
* len
@@ -2758,10 +2758,10 @@ struct vop *vopP; /* In: vop_access, vop_width. */
* expression p,q
* ndx
*/
-
+
if (*err == ' ')
err = ""; /* " " is no longer an error */
-
+
vopP->vop_mode = mode;
vopP->vop_reg = reg;
vopP->vop_short = len;
@@ -2771,13 +2771,13 @@ struct vop *vopP; /* In: vop_access, vop_width. */
vopP->vop_error = err;
vopP->vop_warn = wrn;
return (bug);
-
+
} /* vip_op() */
/*
-
+
Summary of vip_op outputs.
-
+
mode reg len ndx
(Rn) => @Rn
{@}Rn 5+@ n ' ' optional
@@ -2787,7 +2787,7 @@ struct vop *vopP; /* In: vop_access, vop_width. */
{@}(Rn)+ 8+@ n ' ' optional
{@}#foo, no S^ 8+@ PC " i" optional
{@}{q^}{(Rn)} 10+@+q option " bwl" optional
-
+
*/
#ifdef TEST /* #Define to use this testbed. */
@@ -2821,7 +2821,7 @@ char my_displen[200];
main ()
{
char *vip_op (); /* make cc happy */
-
+
printf ("enter immediate symbols eg enter # ");
gets (my_immediate);
printf ("enter indirect symbols eg enter @ ");
@@ -2870,7 +2870,7 @@ main ()
case '-':
my_operand_length = 0;
break;
-
+
default:
my_operand_length = 2;
printf ("I dn't understand access width %c\n", mywidth);
@@ -2929,7 +2929,7 @@ fragS *frag;
symbolS *to_symbol;
{
long offset;
-
+
offset = to_addr - (from_addr + 1);
*ptr++ = 0x31;
md_number_to_chars(ptr, offset, 2);
@@ -2943,7 +2943,7 @@ fragS *frag;
symbolS *to_symbol;
{
long offset;
-
+
offset = to_addr - S_GET_VALUE(to_symbol);
*ptr++ = 0x17;
*ptr++ = 0x9F;
@@ -2963,20 +2963,20 @@ char ***vecP;
{
char *temp_name; /* name for -t or -d options */
char opt;
-
+
switch (**argP) {
case 'J':
/* as_warn ("I can do better than -J!"); */
break;
-
+
case 'S':
as_warn ("SYMBOL TABLE not implemented");
break; /* SYMBOL TABLE not implemented */
-
+
case 'T':
as_warn ("TOKEN TRACE not implemented");
break; /* TOKEN TRACE not implemented */
-
+
case 'd':
case 't':
opt= **argP;
@@ -2994,38 +2994,38 @@ char ***vecP;
as_warn ("I expected a filename after -%c.",opt);
temp_name = "{absent}";
}
-
+
if (opt == 'd')
as_warn ("Displacement length %s ignored!", temp_name);
else
as_warn ("I don't need or use temp. file \"%s\".", temp_name);
break;
-
+
case 'V':
as_warn ("I don't use an interpass file! -V ignored");
break;
-
+
#ifdef OBJ_VMS
case '+': /* For g++ */
break;
-
+
case '1': /* For backward compatibility */
break;
-
+
case 'h': /* No hashing of mixed-case names */
vms_name_mapping = 0;
(*argP)++;
if (**argP) vms_name_mapping = *((*argP)++) - '0';
(*argP)--;
break;
-
+
case 'H': /* Show new symbol after hash truncation */
break;
#endif
-
+
default:
return 0;
-
+
}
return 1;
}
@@ -3040,7 +3040,7 @@ char *name;
return 0;
}
-/* Parse an operand that is machine-specific.
+/* Parse an operand that is machine-specific.
We just return without modifying the expression if we have nothing
to do. */
diff --git a/gnu/usr.bin/as/config/te-ic960.h b/gnu/usr.bin/as/config/te-ic960.h
index 4858c7d..7a9dbe7 100644
--- a/gnu/usr.bin/as/config/te-ic960.h
+++ b/gnu/usr.bin/as/config/te-ic960.h
@@ -1,19 +1,19 @@
/* This file is twe-ic960.h
Copyright (C) 1987-1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
diff --git a/gnu/usr.bin/as/config/te-sun3.h b/gnu/usr.bin/as/config/te-sun3.h
index e559f28..ec4d29a 100644
--- a/gnu/usr.bin/as/config/te-sun3.h
+++ b/gnu/usr.bin/as/config/te-sun3.h
@@ -1,18 +1,18 @@
/* te-sun3.h -- Sun-3 target environment declarations.
Copyright (C) 1987, 1990, 1991, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
@@ -20,14 +20,14 @@
/* This header file contains the #defines specific
to SUN computer SUN 3 series computers. (The only kind
we have around here, unfortunatly.)
-
+
Rumor has it that this file will work on the Sun-2 if the assembler
is called with -m68010 This is not tested. */
/* Could also be :
#define S_LOCAL_NAME(s) (S_GET_NAME(s)[0] == '.' &&
- S_GET_NAME(s)[1] == 'L' ||
+ S_GET_NAME(s)[1] == 'L' ||
S_GET_NAME(s)[1] == '.')
*/
@@ -36,7 +36,7 @@
of an old-style 68000 file */
#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (2<<16|OMAGIC) /* Magic byte for file header */
-
+
#include "obj-format.h"
/*
diff --git a/gnu/usr.bin/as/config/vax-inst.h b/gnu/usr.bin/as/config/vax-inst.h
index 1c10191..47c5ef0 100644
--- a/gnu/usr.bin/as/config/vax-inst.h
+++ b/gnu/usr.bin/as/config/vax-inst.h
@@ -1,18 +1,18 @@
/* vax-inst.h - GNU - Part of vax.c
Copyright (C) 1987, 1992 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
OpenPOWER on IntegriCloud