mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-18 14:04:24 +08:00
Ran "indent", for GNU coding style; some code & comments still need fixup.
Removed some unneeded files. obj-coff.c (obj_coff_endef): Use as_warn, not fprintf. tc-m68k.c (md_assemble): 68000+68881 is okay -- could be emulating.
This commit is contained in:
parent
6efd877de5
commit
355afbcd8b
@ -1,3 +1,10 @@
|
||||
Mon Nov 23 11:50:00 1992 Ken Raeburn (raeburn@cygnus.com)
|
||||
|
||||
* obj-coff.c (obj_coff_endef): Use as_warn, not fprintf.
|
||||
|
||||
* tc-m68k.c (md_assemble): Don't complain about 68000 with 68881;
|
||||
could be doing emulation.
|
||||
|
||||
Tue Nov 10 09:50:25 1992 Ian Lance Taylor (ian@cygnus.com)
|
||||
|
||||
* tc-m68k.c (m68k_reg_parse): If REGISTER_PREFIX isn't defined,
|
||||
|
@ -1,36 +1,31 @@
|
||||
/* 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. */
|
||||
|
||||
#include "as.h"
|
||||
|
||||
#ifdef USG
|
||||
#define bzero(s,n) memset(s,0,n)
|
||||
#define bcopy(from,to,n) memcpy((to),(from),(n))
|
||||
#endif
|
||||
|
||||
extern FLONUM_TYPE generic_floating_point_number; /* Flonums returned here. */
|
||||
extern FLONUM_TYPE generic_floating_point_number; /* Flonums returned here. */
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL (0)
|
||||
#endif
|
||||
|
||||
extern char EXP_CHARS[];
|
||||
extern const char EXP_CHARS[];
|
||||
/* Precision in LittleNums. */
|
||||
#define MAX_PRECISION (6)
|
||||
#define F_PRECISION (2)
|
||||
@ -41,40 +36,41 @@ extern char EXP_CHARS[];
|
||||
/* Length in LittleNums of guard bits. */
|
||||
#define GUARD (2)
|
||||
|
||||
static unsigned long mask [] = {
|
||||
0x00000000,
|
||||
0x00000001,
|
||||
0x00000003,
|
||||
0x00000007,
|
||||
0x0000000f,
|
||||
0x0000001f,
|
||||
0x0000003f,
|
||||
0x0000007f,
|
||||
0x000000ff,
|
||||
0x000001ff,
|
||||
0x000003ff,
|
||||
0x000007ff,
|
||||
0x00000fff,
|
||||
0x00001fff,
|
||||
0x00003fff,
|
||||
0x00007fff,
|
||||
0x0000ffff,
|
||||
0x0001ffff,
|
||||
0x0003ffff,
|
||||
0x0007ffff,
|
||||
0x000fffff,
|
||||
0x001fffff,
|
||||
0x003fffff,
|
||||
0x007fffff,
|
||||
0x00ffffff,
|
||||
0x01ffffff,
|
||||
0x03ffffff,
|
||||
0x07ffffff,
|
||||
0x0fffffff,
|
||||
0x1fffffff,
|
||||
0x3fffffff,
|
||||
0x7fffffff,
|
||||
0xffffffff,
|
||||
static unsigned long mask[] =
|
||||
{
|
||||
0x00000000,
|
||||
0x00000001,
|
||||
0x00000003,
|
||||
0x00000007,
|
||||
0x0000000f,
|
||||
0x0000001f,
|
||||
0x0000003f,
|
||||
0x0000007f,
|
||||
0x000000ff,
|
||||
0x000001ff,
|
||||
0x000003ff,
|
||||
0x000007ff,
|
||||
0x00000fff,
|
||||
0x00001fff,
|
||||
0x00003fff,
|
||||
0x00007fff,
|
||||
0x0000ffff,
|
||||
0x0001ffff,
|
||||
0x0003ffff,
|
||||
0x0007ffff,
|
||||
0x000fffff,
|
||||
0x001fffff,
|
||||
0x003fffff,
|
||||
0x007fffff,
|
||||
0x00ffffff,
|
||||
0x01ffffff,
|
||||
0x03ffffff,
|
||||
0x07ffffff,
|
||||
0x0fffffff,
|
||||
0x1fffffff,
|
||||
0x3fffffff,
|
||||
0x7fffffff,
|
||||
0xffffffff,
|
||||
};
|
||||
|
||||
|
||||
@ -83,58 +79,66 @@ static int littlenums_left;
|
||||
static LITTLENUM_TYPE *littlenum_pointer;
|
||||
|
||||
static int
|
||||
next_bits (number_of_bits)
|
||||
int number_of_bits;
|
||||
next_bits (number_of_bits)
|
||||
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;
|
||||
return_value |= (*littlenum_pointer >> bits_left_in_littlenum) & mask[number_of_bits];
|
||||
}
|
||||
} else {
|
||||
bits_left_in_littlenum -= number_of_bits;
|
||||
return_value = mask[number_of_bits] & (*littlenum_pointer >> bits_left_in_littlenum);
|
||||
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;
|
||||
return_value |= (*littlenum_pointer >> bits_left_in_littlenum) & mask[number_of_bits];
|
||||
}
|
||||
return(return_value);
|
||||
}
|
||||
else
|
||||
{
|
||||
bits_left_in_littlenum -= number_of_bits;
|
||||
return_value = mask[number_of_bits] & (*littlenum_pointer >> bits_left_in_littlenum);
|
||||
}
|
||||
return (return_value);
|
||||
}
|
||||
|
||||
/* Num had better be less than LITTLENUM_NUMBER_OF_BITS */
|
||||
static void
|
||||
unget_bits(num)
|
||||
int num;
|
||||
unget_bits (num)
|
||||
int num;
|
||||
{
|
||||
if (!littlenums_left) {
|
||||
++littlenum_pointer;
|
||||
++littlenums_left;
|
||||
bits_left_in_littlenum = num;
|
||||
} else if (bits_left_in_littlenum + num > LITTLENUM_NUMBER_OF_BITS) {
|
||||
bits_left_in_littlenum = num - (LITTLENUM_NUMBER_OF_BITS - bits_left_in_littlenum);
|
||||
++littlenum_pointer;
|
||||
++littlenums_left;
|
||||
} else
|
||||
bits_left_in_littlenum += num;
|
||||
if (!littlenums_left)
|
||||
{
|
||||
++littlenum_pointer;
|
||||
++littlenums_left;
|
||||
bits_left_in_littlenum = num;
|
||||
}
|
||||
else if (bits_left_in_littlenum + num > LITTLENUM_NUMBER_OF_BITS)
|
||||
{
|
||||
bits_left_in_littlenum = num - (LITTLENUM_NUMBER_OF_BITS - bits_left_in_littlenum);
|
||||
++littlenum_pointer;
|
||||
++littlenums_left;
|
||||
}
|
||||
else
|
||||
bits_left_in_littlenum += num;
|
||||
}
|
||||
|
||||
static void
|
||||
make_invalid_floating_point_number(words)
|
||||
LITTLENUM_TYPE *words;
|
||||
make_invalid_floating_point_number (words)
|
||||
LITTLENUM_TYPE *words;
|
||||
{
|
||||
as_bad("cannot create floating-point number");
|
||||
words[0] = ((unsigned) -1) >> 1; /* Zero the leftmost bit */
|
||||
words[1] = -1;
|
||||
words[2] = -1;
|
||||
words[3] = -1;
|
||||
words[4] = -1;
|
||||
words[5] = -1;
|
||||
as_bad ("cannot create floating-point number");
|
||||
words[0] = ((unsigned) -1) >> 1; /* Zero the leftmost bit */
|
||||
words[1] = -1;
|
||||
words[2] = -1;
|
||||
words[3] = -1;
|
||||
words[4] = -1;
|
||||
words[5] = -1;
|
||||
}
|
||||
|
||||
/***********************************************************************\
|
||||
@ -149,157 +153,175 @@ LITTLENUM_TYPE *words;
|
||||
them. */
|
||||
|
||||
char * /* Return pointer past text consumed. */
|
||||
atof_ieee(str, what_kind, words)
|
||||
char *str; /* Text to convert to binary. */
|
||||
char what_kind; /* 'd', 'f', 'g', 'h' */
|
||||
LITTLENUM_TYPE *words; /* Build the binary here. */
|
||||
atof_ieee (str, what_kind, words)
|
||||
char *str; /* Text to convert to binary. */
|
||||
char what_kind; /* 'd', 'f', 'g', 'h' */
|
||||
LITTLENUM_TYPE *words; /* Build the binary here. */
|
||||
{
|
||||
static LITTLENUM_TYPE bits[MAX_PRECISION + MAX_PRECISION + GUARD];
|
||||
/* Extra bits for zeroed low-order bits. */
|
||||
/* The 1st MAX_PRECISION are zeroed, */
|
||||
/* the last contain flonum bits. */
|
||||
char *return_value;
|
||||
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
|
||||
static LITTLENUM_TYPE bits[MAX_PRECISION + MAX_PRECISION + GUARD];
|
||||
/* Extra bits for zeroed low-order bits. */
|
||||
/* The 1st MAX_PRECISION are zeroed, */
|
||||
/* the last contain flonum bits. */
|
||||
char *return_value;
|
||||
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. */
|
||||
|
||||
bzero(bits, sizeof(LITTLENUM_TYPE) * MAX_PRECISION);
|
||||
|
||||
switch (what_kind) {
|
||||
case 'f':
|
||||
case 'F':
|
||||
case 's':
|
||||
case 'S':
|
||||
precision = F_PRECISION;
|
||||
exponent_bits = 8;
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
case 'D':
|
||||
case 'r':
|
||||
case 'R':
|
||||
precision = D_PRECISION;
|
||||
exponent_bits = 11;
|
||||
break;
|
||||
|
||||
case 'x':
|
||||
case 'X':
|
||||
case 'e':
|
||||
case 'E':
|
||||
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
|
||||
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':
|
||||
case 's':
|
||||
case 'S':
|
||||
precision = F_PRECISION;
|
||||
exponent_bits = 8;
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
case 'D':
|
||||
case 'r':
|
||||
case 'R':
|
||||
precision = D_PRECISION;
|
||||
exponent_bits = 11;
|
||||
break;
|
||||
|
||||
case 'x':
|
||||
case 'X':
|
||||
case 'e':
|
||||
case 'E':
|
||||
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);
|
||||
generic_floating_point_number = save_gen_flonum;
|
||||
|
||||
return (return_value);
|
||||
}
|
||||
|
||||
/* Turn generic_floating_point_number into a real float/double/extended */
|
||||
int gen_to_words(words, precision, exponent_bits)
|
||||
LITTLENUM_TYPE *words;
|
||||
int precision;
|
||||
long exponent_bits;
|
||||
int
|
||||
gen_to_words (words, precision, exponent_bits)
|
||||
LITTLENUM_TYPE *words;
|
||||
int precision;
|
||||
long exponent_bits;
|
||||
{
|
||||
int return_value = 0;
|
||||
|
||||
long exponent_1;
|
||||
long exponent_2;
|
||||
long exponent_3;
|
||||
long exponent_4;
|
||||
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 == '+')
|
||||
words[0] = 0x0000;
|
||||
else
|
||||
words[0] = 0x8000;
|
||||
bzero(&words[1], sizeof(LITTLENUM_TYPE) * (precision - 1));
|
||||
return(return_value);
|
||||
int return_value = 0;
|
||||
|
||||
long exponent_1;
|
||||
long exponent_2;
|
||||
long exponent_3;
|
||||
long exponent_4;
|
||||
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 == '+')
|
||||
words[0] = 0x0000;
|
||||
else
|
||||
words[0] = 0x8000;
|
||||
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)
|
||||
{
|
||||
words[0] = 0x7fff;
|
||||
words[1] = 0xffff;
|
||||
}
|
||||
|
||||
/* NaN: Do the right thing */
|
||||
if (generic_floating_point_number.sign == 0) {
|
||||
if (precision == F_PRECISION) {
|
||||
words[0] = 0x7fff;
|
||||
words[1] = 0xffff;
|
||||
} else {
|
||||
words[0] = 0x7fff;
|
||||
words[1] = 0xffff;
|
||||
words[2] = 0xffff;
|
||||
words[3] = 0xffff;
|
||||
}
|
||||
return return_value;
|
||||
} else if (generic_floating_point_number.sign == 'P') {
|
||||
/* +INF: Do the right thing */
|
||||
if (precision == F_PRECISION) {
|
||||
words[0] = 0x7f80;
|
||||
words[1] = 0;
|
||||
} else {
|
||||
words[0] = 0x7ff0;
|
||||
words[1] = 0;
|
||||
words[2] = 0;
|
||||
words[3] = 0;
|
||||
}
|
||||
return(return_value);
|
||||
} else if (generic_floating_point_number.sign == 'N') {
|
||||
/* Negative INF */
|
||||
if (precision == F_PRECISION) {
|
||||
words[0] = 0xff80;
|
||||
words[1] = 0x0;
|
||||
} else {
|
||||
words[0] = 0xfff0;
|
||||
words[1] = 0x0;
|
||||
words[2] = 0x0;
|
||||
words[3] = 0x0;
|
||||
}
|
||||
return(return_value);
|
||||
else
|
||||
{
|
||||
words[0] = 0x7fff;
|
||||
words[1] = 0xffff;
|
||||
words[2] = 0xffff;
|
||||
words[3] = 0xffff;
|
||||
}
|
||||
/*
|
||||
return return_value;
|
||||
}
|
||||
else if (generic_floating_point_number.sign == 'P')
|
||||
{
|
||||
/* +INF: Do the right thing */
|
||||
if (precision == F_PRECISION)
|
||||
{
|
||||
words[0] = 0x7f80;
|
||||
words[1] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
words[0] = 0x7ff0;
|
||||
words[1] = 0;
|
||||
words[2] = 0;
|
||||
words[3] = 0;
|
||||
}
|
||||
return (return_value);
|
||||
}
|
||||
else if (generic_floating_point_number.sign == 'N')
|
||||
{
|
||||
/* Negative INF */
|
||||
if (precision == F_PRECISION)
|
||||
{
|
||||
words[0] = 0xff80;
|
||||
words[1] = 0x0;
|
||||
}
|
||||
else
|
||||
{
|
||||
words[0] = 0xfff0;
|
||||
words[1] = 0x0;
|
||||
words[2] = 0x0;
|
||||
words[3] = 0x0;
|
||||
}
|
||||
return (return_value);
|
||||
}
|
||||
/*
|
||||
* The floating point formats we support have:
|
||||
* Bit 15 is sign bit.
|
||||
* Bits 14:n are excess-whatever exponent.
|
||||
@ -309,139 +331,163 @@ long exponent_bits;
|
||||
* So we need: number of bits of exponent, number of bits of
|
||||
* mantissa.
|
||||
*/
|
||||
bits_left_in_littlenum = LITTLENUM_NUMBER_OF_BITS;
|
||||
littlenum_pointer = generic_floating_point_number.leader;
|
||||
littlenums_left = 1 + generic_floating_point_number.leader - generic_floating_point_number.low;
|
||||
/* Seek (and forget) 1st significant bit */
|
||||
for (exponent_skippage = 0;! next_bits(1); exponent_skippage ++) ;;
|
||||
exponent_1 = generic_floating_point_number.exponent + generic_floating_point_number.leader
|
||||
+ 1 - generic_floating_point_number.low;
|
||||
/* Radix LITTLENUM_RADIX, point just higher than generic_floating_point_number.leader. */
|
||||
exponent_2 = exponent_1 * LITTLENUM_NUMBER_OF_BITS;
|
||||
/* Radix 2. */
|
||||
exponent_3 = exponent_2 - exponent_skippage;
|
||||
/* 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;
|
||||
*lp++ = word1;
|
||||
if (num_bits + exponent_bits + 1 >= precision * LITTLENUM_NUMBER_OF_BITS) {
|
||||
/* Exponent overflow */
|
||||
make_invalid_floating_point_number(words);
|
||||
return(return_value);
|
||||
}
|
||||
if (precision == X_PRECISION && exponent_bits == 15) {
|
||||
*lp++ = 0;
|
||||
*lp++ = 0;
|
||||
num_bits -= LITTLENUM_NUMBER_OF_BITS - 1;
|
||||
}
|
||||
while (num_bits >= LITTLENUM_NUMBER_OF_BITS) {
|
||||
num_bits -= LITTLENUM_NUMBER_OF_BITS;
|
||||
*lp++ = 0;
|
||||
}
|
||||
if (num_bits)
|
||||
*lp++ = next_bits(LITTLENUM_NUMBER_OF_BITS - (num_bits));
|
||||
} else {
|
||||
if (precision == X_PRECISION && exponent_bits == 15) {
|
||||
*lp++ = word1;
|
||||
*lp++ = 0;
|
||||
if (num_bits == LITTLENUM_NUMBER_OF_BITS) {
|
||||
*lp++ = 0;
|
||||
*lp++ = next_bits(LITTLENUM_NUMBER_OF_BITS - 1);
|
||||
} else if (num_bits == LITTLENUM_NUMBER_OF_BITS - 1)
|
||||
*lp++ = 0;
|
||||
else
|
||||
*lp++ = next_bits(LITTLENUM_NUMBER_OF_BITS - 1 - num_bits);
|
||||
num_bits = 0;
|
||||
} else {
|
||||
word1 |= next_bits((LITTLENUM_NUMBER_OF_BITS - 1) - (exponent_bits + num_bits));
|
||||
*lp++ = word1;
|
||||
}
|
||||
bits_left_in_littlenum = LITTLENUM_NUMBER_OF_BITS;
|
||||
littlenum_pointer = generic_floating_point_number.leader;
|
||||
littlenums_left = 1 + generic_floating_point_number.leader - generic_floating_point_number.low;
|
||||
/* Seek (and forget) 1st significant bit */
|
||||
for (exponent_skippage = 0; !next_bits (1); ++exponent_skippage);;
|
||||
exponent_1 = generic_floating_point_number.exponent + generic_floating_point_number.leader
|
||||
+ 1 - generic_floating_point_number.low;
|
||||
/* Radix LITTLENUM_RADIX, point just higher than generic_floating_point_number.leader. */
|
||||
exponent_2 = exponent_1 * LITTLENUM_NUMBER_OF_BITS;
|
||||
/* Radix 2. */
|
||||
exponent_3 = exponent_2 - exponent_skippage;
|
||||
/* 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;
|
||||
*lp++ = word1;
|
||||
if (num_bits + exponent_bits + 1 >= precision * LITTLENUM_NUMBER_OF_BITS)
|
||||
{
|
||||
/* Exponent overflow */
|
||||
make_invalid_floating_point_number (words);
|
||||
return (return_value);
|
||||
}
|
||||
if (precision == X_PRECISION && exponent_bits == 15)
|
||||
{
|
||||
*lp++ = 0;
|
||||
*lp++ = 0;
|
||||
num_bits -= LITTLENUM_NUMBER_OF_BITS - 1;
|
||||
}
|
||||
while (num_bits >= LITTLENUM_NUMBER_OF_BITS)
|
||||
{
|
||||
num_bits -= LITTLENUM_NUMBER_OF_BITS;
|
||||
*lp++ = 0;
|
||||
}
|
||||
if (num_bits)
|
||||
*lp++ = next_bits (LITTLENUM_NUMBER_OF_BITS - (num_bits));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (precision == X_PRECISION && exponent_bits == 15)
|
||||
{
|
||||
*lp++ = word1;
|
||||
*lp++ = 0;
|
||||
if (num_bits == LITTLENUM_NUMBER_OF_BITS)
|
||||
{
|
||||
*lp++ = 0;
|
||||
*lp++ = next_bits (LITTLENUM_NUMBER_OF_BITS - 1);
|
||||
}
|
||||
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) {
|
||||
if (lp[n] != (LITTLENUM_TYPE) - 1)
|
||||
break;
|
||||
--n;
|
||||
tmp_bits -= LITTLENUM_NUMBER_OF_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;
|
||||
carry >>= LITTLENUM_NUMBER_OF_BITS;
|
||||
}
|
||||
}
|
||||
} else if ((*lp & mask[prec_bits]) != mask[prec_bits])
|
||||
lp++;
|
||||
else if (num_bits == LITTLENUM_NUMBER_OF_BITS - 1)
|
||||
*lp++ = 0;
|
||||
else
|
||||
*lp++ = next_bits (LITTLENUM_NUMBER_OF_BITS - 1 - num_bits);
|
||||
num_bits = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
word1 |= next_bits ((LITTLENUM_NUMBER_OF_BITS - 1) - (exponent_bits + num_bits));
|
||||
*lp++ = word1;
|
||||
}
|
||||
}
|
||||
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)
|
||||
{
|
||||
if (lp[n] != (LITTLENUM_TYPE) - 1)
|
||||
break;
|
||||
--n;
|
||||
tmp_bits -= LITTLENUM_NUMBER_OF_BITS;
|
||||
}
|
||||
|
||||
return return_value;
|
||||
} else if (exponent_4 & ~ mask [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;
|
||||
carry >>= LITTLENUM_NUMBER_OF_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
|
||||
* because we can't encode the number.
|
||||
*/
|
||||
make_invalid_floating_point_number (words);
|
||||
return return_value;
|
||||
} else {
|
||||
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,
|
||||
make_invalid_floating_point_number (words);
|
||||
return return_value;
|
||||
}
|
||||
else
|
||||
{
|
||||
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;
|
||||
/*
|
||||
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;
|
||||
/*
|
||||
* Since the NEXT bit is a 1, round UP the mantissa.
|
||||
* The cunning design of these hidden-1 floats permits
|
||||
* us to let the mantissa overflow into the exponent, and
|
||||
@ -449,30 +495,32 @@ 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)
|
||||
|
||||
/* #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
|
||||
propagation. Another extra bit (kept 0) will assure us that we
|
||||
don't get a sticky sign bit after shifting right, and that
|
||||
permits us to propagate the carry without any masking of bits.
|
||||
#endif */
|
||||
for (carry = 1, lp--; carry && (lp >= words); lp--) {
|
||||
carry = *lp + carry;
|
||||
*lp = carry;
|
||||
carry >>= LITTLENUM_NUMBER_OF_BITS;
|
||||
}
|
||||
if ((word1 ^ *words) & (1 << (LITTLENUM_NUMBER_OF_BITS - 1))) {
|
||||
/* We leave return_value alone: admit we read the
|
||||
for (carry = 1, lp--; carry && (lp >= words); lp--)
|
||||
{
|
||||
carry = *lp + carry;
|
||||
*lp = carry;
|
||||
carry >>= LITTLENUM_NUMBER_OF_BITS;
|
||||
}
|
||||
if ((word1 ^ *words) & (1 << (LITTLENUM_NUMBER_OF_BITS - 1)))
|
||||
{
|
||||
/* We leave return_value alone: admit we read the
|
||||
* number, but return a floating exception
|
||||
* because we can't encode the number.
|
||||
*/
|
||||
*words &= ~(1 << (LITTLENUM_NUMBER_OF_BITS - 1));
|
||||
/* make_invalid_floating_point_number (words); */
|
||||
/* return return_value; */
|
||||
}
|
||||
*words &= ~(1 << (LITTLENUM_NUMBER_OF_BITS - 1));
|
||||
/* make_invalid_floating_point_number (words); */
|
||||
/* return return_value; */
|
||||
}
|
||||
return (return_value);
|
||||
}
|
||||
return (return_value);
|
||||
}
|
||||
|
||||
/* This routine is a real kludge. Someone really should do it better, but
|
||||
@ -480,47 +528,49 @@ long exponent_bits;
|
||||
(JF)
|
||||
*/
|
||||
void
|
||||
int_to_gen(x)
|
||||
long x;
|
||||
int_to_gen (x)
|
||||
long x;
|
||||
{
|
||||
char buf[20];
|
||||
char *bufp;
|
||||
|
||||
sprintf(buf,"%ld",x);
|
||||
bufp = &buf[0];
|
||||
if (atof_generic(&bufp, ".", EXP_CHARS, &generic_floating_point_number))
|
||||
as_bad("Error converting number to floating point (Exponent overflow?)");
|
||||
char buf[20];
|
||||
char *bufp;
|
||||
|
||||
sprintf (buf, "%ld", x);
|
||||
bufp = &buf[0];
|
||||
if (atof_generic (&bufp, ".", EXP_CHARS, &generic_floating_point_number))
|
||||
as_bad ("Error converting number to floating point (Exponent overflow?)");
|
||||
}
|
||||
|
||||
#ifdef TEST
|
||||
char *
|
||||
print_gen(gen)
|
||||
FLONUM_TYPE *gen;
|
||||
print_gen (gen)
|
||||
FLONUM_TYPE *gen;
|
||||
{
|
||||
FLONUM_TYPE f;
|
||||
LITTLENUM_TYPE arr[10];
|
||||
double dv;
|
||||
float fv;
|
||||
static char sbuf[40];
|
||||
|
||||
if (gen) {
|
||||
f = generic_floating_point_number;
|
||||
generic_floating_point_number = *gen;
|
||||
}
|
||||
gen_to_words(&arr[0], 4, 11);
|
||||
bcopy(&arr[0], &dv, sizeof(double));
|
||||
sprintf(sbuf, "%x %x %x %x %.14G ", arr[0], arr[1], arr[2], arr[3], dv);
|
||||
gen_to_words(&arr[0],2,8);
|
||||
bcopy(&arr[0],&fv,sizeof(float));
|
||||
sprintf(sbuf + strlen(sbuf), "%x %x %.12g\n", arr[0], arr[1],
|
||||
fv);
|
||||
|
||||
if (gen) {
|
||||
generic_floating_point_number = f;
|
||||
}
|
||||
|
||||
return(sbuf);
|
||||
FLONUM_TYPE f;
|
||||
LITTLENUM_TYPE arr[10];
|
||||
double dv;
|
||||
float fv;
|
||||
static char sbuf[40];
|
||||
|
||||
if (gen)
|
||||
{
|
||||
f = generic_floating_point_number;
|
||||
generic_floating_point_number = *gen;
|
||||
}
|
||||
gen_to_words (&arr[0], 4, 11);
|
||||
memcpy (&dv, &arr[0], sizeof (double));
|
||||
sprintf (sbuf, "%x %x %x %x %.14G ", arr[0], arr[1], arr[2], arr[3], dv);
|
||||
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
|
||||
|
||||
/* end of atof-ieee.c */
|
||||
|
@ -21,22 +21,22 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#include "as.h"
|
||||
|
||||
extern FLONUM_TYPE generic_floating_point_number; /* Flonums returned here. */
|
||||
extern FLONUM_TYPE generic_floating_point_number; /* Flonums returned here. */
|
||||
|
||||
extern const char EXP_CHARS[];
|
||||
/* Precision in LittleNums. */
|
||||
/* Precision in LittleNums. */
|
||||
#define MAX_PRECISION (4)
|
||||
#define F_PRECISION (2)
|
||||
#define D_PRECISION (4)
|
||||
|
||||
/* Length in LittleNums of guard bits. */
|
||||
/* Length in LittleNums of guard bits. */
|
||||
#define GUARD (2)
|
||||
|
||||
int /* Number of chars in flonum type 'letter'. */
|
||||
atof_sizeof (letter)
|
||||
char letter;
|
||||
{
|
||||
int return_value;
|
||||
int return_value;
|
||||
|
||||
/*
|
||||
* Permitting uppercase letters is probably a bad idea.
|
||||
@ -60,7 +60,8 @@ atof_sizeof (letter)
|
||||
return (return_value);
|
||||
}
|
||||
|
||||
static unsigned long int mask [] = {
|
||||
static unsigned long int mask[] =
|
||||
{
|
||||
0x00000000,
|
||||
0x00000001,
|
||||
0x00000003,
|
||||
@ -94,48 +95,49 @@ static unsigned long int mask [] = {
|
||||
0x3fffffff,
|
||||
0x7fffffff,
|
||||
0xffffffff
|
||||
};
|
||||
};
|
||||
|
||||
static int bits_left_in_littlenum;
|
||||
static int littlenums_left;
|
||||
static LITTLENUM_TYPE * littlenum_pointer;
|
||||
static LITTLENUM_TYPE *littlenum_pointer;
|
||||
|
||||
static int
|
||||
next_bits (number_of_bits)
|
||||
int number_of_bits;
|
||||
int number_of_bits;
|
||||
{
|
||||
int return_value;
|
||||
int return_value;
|
||||
|
||||
if(!littlenums_left)
|
||||
return 0;
|
||||
if (!littlenums_left)
|
||||
return 0;
|
||||
if (number_of_bits >= bits_left_in_littlenum)
|
||||
{
|
||||
return_value = mask [bits_left_in_littlenum] & *littlenum_pointer;
|
||||
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 --;
|
||||
--littlenums_left;
|
||||
return_value |= (*littlenum_pointer>>bits_left_in_littlenum) & mask[number_of_bits];
|
||||
}
|
||||
if (littlenums_left)
|
||||
{
|
||||
bits_left_in_littlenum = LITTLENUM_NUMBER_OF_BITS - number_of_bits;
|
||||
littlenum_pointer--;
|
||||
--littlenums_left;
|
||||
return_value |= (*littlenum_pointer >> bits_left_in_littlenum) & mask[number_of_bits];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bits_left_in_littlenum -= number_of_bits;
|
||||
return_value = mask [number_of_bits] & (*littlenum_pointer>>bits_left_in_littlenum);
|
||||
return_value = mask[number_of_bits] & (*littlenum_pointer >> bits_left_in_littlenum);
|
||||
}
|
||||
return (return_value);
|
||||
}
|
||||
|
||||
static void
|
||||
make_invalid_floating_point_number (words)
|
||||
LITTLENUM_TYPE * words;
|
||||
LITTLENUM_TYPE *words;
|
||||
{
|
||||
words[0]= ((unsigned)-1)>>1; /* Zero the leftmost bit */
|
||||
words[1]= -1;
|
||||
words[2]= -1;
|
||||
words[3]= -1;
|
||||
words[0] = ((unsigned) -1) >> 1; /* Zero the leftmost bit */
|
||||
words[1] = -1;
|
||||
words[2] = -1;
|
||||
words[3] = -1;
|
||||
}
|
||||
|
||||
/***********************************************************************\
|
||||
@ -149,77 +151,81 @@ make_invalid_floating_point_number (words)
|
||||
|
||||
char * /* Return pointer past text consumed. */
|
||||
atof_ns32k (str, what_kind, words)
|
||||
char * str; /* Text to convert to binary. */
|
||||
char what_kind; /* 'd', 'f', 'g', 'h' */
|
||||
LITTLENUM_TYPE * words; /* Build the binary here. */
|
||||
char *str; /* Text to convert to binary. */
|
||||
char what_kind; /* 'd', 'f', 'g', 'h' */
|
||||
LITTLENUM_TYPE *words; /* Build the binary here. */
|
||||
{
|
||||
FLONUM_TYPE f;
|
||||
LITTLENUM_TYPE bits [MAX_PRECISION + MAX_PRECISION + GUARD];
|
||||
/* Extra bits for zeroed low-order bits. */
|
||||
/* The 1st MAX_PRECISION are zeroed, */
|
||||
/* the last contain flonum bits. */
|
||||
char * return_value;
|
||||
int precision; /* Number of 16-bit words in the format. */
|
||||
long int exponent_bits;
|
||||
FLONUM_TYPE f;
|
||||
LITTLENUM_TYPE bits[MAX_PRECISION + MAX_PRECISION + GUARD];
|
||||
/* Extra bits for zeroed low-order bits. */
|
||||
/* The 1st MAX_PRECISION are zeroed, */
|
||||
/* the last contain flonum bits. */
|
||||
char *return_value;
|
||||
int precision; /* Number of 16-bit words in the format. */
|
||||
long int exponent_bits;
|
||||
|
||||
long int exponent_1;
|
||||
long int exponent_2;
|
||||
long int exponent_3;
|
||||
long int exponent_4;
|
||||
int exponent_skippage;
|
||||
LITTLENUM_TYPE word1;
|
||||
LITTLENUM_TYPE * lp;
|
||||
long int exponent_1;
|
||||
long int exponent_2;
|
||||
long int exponent_3;
|
||||
long int exponent_4;
|
||||
int exponent_skippage;
|
||||
LITTLENUM_TYPE word1;
|
||||
LITTLENUM_TYPE *lp;
|
||||
|
||||
return_value = str;
|
||||
f.low = bits + MAX_PRECISION;
|
||||
f.high = NULL;
|
||||
f.leader = NULL;
|
||||
f.exponent = NULL;
|
||||
f.sign = '\0';
|
||||
return_value = str;
|
||||
f.low = bits + MAX_PRECISION;
|
||||
f.high = NULL;
|
||||
f.leader = NULL;
|
||||
f.exponent = NULL;
|
||||
f.sign = '\0';
|
||||
|
||||
/* Use more LittleNums than seems */
|
||||
/* necessary: the highest flonum may have */
|
||||
/* 15 leading 0 bits, so could be useless. */
|
||||
/* Use more LittleNums than seems */
|
||||
/* necessary: the highest flonum may have */
|
||||
/* 15 leading 0 bits, so could be useless. */
|
||||
|
||||
bzero (bits, sizeof(LITTLENUM_TYPE) * MAX_PRECISION);
|
||||
bzero (bits, sizeof (LITTLENUM_TYPE) * MAX_PRECISION);
|
||||
|
||||
switch(what_kind) {
|
||||
case 'f':
|
||||
precision = F_PRECISION;
|
||||
exponent_bits = 8;
|
||||
break;
|
||||
switch (what_kind)
|
||||
{
|
||||
case 'f':
|
||||
precision = F_PRECISION;
|
||||
exponent_bits = 8;
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
precision = D_PRECISION;
|
||||
exponent_bits = 11;
|
||||
break;
|
||||
case 'd':
|
||||
precision = D_PRECISION;
|
||||
exponent_bits = 11;
|
||||
break;
|
||||
|
||||
default:
|
||||
make_invalid_floating_point_number (words);
|
||||
return NULL;
|
||||
}
|
||||
default:
|
||||
make_invalid_floating_point_number (words);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
f.high = f.low + precision - 1 + GUARD;
|
||||
f.high = f.low + precision - 1 + GUARD;
|
||||
|
||||
if (atof_generic (& return_value, ".", EXP_CHARS, & f)) {
|
||||
as_warn("Error converting floating point number (Exponent overflow?)");
|
||||
make_invalid_floating_point_number (words);
|
||||
return NULL;
|
||||
}
|
||||
if (atof_generic (&return_value, ".", EXP_CHARS, &f))
|
||||
{
|
||||
as_warn ("Error converting floating point number (Exponent overflow?)");
|
||||
make_invalid_floating_point_number (words);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (f.low > f.leader) {
|
||||
/* 0.0e0 seen. */
|
||||
bzero (words, sizeof(LITTLENUM_TYPE) * precision);
|
||||
return return_value;
|
||||
}
|
||||
if (f.low > f.leader)
|
||||
{
|
||||
/* 0.0e0 seen. */
|
||||
bzero (words, sizeof (LITTLENUM_TYPE) * precision);
|
||||
return return_value;
|
||||
}
|
||||
|
||||
if(f.sign!='+' && f.sign!='-') {
|
||||
make_invalid_floating_point_number(words);
|
||||
return NULL;
|
||||
}
|
||||
if (f.sign != '+' && f.sign != '-')
|
||||
{
|
||||
make_invalid_floating_point_number (words);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* All vaxen floating_point formats (so far) have:
|
||||
* Bit 15 is sign bit.
|
||||
* Bits 14:n are excess-whatever exponent.
|
||||
@ -230,51 +236,53 @@ atof_ns32k (str, what_kind, 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;
|
||||
littlenums_left = 1 + f.leader-f.low;
|
||||
/* Seek (and forget) 1st significant bit */
|
||||
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;
|
||||
/* Radix 2. */
|
||||
exponent_3 = exponent_2 - exponent_skippage;
|
||||
/* Forget leading zeros, forget 1st bit. */
|
||||
exponent_4 = exponent_3 + ((1 << (exponent_bits - 1)) - 2);
|
||||
/* Offset exponent. */
|
||||
bits_left_in_littlenum = LITTLENUM_NUMBER_OF_BITS;
|
||||
littlenum_pointer = f.leader;
|
||||
littlenums_left = 1 + f.leader - f.low;
|
||||
/* Seek (and forget) 1st significant bit */
|
||||
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;
|
||||
/* Radix 2. */
|
||||
exponent_3 = exponent_2 - exponent_skippage;
|
||||
/* Forget leading zeros, forget 1st bit. */
|
||||
exponent_4 = exponent_3 + ((1 << (exponent_bits - 1)) - 2);
|
||||
/* Offset exponent. */
|
||||
|
||||
if (exponent_4 & ~ mask [exponent_bits]) {
|
||||
/*
|
||||
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
|
||||
* because we can't encode the number.
|
||||
*/
|
||||
|
||||
as_warn("Exponent overflow in floating-point number");
|
||||
make_invalid_floating_point_number (words);
|
||||
return return_value;
|
||||
}
|
||||
lp = words;
|
||||
as_warn ("Exponent overflow in floating-point number");
|
||||
make_invalid_floating_point_number (words);
|
||||
return return_value;
|
||||
}
|
||||
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;
|
||||
/* 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);
|
||||
/* 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)) {
|
||||
unsigned long int carry;
|
||||
/*
|
||||
if (next_bits (1))
|
||||
{
|
||||
unsigned long int carry;
|
||||
/*
|
||||
* Since the NEXT bit is a 1, round UP the mantissa.
|
||||
* The cunning design of these hidden-1 floats permits
|
||||
* us to let the mantissa overflow into the exponent, and
|
||||
@ -284,53 +292,56 @@ atof_ns32k (str, what_kind, words)
|
||||
*/
|
||||
|
||||
|
||||
/* #if (sizeof(carry)) < ((sizeof(bits[0]) * BITS_PER_CHAR) + 2)
|
||||
/* #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
|
||||
propagation. Another extra bit (kept 0) will assure us that we
|
||||
don't get a sticky sign bit after shifting right, and that
|
||||
permits us to propagate the carry without any masking of bits.
|
||||
#endif */
|
||||
for (carry = 1, lp --; carry && (lp >= words); lp --) {
|
||||
carry = * lp + carry;
|
||||
* lp = carry;
|
||||
carry >>= LITTLENUM_NUMBER_OF_BITS;
|
||||
}
|
||||
if ( (word1 ^ *words) & (1 << (LITTLENUM_NUMBER_OF_BITS - 1)) ) {
|
||||
/* We leave return_value alone: admit we read the
|
||||
for (carry = 1, lp--; carry && (lp >= words); lp--)
|
||||
{
|
||||
carry = *lp + carry;
|
||||
*lp = carry;
|
||||
carry >>= LITTLENUM_NUMBER_OF_BITS;
|
||||
}
|
||||
if ((word1 ^ *words) & (1 << (LITTLENUM_NUMBER_OF_BITS - 1)))
|
||||
{
|
||||
/* We leave return_value alone: admit we read the
|
||||
* number, but return a floating exception
|
||||
* because we can't encode the number.
|
||||
*/
|
||||
make_invalid_floating_point_number (words);
|
||||
return return_value;
|
||||
}
|
||||
make_invalid_floating_point_number (words);
|
||||
return return_value;
|
||||
}
|
||||
return (return_value);
|
||||
}
|
||||
return (return_value);
|
||||
}
|
||||
|
||||
/* This is really identical to atof_ns32k except for some details */
|
||||
|
||||
gen_to_words(words,precision,exponent_bits)
|
||||
LITTLENUM_TYPE *words;
|
||||
long int exponent_bits;
|
||||
gen_to_words (words, precision, exponent_bits)
|
||||
LITTLENUM_TYPE *words;
|
||||
long int exponent_bits;
|
||||
{
|
||||
int return_value=0;
|
||||
int return_value = 0;
|
||||
|
||||
long int exponent_1;
|
||||
long int exponent_2;
|
||||
long int exponent_3;
|
||||
long int exponent_4;
|
||||
int exponent_skippage;
|
||||
LITTLENUM_TYPE word1;
|
||||
LITTLENUM_TYPE * lp;
|
||||
long int exponent_1;
|
||||
long int exponent_2;
|
||||
long int exponent_3;
|
||||
long int exponent_4;
|
||||
int exponent_skippage;
|
||||
LITTLENUM_TYPE word1;
|
||||
LITTLENUM_TYPE *lp;
|
||||
|
||||
if (generic_floating_point_number.low > generic_floating_point_number.leader) {
|
||||
/* 0.0e0 seen. */
|
||||
bzero (words, sizeof(LITTLENUM_TYPE) * precision);
|
||||
return return_value;
|
||||
}
|
||||
if (generic_floating_point_number.low > generic_floating_point_number.leader)
|
||||
{
|
||||
/* 0.0e0 seen. */
|
||||
bzero (words, sizeof (LITTLENUM_TYPE) * precision);
|
||||
return return_value;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* All vaxen floating_point formats (so far) have:
|
||||
* Bit 15 is sign bit.
|
||||
* Bits 14:n are excess-whatever exponent.
|
||||
@ -341,51 +352,53 @@ long int exponent_bits;
|
||||
* So we need: number of bits of exponent, number of bits of
|
||||
* mantissa.
|
||||
*/
|
||||
bits_left_in_littlenum = LITTLENUM_NUMBER_OF_BITS;
|
||||
littlenum_pointer = generic_floating_point_number.leader;
|
||||
littlenums_left = 1+generic_floating_point_number.leader - generic_floating_point_number.low;
|
||||
/* Seek (and forget) 1st significant bit */
|
||||
for (exponent_skippage = 0;! next_bits(1); exponent_skippage ++)
|
||||
;
|
||||
exponent_1 = generic_floating_point_number.exponent + generic_floating_point_number.leader + 1 -
|
||||
generic_floating_point_number.low;
|
||||
/* Radix LITTLENUM_RADIX, point just higher than generic_floating_point_number.leader. */
|
||||
exponent_2 = exponent_1 * LITTLENUM_NUMBER_OF_BITS;
|
||||
/* Radix 2. */
|
||||
exponent_3 = exponent_2 - exponent_skippage;
|
||||
/* Forget leading zeros, forget 1st bit. */
|
||||
exponent_4 = exponent_3 + ((1 << (exponent_bits - 1)) - 2);
|
||||
/* Offset exponent. */
|
||||
bits_left_in_littlenum = LITTLENUM_NUMBER_OF_BITS;
|
||||
littlenum_pointer = generic_floating_point_number.leader;
|
||||
littlenums_left = 1 + generic_floating_point_number.leader - generic_floating_point_number.low;
|
||||
/* Seek (and forget) 1st significant bit */
|
||||
for (exponent_skippage = 0; !next_bits (1); exponent_skippage++)
|
||||
;
|
||||
exponent_1 = generic_floating_point_number.exponent + generic_floating_point_number.leader + 1 -
|
||||
generic_floating_point_number.low;
|
||||
/* Radix LITTLENUM_RADIX, point just higher than generic_floating_point_number.leader. */
|
||||
exponent_2 = exponent_1 * LITTLENUM_NUMBER_OF_BITS;
|
||||
/* Radix 2. */
|
||||
exponent_3 = exponent_2 - exponent_skippage;
|
||||
/* Forget leading zeros, forget 1st bit. */
|
||||
exponent_4 = exponent_3 + ((1 << (exponent_bits - 1)) - 2);
|
||||
/* Offset exponent. */
|
||||
|
||||
if (exponent_4 & ~ mask [exponent_bits]) {
|
||||
/*
|
||||
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
|
||||
* because we can't encode the number.
|
||||
*/
|
||||
|
||||
make_invalid_floating_point_number (words);
|
||||
return return_value;
|
||||
}
|
||||
lp = words;
|
||||
make_invalid_floating_point_number (words);
|
||||
return return_value;
|
||||
}
|
||||
lp = words;
|
||||
|
||||
/* Word 1. Sign, exponent and perhaps high bits. */
|
||||
/* Assume 2's complement integers. */
|
||||
word1 = ((exponent_4 & mask [exponent_bits]) << (15 - exponent_bits)) |
|
||||
((generic_floating_point_number.sign == '+') ? 0 : 0x8000) | next_bits (15 - exponent_bits);
|
||||
* lp ++ = word1;
|
||||
/* Word 1. Sign, exponent and perhaps high bits. */
|
||||
/* Assume 2's complement integers. */
|
||||
word1 = ((exponent_4 & mask[exponent_bits]) << (15 - exponent_bits)) |
|
||||
((generic_floating_point_number.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);
|
||||
/* 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)) {
|
||||
unsigned long int carry;
|
||||
/*
|
||||
if (next_bits (1))
|
||||
{
|
||||
unsigned long int carry;
|
||||
/*
|
||||
* Since the NEXT bit is a 1, round UP the mantissa.
|
||||
* The cunning design of these hidden-1 floats permits
|
||||
* us to let the mantissa overflow into the exponent, and
|
||||
@ -395,42 +408,45 @@ long int exponent_bits;
|
||||
*/
|
||||
|
||||
|
||||
/* #if (sizeof(carry)) < ((sizeof(bits[0]) * BITS_PER_CHAR) + 2)
|
||||
/* #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
|
||||
propagation. Another extra bit (kept 0) will assure us that we
|
||||
don't get a sticky sign bit after shifting right, and that
|
||||
permits us to propagate the carry without any masking of bits.
|
||||
#endif */
|
||||
for (carry = 1, lp --; carry && (lp >= words); lp --) {
|
||||
carry = * lp + carry;
|
||||
* lp = carry;
|
||||
carry >>= LITTLENUM_NUMBER_OF_BITS;
|
||||
}
|
||||
if ( (word1 ^ *words) & (1 << (LITTLENUM_NUMBER_OF_BITS - 1)) ) {
|
||||
/* We leave return_value alone: admit we read the
|
||||
for (carry = 1, lp--; carry && (lp >= words); lp--)
|
||||
{
|
||||
carry = *lp + carry;
|
||||
*lp = carry;
|
||||
carry >>= LITTLENUM_NUMBER_OF_BITS;
|
||||
}
|
||||
if ((word1 ^ *words) & (1 << (LITTLENUM_NUMBER_OF_BITS - 1)))
|
||||
{
|
||||
/* We leave return_value alone: admit we read the
|
||||
* number, but return a floating exception
|
||||
* because we can't encode the number.
|
||||
*/
|
||||
make_invalid_floating_point_number (words);
|
||||
return return_value;
|
||||
}
|
||||
make_invalid_floating_point_number (words);
|
||||
return return_value;
|
||||
}
|
||||
return (return_value);
|
||||
}
|
||||
return (return_value);
|
||||
}
|
||||
|
||||
/* This routine is a real kludge. Someone really should do it better, but
|
||||
I'm too lazy, and I don't understand this stuff all too well anyway
|
||||
(JF)
|
||||
*/
|
||||
void int_to_gen(x)
|
||||
long x;
|
||||
void
|
||||
int_to_gen (x)
|
||||
long x;
|
||||
{
|
||||
char buf[20];
|
||||
char *bufp;
|
||||
char buf[20];
|
||||
char *bufp;
|
||||
|
||||
sprintf(buf,"%ld",x);
|
||||
bufp= &buf[0];
|
||||
if(atof_generic(&bufp,".", EXP_CHARS, &generic_floating_point_number))
|
||||
as_warn("Error converting number to floating point (Exponent overflow?)");
|
||||
sprintf (buf, "%ld", x);
|
||||
bufp = &buf[0];
|
||||
if (atof_generic (&bufp, ".", EXP_CHARS, &generic_floating_point_number))
|
||||
as_warn ("Error converting number to floating point (Exponent overflow?)");
|
||||
}
|
||||
|
@ -1,18 +1,18 @@
|
||||
/* coff_gnu.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. */
|
||||
@ -30,15 +30,16 @@
|
||||
|
||||
/********************** FILE HEADER **********************/
|
||||
|
||||
struct filehdr {
|
||||
unsigned short f_magic; /* magic number */
|
||||
unsigned short f_nscns; /* number of sections */
|
||||
long f_timdat; /* time & date stamp */
|
||||
long f_symptr; /* file pointer to symtab */
|
||||
long f_nsyms; /* number of symtab entries */
|
||||
unsigned short f_opthdr; /* sizeof(optional hdr) */
|
||||
unsigned short f_flags; /* flags */
|
||||
};
|
||||
struct filehdr
|
||||
{
|
||||
unsigned short f_magic; /* magic number */
|
||||
unsigned short f_nscns; /* number of sections */
|
||||
long f_timdat; /* time & date stamp */
|
||||
long f_symptr; /* file pointer to symtab */
|
||||
long f_nsyms; /* number of symtab entries */
|
||||
unsigned short f_opthdr; /* sizeof(optional hdr) */
|
||||
unsigned short f_flags; /* flags */
|
||||
};
|
||||
|
||||
/* Bits for f_flags:
|
||||
* F_RELFLG relocation info stripped from file
|
||||
@ -53,23 +54,23 @@ struct filehdr {
|
||||
#define F_LSYMS (0x0008)
|
||||
|
||||
#ifdef TC_I960
|
||||
#define F_AR32WR (0x0010) /* File has 32 bits per word, least
|
||||
#define F_AR32WR (0x0010)/* File has 32 bits per word, least
|
||||
significant byte first. */
|
||||
#else /* TC_I960 */
|
||||
#define F_AR32WR (0x0100)
|
||||
#endif /* TC_I960 */
|
||||
|
||||
#define F_MINMAL (0x0010) /* ??? */
|
||||
#define F_UPDATE (0x0020) /* ??? */
|
||||
#define F_SWABD (0x0040) /* ??? */
|
||||
#define F_AR16WR (0x0080) /* File has the byte ordering used by
|
||||
#define F_MINMAL (0x0010)/* ??? */
|
||||
#define F_UPDATE (0x0020)/* ??? */
|
||||
#define F_SWABD (0x0040)/* ??? */
|
||||
#define F_AR16WR (0x0080)/* File has the byte ordering used by
|
||||
the PDP*-11/70 processor. */
|
||||
#define F_AR32W (0x0200) /* File has 32 bits per word, most
|
||||
#define F_AR32W (0x0200)/* File has 32 bits per word, most
|
||||
significant byte first. */
|
||||
|
||||
/*
|
||||
* 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 +106,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)
|
||||
@ -113,10 +114,13 @@ struct filehdr {
|
||||
|
||||
/********************** AOUT "OPTIONAL HEADER" **********************/
|
||||
|
||||
typedef struct {
|
||||
unsigned long phys_addr;
|
||||
unsigned long bitarray;
|
||||
} TAGBITS;
|
||||
typedef struct
|
||||
{
|
||||
unsigned long phys_addr;
|
||||
unsigned long bitarray;
|
||||
}
|
||||
|
||||
TAGBITS;
|
||||
|
||||
/* These appear to be used only by exec(2). I don't know who cares
|
||||
about them in a cross development environment. In any case, this
|
||||
@ -124,39 +128,42 @@ typedef struct {
|
||||
Apparently, most have these have remained essentially unchanged
|
||||
since v7 days, although a few new ones have been added. xoxorich. */
|
||||
|
||||
#define BAD0MAGIC (0401) /* (?) "lpd (UNIX/RT)" */
|
||||
#define BAD1MAGIC (0405) /* (?) overlay */
|
||||
#define OMAGIC (0407) /* old impure format. data immediately
|
||||
#define BAD0MAGIC (0401) /* (?) "lpd (UNIX/RT)" */
|
||||
#define BAD1MAGIC (0405) /* (?) overlay */
|
||||
#define OMAGIC (0407) /* old impure format. data immediately
|
||||
follows text. both sections are rw. */
|
||||
#define NMAGIC (0410) /* split i&d, read-only text */
|
||||
#define A_MAGIC3 (0411) /* (?) "separated I&D" */
|
||||
#define ZMAGIC (0413) /* like NMAGIC, but demand loaded */
|
||||
#define PAGEMAGIC2 (0414) /* (?) like ZMAGIC, but address zero
|
||||
#define NMAGIC (0410) /* split i&d, read-only text */
|
||||
#define A_MAGIC3 (0411) /* (?) "separated I&D" */
|
||||
#define ZMAGIC (0413) /* like NMAGIC, but demand loaded */
|
||||
#define PAGEMAGIC2 (0414) /* (?) like ZMAGIC, but address zero
|
||||
explicitly unmapped. */
|
||||
#define REGMAGIC (0414) /* (?) a PAGEMAGIC2 alias? */
|
||||
#define PAGEMAGIC3 (0415) /* (?) like ZMAGIC, but address zero mapped. */
|
||||
#define A_MAGIC5 (0437) /* (?) "system overlay, separated I&D" */
|
||||
#define REGMAGIC (0414) /* (?) a PAGEMAGIC2 alias? */
|
||||
#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 MASMAGIC (020000) /* (?) "Multiple (separate I & D) Address Spaces" */
|
||||
#define SASMAGIC (010000)/* Single Address Space */
|
||||
#define MASMAGIC (020000)/* (?) "Multiple (separate I & D) Address Spaces" */
|
||||
|
||||
typedef struct aouthdr {
|
||||
short magic; /* type of file */
|
||||
short vstamp; /* version stamp */
|
||||
unsigned long tsize; /* text size in bytes, padded to FW bdry*/
|
||||
unsigned long dsize; /* initialized data " " */
|
||||
unsigned long bsize; /* uninitialized data " " */
|
||||
typedef struct aouthdr
|
||||
{
|
||||
short magic; /* type of file */
|
||||
short vstamp; /* version stamp */
|
||||
unsigned long tsize; /* text size in bytes, padded to FW bdry*/
|
||||
unsigned long dsize; /* initialized data " " */
|
||||
unsigned long bsize; /* uninitialized data " " */
|
||||
#if U3B
|
||||
unsigned long dum1;
|
||||
unsigned long dum2; /* pad to entry point */
|
||||
unsigned long dum1;
|
||||
unsigned long dum2; /* pad to entry point */
|
||||
#endif
|
||||
unsigned long entry; /* entry pt. */
|
||||
unsigned long text_start; /* base of text used for this file */
|
||||
unsigned long data_start; /* base of data used for this file */
|
||||
/* CAREFUL: some formats omit the tagentries member. */
|
||||
unsigned long tagentries; /* number of tag entries to
|
||||
unsigned long entry; /* entry pt. */
|
||||
unsigned long text_start; /* base of text used for this file */
|
||||
unsigned long data_start; /* base of data used for this file */
|
||||
/* CAREFUL: some formats omit the tagentries member. */
|
||||
unsigned long tagentries; /* number of tag entries to
|
||||
follow (always zero for i960) */
|
||||
} AOUTHDR;
|
||||
}
|
||||
|
||||
AOUTHDR;
|
||||
|
||||
/* return a pointer to the tag bits array */
|
||||
|
||||
@ -197,10 +204,10 @@ typedef struct aouthdr {
|
||||
#endif /* TC_I960 */
|
||||
|
||||
#ifdef TC_A29K
|
||||
#define C_GLBLREG 19 /* global register */
|
||||
#define C_EXTREG 20 /* external global register */
|
||||
#define C_DEFREG 21 /* ext. def. of global register */
|
||||
#define C_STARTOF 22 /* as29 $SIZEOF and $STARTOF symbols */
|
||||
#define C_GLBLREG 19 /* global register */
|
||||
#define C_EXTREG 20 /* external global register */
|
||||
#define C_DEFREG 21 /* ext. def. of global register */
|
||||
#define C_STARTOF 22 /* as29 $SIZEOF and $STARTOF symbols */
|
||||
#endif /* TC_A29K */
|
||||
|
||||
#define C_BLOCK 100 /* ".bb" or ".eb" */
|
||||
@ -222,31 +229,32 @@ typedef struct aouthdr {
|
||||
#define C_DEFINE 110 /* Preprocessor #define */
|
||||
#define C_PRAGMA 111 /* Advice to compiler or linker */
|
||||
#define C_SEGMENT 112 /* 80960 segment name */
|
||||
#define C_LEAFSTAT 113 /* Static leaf */
|
||||
#define C_LEAFSTAT 113 /* Static leaf */
|
||||
#endif /* TC_I960 */
|
||||
|
||||
#ifdef TC_A29K
|
||||
#define C_SHADOW 107 /* shadow symbol */
|
||||
#define C_SHADOW 107 /* shadow symbol */
|
||||
#endif /* TC_A29K */
|
||||
|
||||
/********************** SECTION HEADER **********************/
|
||||
|
||||
struct scnhdr {
|
||||
char s_name[8]; /* section name */
|
||||
long s_paddr; /* physical address, aliased s_nlib */
|
||||
long s_vaddr; /* virtual address */
|
||||
long s_size; /* section size */
|
||||
long s_scnptr; /* file ptr to raw data for section */
|
||||
long s_relptr; /* file ptr to relocation */
|
||||
long s_lnnoptr; /* file ptr to line numbers */
|
||||
unsigned short s_nreloc; /* number of relocation entries */
|
||||
unsigned short s_nlnno; /* number of line number entries */
|
||||
long s_flags; /* flags */
|
||||
|
||||
struct scnhdr
|
||||
{
|
||||
char s_name[8]; /* section name */
|
||||
long s_paddr; /* physical address, aliased s_nlib */
|
||||
long s_vaddr; /* virtual address */
|
||||
long s_size; /* section size */
|
||||
long s_scnptr; /* file ptr to raw data for section */
|
||||
long s_relptr; /* file ptr to relocation */
|
||||
long s_lnnoptr; /* file ptr to line numbers */
|
||||
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 */
|
||||
unsigned long s_align; /* section alignment */
|
||||
#endif /* TC_I960 */
|
||||
};
|
||||
};
|
||||
|
||||
#define SCNHDR struct scnhdr
|
||||
#define SCNHSZ sizeof(SCNHDR)
|
||||
@ -254,12 +262,12 @@ struct scnhdr {
|
||||
/*
|
||||
* names of "special" sections
|
||||
*/
|
||||
#define _TEXT ".text" /* executable code section */
|
||||
#define _DATA ".data" /* initialized data */
|
||||
#define _BSS ".bss" /* un-initialized data */
|
||||
#define _DEBUG ".debug" /* special section used by dbx */
|
||||
#define _COMMENT ".comment" /* version info */
|
||||
#define _LIB ".lib" /* shared lib info section */
|
||||
#define _TEXT ".text" /* executable code section */
|
||||
#define _DATA ".data" /* initialized data */
|
||||
#define _BSS ".bss" /* un-initialized data */
|
||||
#define _DEBUG ".debug" /* special section used by dbx */
|
||||
#define _COMMENT ".comment" /* version info */
|
||||
#define _LIB ".lib" /* shared lib info section */
|
||||
#define _TV ".tv"
|
||||
|
||||
/*
|
||||
@ -275,25 +283,25 @@ struct scnhdr {
|
||||
* (at least for a29k. Maybe others.)
|
||||
*/
|
||||
|
||||
#define STYP_REG (0x0000) /* "regular" section: allocated, relocated, loaded */
|
||||
#define STYP_DSECT (0x0001) /* "dummy" section: not allocated, relocated, not loaded */
|
||||
#define STYP_NOLOAD (0x0002) /* "noload" section: allocated, relocated, not loaded */
|
||||
#define STYP_GROUP (0x0004) /* "grouped" section: formed of input sections */
|
||||
#define STYP_PAD (0x0008) /* "padding" section: not allocated, not relocated, loaded */
|
||||
#define STYP_COPY (0x0010) /* "copy" section: for decision function used by field update; not allocated, not relocated,
|
||||
#define STYP_REG (0x0000) /* "regular" section: allocated, relocated, loaded */
|
||||
#define STYP_DSECT (0x0001) /* "dummy" section: not allocated, relocated, not loaded */
|
||||
#define STYP_NOLOAD (0x0002) /* "noload" section: allocated, relocated, not loaded */
|
||||
#define STYP_GROUP (0x0004) /* "grouped" section: formed of input sections */
|
||||
#define STYP_PAD (0x0008) /* "padding" section: not allocated, not relocated, loaded */
|
||||
#define STYP_COPY (0x0010) /* "copy" section: for decision function used by field update; not allocated, not relocated,
|
||||
loaded; reloc & lineno entries processed normally */
|
||||
#define STYP_TEXT (0x0020) /* section contains text only */
|
||||
#define S_SHRSEG (0x0020) /* In 3b Update files (output of ogen), sections which appear in SHARED segments of the Pfile
|
||||
#define STYP_TEXT (0x0020) /* section contains text only */
|
||||
#define S_SHRSEG (0x0020) /* In 3b Update files (output of ogen), sections which appear in SHARED segments of the Pfile
|
||||
will have the S_SHRSEG flag set by ogen, to inform dufr that updating 1 copy of the proc. will
|
||||
update all process invocations. */
|
||||
#define STYP_DATA (0x0040) /* section contains data only */
|
||||
#define STYP_BSS (0x0080) /* section contains bss only */
|
||||
#define S_NEWFCN (0x0100) /* In a minimal file or an update file, a new function (as compared with a replaced function) */
|
||||
#define STYP_INFO (0x0200) /* comment section : not allocated not relocated, not loaded */
|
||||
#define STYP_OVER (0x0400) /* overlay section : relocated not allocated or loaded */
|
||||
#define STYP_LIB (0x0800) /* for .lib section : same as INFO */
|
||||
#define STYP_MERGE (0x2000) /* merge section -- combines with text, data or bss sections only */
|
||||
#define STYP_REVERSE_PAD (0x4000) /* section will be padded with no-op instructions wherever padding is necessary and there is a
|
||||
#define STYP_DATA (0x0040) /* section contains data only */
|
||||
#define STYP_BSS (0x0080) /* section contains bss only */
|
||||
#define S_NEWFCN (0x0100) /* In a minimal file or an update file, a new function (as compared with a replaced function) */
|
||||
#define STYP_INFO (0x0200) /* comment section : not allocated not relocated, not loaded */
|
||||
#define STYP_OVER (0x0400) /* overlay section : relocated not allocated or loaded */
|
||||
#define STYP_LIB (0x0800) /* for .lib section : same as INFO */
|
||||
#define STYP_MERGE (0x2000) /* merge section -- combines with text, data or bss sections only */
|
||||
#define STYP_REVERSE_PAD (0x4000) /* section will be padded with no-op instructions wherever padding is necessary and there is a
|
||||
word of contiguous bytes beginning on a word boundary. */
|
||||
|
||||
#ifdef TC_A29K
|
||||
@ -311,20 +319,23 @@ struct scnhdr {
|
||||
* grouping will have l_lnno = 0 and in place of physical address will be the
|
||||
* symbol table index of the function name.
|
||||
*/
|
||||
struct lineno {
|
||||
union {
|
||||
long l_symndx; /* symbol index of function name, iff l_lnno == 0*/
|
||||
long l_paddr; /* (physical) address of line number */
|
||||
} l_addr;
|
||||
unsigned short l_lnno; /* line number */
|
||||
struct lineno
|
||||
{
|
||||
union
|
||||
{
|
||||
long l_symndx; /* symbol index of function name, iff l_lnno == 0*/
|
||||
long l_paddr; /* (physical) address of line number */
|
||||
}
|
||||
l_addr;
|
||||
unsigned short l_lnno; /* line number */
|
||||
#ifdef TC_I960
|
||||
/* not used on a29k */
|
||||
char padding[2]; /* force alignment */
|
||||
/* not used on a29k */
|
||||
char padding[2]; /* force alignment */
|
||||
#endif /* TC_I960 */
|
||||
};
|
||||
};
|
||||
|
||||
#define LINENO struct lineno
|
||||
#define LINESZ sizeof(LINENO)
|
||||
#define LINESZ sizeof(LINENO)
|
||||
|
||||
|
||||
/********************** SYMBOLS **********************/
|
||||
@ -333,78 +344,83 @@ struct lineno {
|
||||
#define FILNMLEN 14 /* # characters in a file name */
|
||||
#define DIMNUM 4 /* # array dimensions in auxiliary entry */
|
||||
|
||||
struct syment {
|
||||
union {
|
||||
char _n_name[SYMNMLEN]; /* old COFF version */
|
||||
struct {
|
||||
long _n_zeroes; /* new == 0 */
|
||||
long _n_offset; /* offset into string table */
|
||||
} _n_n;
|
||||
char *_n_nptr[2]; /* allows for overlaying */
|
||||
} _n;
|
||||
long n_value; /* value of symbol */
|
||||
short n_scnum; /* section number */
|
||||
|
||||
struct syment
|
||||
{
|
||||
union
|
||||
{
|
||||
char _n_name[SYMNMLEN]; /* old COFF version */
|
||||
struct
|
||||
{
|
||||
long _n_zeroes; /* new == 0 */
|
||||
long _n_offset; /* offset into string table */
|
||||
}
|
||||
_n_n;
|
||||
char *_n_nptr[2]; /* allows for overlaying */
|
||||
}
|
||||
_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
|
||||
/* 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 */
|
||||
unsigned short n_flags; /* copy of flags from filhdr */
|
||||
#endif /* TC_I960 */
|
||||
|
||||
|
||||
#ifdef TC_A29K
|
||||
unsigned short n_type; /* type and derived type */
|
||||
unsigned short n_type; /* type and derived type */
|
||||
#else /* TC_A29K */
|
||||
/* at least i960 uses long */
|
||||
unsigned long n_type; /* type and derived type */
|
||||
/* 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 */
|
||||
|
||||
|
||||
char n_sclass; /* storage class */
|
||||
char n_numaux; /* number of aux. entries */
|
||||
|
||||
#ifndef TC_A29K
|
||||
char pad2[2]; /* force alignment */
|
||||
char pad2[2]; /* force alignment */
|
||||
#endif /* TC_A29K */
|
||||
};
|
||||
};
|
||||
|
||||
#define SYMENT struct syment
|
||||
#define SYMESZ sizeof(SYMENT) /* This had better also be sizeof(AUXENT) */
|
||||
#define SYMESZ sizeof(SYMENT) /* This had better also be sizeof(AUXENT) */
|
||||
|
||||
#define n_name _n._n_name
|
||||
#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 */
|
||||
#define N_DEBUG ((short)-2) /* debugging symbol -- symbol value is meaningless */
|
||||
#define N_TV ((short)-3) /* indicates symbol needs preload transfer vector */
|
||||
#define P_TV ((short)-4) /* indicates symbol needs transfer vector (postload) */
|
||||
|
||||
#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 */
|
||||
#define N_DEBUG ((short)-2) /* debugging symbol -- symbol value is meaningless */
|
||||
#define N_TV ((short)-3) /* indicates symbol needs preload transfer vector */
|
||||
#define P_TV ((short)-4) /* indicates symbol needs transfer vector (postload) */
|
||||
|
||||
/*
|
||||
* Type of a symbol, in low 4 bits of the word
|
||||
*/
|
||||
#define T_NULL 0 /* type not assigned */
|
||||
#define T_VOID 1 /* function argument (only used by compiler) (but now real void). */
|
||||
#define T_CHAR 2 /* character */
|
||||
#define T_SHORT 3 /* short integer */
|
||||
#define T_INT 4 /* integer */
|
||||
#define T_LONG 5 /* long integer */
|
||||
#define T_FLOAT 6 /* floating point */
|
||||
#define T_DOUBLE 7 /* double word */
|
||||
#define T_STRUCT 8 /* structure */
|
||||
#define T_UNION 9 /* union */
|
||||
#define T_ENUM 10 /* enumeration */
|
||||
#define T_MOE 11 /* member of enumeration */
|
||||
#define T_UCHAR 12 /* unsigned character */
|
||||
#define T_USHORT 13 /* unsigned short */
|
||||
#define T_UINT 14 /* unsigned integer */
|
||||
#define T_ULONG 15 /* unsigned long */
|
||||
#define T_NULL 0 /* type not assigned */
|
||||
#define T_VOID 1 /* function argument (only used by compiler) (but now real void). */
|
||||
#define T_CHAR 2 /* character */
|
||||
#define T_SHORT 3 /* short integer */
|
||||
#define T_INT 4 /* integer */
|
||||
#define T_LONG 5 /* long integer */
|
||||
#define T_FLOAT 6 /* floating point */
|
||||
#define T_DOUBLE 7 /* double word */
|
||||
#define T_STRUCT 8 /* structure */
|
||||
#define T_UNION 9 /* union */
|
||||
#define T_ENUM 10 /* enumeration */
|
||||
#define T_MOE 11 /* member of enumeration */
|
||||
#define T_UCHAR 12 /* unsigned character */
|
||||
#define T_USHORT 13 /* unsigned short */
|
||||
#define T_UINT 14 /* unsigned integer */
|
||||
#define T_ULONG 15 /* unsigned long */
|
||||
|
||||
#ifdef TC_I960
|
||||
#define T_LNGDBL 16 /* long double */
|
||||
@ -442,76 +458,103 @@ struct syment {
|
||||
|
||||
#define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
|
||||
|
||||
union auxent {
|
||||
struct {
|
||||
long x_tagndx; /* str, un, or enum tag indx */
|
||||
union {
|
||||
struct {
|
||||
unsigned short x_lnno; /* declaration line number */
|
||||
unsigned short x_size; /* str/union/array size */
|
||||
} x_lnsz;
|
||||
long x_fsize; /* size of function */
|
||||
} x_misc;
|
||||
union {
|
||||
struct { /* if ISFCN, tag, or .bb */
|
||||
long x_lnnoptr; /* ptr to fcn line # */
|
||||
long x_endndx; /* entry ndx past block end */
|
||||
} x_fcn;
|
||||
struct { /* if ISARY, up to 4 dimen. */
|
||||
unsigned short x_dimen[DIMNUM];
|
||||
} x_ary;
|
||||
} 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];
|
||||
struct {
|
||||
long x_zeroes;
|
||||
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)) */
|
||||
|
||||
union auxent
|
||||
{
|
||||
struct
|
||||
{
|
||||
long x_tagndx; /* str, un, or enum tag indx */
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
unsigned short x_lnno; /* declaration line number */
|
||||
unsigned short x_size; /* str/union/array size */
|
||||
}
|
||||
x_lnsz;
|
||||
long x_fsize; /* size of function */
|
||||
}
|
||||
x_misc;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{ /* if ISFCN, tag, or .bb */
|
||||
long x_lnnoptr; /* ptr to fcn line # */
|
||||
long x_endndx; /* entry ndx past block end */
|
||||
}
|
||||
x_fcn;
|
||||
struct
|
||||
{ /* if ISARY, up to 4 dimen. */
|
||||
unsigned short x_dimen[DIMNUM];
|
||||
}
|
||||
x_ary;
|
||||
}
|
||||
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];
|
||||
struct
|
||||
{
|
||||
long x_zeroes;
|
||||
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
|
||||
******************************************/
|
||||
struct {
|
||||
/* This is a very old typo that keeps getting propogated. */
|
||||
struct
|
||||
{
|
||||
/* This is a very old typo that keeps getting propogated. */
|
||||
#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 */
|
||||
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 */
|
||||
};
|
||||
};
|
||||
|
||||
#define AUXENT union auxent
|
||||
#define AUXESZ sizeof(AUXENT) /* This had better also be sizeof(SYMENT) */
|
||||
#define AUXESZ sizeof(AUXENT) /* This had better also be sizeof(SYMENT) */
|
||||
|
||||
#if VAX || I960
|
||||
# define _ETEXT "_etext"
|
||||
@ -521,20 +564,21 @@ union auxent {
|
||||
|
||||
/********************** RELOCATION DIRECTIVES **********************/
|
||||
|
||||
struct reloc {
|
||||
long r_vaddr; /* Virtual address of reference */
|
||||
long r_symndx; /* Index into symbol table */
|
||||
unsigned short r_type; /* Relocation type */
|
||||
struct reloc
|
||||
{
|
||||
long r_vaddr; /* Virtual address of reference */
|
||||
long r_symndx; /* Index into symbol table */
|
||||
unsigned short r_type; /* Relocation type */
|
||||
#ifdef TC_I960
|
||||
/* not used for a29k */
|
||||
char pad[2]; /* Unused */
|
||||
/* not used for a29k */
|
||||
char pad[2]; /* Unused */
|
||||
#endif /* TC_I960 */
|
||||
};
|
||||
};
|
||||
|
||||
#define RELOC struct reloc
|
||||
#define RELSZ sizeof(RELOC)
|
||||
|
||||
#define R_ABS (0x00) /* reference is absolute */
|
||||
#define R_ABS (0x00) /* reference is absolute */
|
||||
|
||||
#ifdef TC_I960
|
||||
#define R_RELLONG (0x11) /* Direct 32-bit relocation */
|
||||
@ -567,18 +611,18 @@ struct reloc {
|
||||
* constant fields of the instruction are set to zero.
|
||||
*/
|
||||
|
||||
#define R_IREL (0x18) /* instruction relative (jmp/call) */
|
||||
#define R_IABS (0x19) /* instruction absolute (jmp/call) */
|
||||
#define R_ILOHALF (0x1a) /* instruction low half (const) */
|
||||
#define R_IHIHALF (0x1b) /* instruction high half (consth) part 1 */
|
||||
#define R_IHCONST (0x1c) /* instruction high half (consth) part 2
|
||||
#define R_IREL (0x18) /* instruction relative (jmp/call) */
|
||||
#define R_IABS (0x19) /* instruction absolute (jmp/call) */
|
||||
#define R_ILOHALF (0x1a) /* instruction low half (const) */
|
||||
#define R_IHIHALF (0x1b) /* instruction high half (consth) part 1 */
|
||||
#define R_IHCONST (0x1c) /* instruction high half (consth) part 2
|
||||
constant offset of R_IHIHALF relocation */
|
||||
#define R_BYTE (0x1d) /* relocatable byte value */
|
||||
#define R_HWORD (0x1e) /* relocatable halfword value */
|
||||
#define R_WORD (0x1f) /* relocatable word value */
|
||||
#define R_IGLBLRC (0x20) /* instruction global register RC */
|
||||
#define R_IGLBLRA (0x21) /* instruction global register RA */
|
||||
#define R_IGLBLRB (0x22) /* instruction global register RB */
|
||||
#define R_BYTE (0x1d) /* relocatable byte value */
|
||||
#define R_HWORD (0x1e) /* relocatable halfword value */
|
||||
#define R_WORD (0x1f) /* relocatable word value */
|
||||
#define R_IGLBLRC (0x20) /* instruction global register RC */
|
||||
#define R_IGLBLRA (0x21) /* instruction global register RA */
|
||||
#define R_IGLBLRB (0x22) /* instruction global register RB */
|
||||
#endif /* TC_A29K */
|
||||
|
||||
|
||||
@ -592,7 +636,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 +669,7 @@ struct reloc {
|
||||
#define R_IND24 015
|
||||
#define R_IND32 016
|
||||
|
||||
/*
|
||||
/*
|
||||
* XL generics
|
||||
* 10-bit direct reference
|
||||
* 10-bit "relative" reference
|
||||
@ -646,34 +690,35 @@ struct reloc {
|
||||
* 32-bit direct reference with bytes swapped
|
||||
*/
|
||||
#define R_DIR32S 012
|
||||
|
||||
|
||||
#endif /* TC_I386 */
|
||||
|
||||
#if defined(TE_I386AIX)
|
||||
|
||||
#define UINFOSIZ 64 /* size of user info buffer */
|
||||
#define UINFOSIZ 64 /* size of user info buffer */
|
||||
typedef char uinfo_t[UINFOSIZ];
|
||||
|
||||
struct env387 {
|
||||
unsigned short control;
|
||||
unsigned short r0;
|
||||
unsigned short status;
|
||||
unsigned short r1;
|
||||
unsigned short tag;
|
||||
unsigned short r2;
|
||||
unsigned long eip;
|
||||
unsigned short code_seg;
|
||||
unsigned short opcode;
|
||||
unsigned long operand;
|
||||
unsigned short operand_seg;
|
||||
unsigned short r3;
|
||||
unsigned char regs[8][10];
|
||||
};
|
||||
struct env387
|
||||
{
|
||||
unsigned short control;
|
||||
unsigned short r0;
|
||||
unsigned short status;
|
||||
unsigned short r1;
|
||||
unsigned short tag;
|
||||
unsigned short r2;
|
||||
unsigned long eip;
|
||||
unsigned short code_seg;
|
||||
unsigned short opcode;
|
||||
unsigned long operand;
|
||||
unsigned short operand_seg;
|
||||
unsigned short r3;
|
||||
unsigned char regs[8][10];
|
||||
};
|
||||
|
||||
#define CD_NAMELEN 16 /* length of most names in this header */
|
||||
#define CORHDRSIZ 2048 /* size to which header is padded out */
|
||||
#define MAX_CORE_SEGS 32 /* maximum segments in a core dump */
|
||||
#define NUM_FREGS 1 /* # of saved FP regs */
|
||||
#define CD_NAMELEN 16 /* length of most names in this header */
|
||||
#define CORHDRSIZ 2048 /* size to which header is padded out */
|
||||
#define MAX_CORE_SEGS 32 /* maximum segments in a core dump */
|
||||
#define NUM_FREGS 1 /* # of saved FP regs */
|
||||
|
||||
/*
|
||||
* These are defined such that 286 and 386 kernels can produce
|
||||
@ -698,64 +743,74 @@ struct env387 {
|
||||
#define NUM_REGS 16
|
||||
|
||||
#ifndef SPATHLEN
|
||||
# define SPATHLEN 16 /* sys/param.h */
|
||||
# define SPATHLEN 16 /* sys/param.h */
|
||||
#endif
|
||||
#ifndef NSIG
|
||||
# define NSIG 63 /* sys/signal.h */
|
||||
# define NSIG 63 /* sys/signal.h */
|
||||
# define SIGSETSZ ((NSIG+31)/32)
|
||||
typedef struct ksigmask {
|
||||
unsigned long sigs[SIGSETSZ];
|
||||
} ksigmask_t;
|
||||
typedef struct ksigmask
|
||||
{
|
||||
unsigned long sigs[SIGSETSZ];
|
||||
}
|
||||
|
||||
ksigmask_t;
|
||||
#endif
|
||||
|
||||
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 */
|
||||
long cs_len; /* length (in bytes) of segment */
|
||||
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 */
|
||||
char cd_site[CD_NAMELEN]; /* name of site it ran on */
|
||||
long cd_ldtype; /* type of load module running */
|
||||
char cd_intsize; /* sizeof(int) */
|
||||
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 */
|
||||
unsigned short cd_spath[SPATHLEN]; /* sitepath */
|
||||
};
|
||||
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 */
|
||||
long cs_len; /* length (in bytes) of segment */
|
||||
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 */
|
||||
char cd_site[CD_NAMELEN]; /* name of site it ran on */
|
||||
long cd_ldtype; /* type of load module running */
|
||||
char cd_intsize; /* sizeof(int) */
|
||||
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 */
|
||||
unsigned short cd_spath[SPATHLEN]; /* sitepath */
|
||||
};
|
||||
|
||||
#ifndef NOCHECKS
|
||||
/* this will generate an error if sizeof(struct corehdr) > CORHDRSIZ */
|
||||
struct { char xxcdxx[CORHDRSIZ+1-sizeof(struct corehdr)]; };
|
||||
#endif /* ! NOCHECKS */
|
||||
struct
|
||||
{
|
||||
char xxcdxx[CORHDRSIZ + 1 - sizeof (struct corehdr)];
|
||||
};
|
||||
|
||||
#endif /* ! NOCHECKS */
|
||||
|
||||
/*
|
||||
* segment types (in cs_type)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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. */
|
||||
|
@ -1,26 +1,26 @@
|
||||
/* 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. */
|
||||
|
||||
#include <string.h>
|
||||
|
||||
extern char *malloc();
|
||||
extern int free();
|
||||
extern char *malloc ();
|
||||
extern int free ();
|
||||
|
||||
#if !defined(__GNUC__)
|
||||
#define know(x)
|
||||
|
@ -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. */
|
||||
@ -25,6 +25,6 @@
|
||||
|
||||
#define HAVE_STRERROR
|
||||
|
||||
extern int free();
|
||||
extern int free ();
|
||||
|
||||
/* end of ho-generic.h */
|
||||
|
@ -19,7 +19,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#define HO_I386 1
|
||||
|
||||
extern void free();
|
||||
extern void *malloc();
|
||||
extern void free ();
|
||||
extern void *malloc ();
|
||||
|
||||
/* end of ho-go32.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. */
|
||||
|
@ -1,18 +1,18 @@
|
||||
/* 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. */
|
||||
|
@ -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. */
|
||||
|
@ -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. */
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include <ho-sunos.h>
|
||||
|
||||
extern int sprintf();
|
||||
extern int sprintf ();
|
||||
|
||||
/* end of ho-sun386.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. */
|
||||
@ -24,7 +24,7 @@
|
||||
#if !defined(__GNUC__) && (__STDC__ != 1)
|
||||
#include <memory.h>
|
||||
#else
|
||||
extern int memset();
|
||||
extern int memset ();
|
||||
#endif
|
||||
|
||||
/* #include <sys/stdtypes.h> before <stddef.h> when compiling by GCC. */
|
||||
@ -37,38 +37,38 @@ extern int memset();
|
||||
|
||||
/*extern int abort();*/
|
||||
/*extern int exit();*/
|
||||
extern char *malloc();
|
||||
extern char *realloc();
|
||||
extern char *strchr();
|
||||
extern char *strrchr();
|
||||
extern int _filbuf();
|
||||
extern int _flsbuf();
|
||||
extern int fclose();
|
||||
extern int fgetc();
|
||||
extern int fprintf();
|
||||
extern int fread();
|
||||
extern int free();
|
||||
extern int perror();
|
||||
extern int printf();
|
||||
extern int rewind();
|
||||
extern int setvbuf();
|
||||
extern int sscanf();
|
||||
extern int strcmp();
|
||||
extern int strlen();
|
||||
extern int strncmp();
|
||||
extern int time();
|
||||
extern int ungetc();
|
||||
extern int vfprintf();
|
||||
extern int vprintf();
|
||||
extern int vsprintf();
|
||||
extern long atol();
|
||||
extern char *malloc ();
|
||||
extern char *realloc ();
|
||||
extern char *strchr ();
|
||||
extern char *strrchr ();
|
||||
extern int _filbuf ();
|
||||
extern int _flsbuf ();
|
||||
extern int fclose ();
|
||||
extern int fgetc ();
|
||||
extern int fprintf ();
|
||||
extern int fread ();
|
||||
extern int free ();
|
||||
extern int perror ();
|
||||
extern int printf ();
|
||||
extern int rewind ();
|
||||
extern int setvbuf ();
|
||||
extern int sscanf ();
|
||||
extern int strcmp ();
|
||||
extern int strlen ();
|
||||
extern int strncmp ();
|
||||
extern int time ();
|
||||
extern int ungetc ();
|
||||
extern int vfprintf ();
|
||||
extern int vprintf ();
|
||||
extern int vsprintf ();
|
||||
extern long atol ();
|
||||
|
||||
#ifndef tolower
|
||||
extern int tolower();
|
||||
extern int tolower ();
|
||||
#endif /* tolower */
|
||||
|
||||
#ifndef toupper
|
||||
extern int toupper();
|
||||
extern int toupper ();
|
||||
#endif /* toupper */
|
||||
|
||||
/*
|
||||
|
@ -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. */
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
#define setbuffer(stream, buf, size) setvbuf((stream), (buf), _IOLBF, (size))
|
||||
|
||||
extern int free();
|
||||
extern char *malloc();
|
||||
extern int free ();
|
||||
extern char *malloc ();
|
||||
|
||||
/* end of ho-sysv.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. */
|
||||
@ -23,7 +23,7 @@
|
||||
#define NO_STDARG
|
||||
#endif /* not ansi */
|
||||
|
||||
extern char *malloc();
|
||||
extern int free();
|
||||
extern char *malloc ();
|
||||
extern int free ();
|
||||
|
||||
/* end of ho-vax.h */
|
||||
|
@ -47,9 +47,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
struct m88k_opcode
|
||||
{
|
||||
unsigned int opcode;
|
||||
char *name;
|
||||
char *op_spec;
|
||||
unsigned int opcode;
|
||||
char *name;
|
||||
char *op_spec;
|
||||
};
|
||||
|
||||
/* and introducing... the Motorola 88100 instruction sets... */
|
||||
@ -67,216 +67,216 @@ struct m88k_opcode
|
||||
|
||||
static struct m88k_opcode m88k_opcodes[] =
|
||||
{
|
||||
/* Opcode Mnemonic Opspec */
|
||||
/* Opcode Mnemonic Opspec */
|
||||
|
||||
_MC88xxx(0xf4007000, "add", "d,1,2")
|
||||
_MC88xxx(0x70000000, "add", "d,1,I")
|
||||
_MC88xxx(0xf4007200, "add.ci", "d,1,2")
|
||||
_MC88xxx(0xf4007300, "add.cio", "d,1,2")
|
||||
_MC88xxx(0xf4007100, "add.co", "d,1,2")
|
||||
_MC88xxx(0xf4006000, "addu", "d,1,2")
|
||||
_MC88xxx(0x60000000, "addu", "d,1,I")
|
||||
_MC88xxx(0xf4006200, "addu.ci", "d,1,2")
|
||||
_MC88xxx(0xf4006300, "addu.cio", "d,1,2")
|
||||
_MC88xxx(0xf4006100, "addu.co", "d,1,2")
|
||||
_MC88xxx(0xf4004000, "and", "d,1,2")
|
||||
_MC88xxx(0x40000000, "and", "d,1,I")
|
||||
_MC88xxx(0xf4004400, "and.c", "d,1,2")
|
||||
_MC88xxx(0x44000000, "and.u", "d,1,I")
|
||||
_MC88xxx(0xd0000000, "bb0", "B,1,p")
|
||||
_MC88xxx(0xd4000000, "bb0.n", "B,1,p")
|
||||
_MC88xxx(0xd8000000, "bb1", "B,1,p")
|
||||
_MC88xxx(0xdc000000, "bb1.n", "B,1,p")
|
||||
_MC88xxx(0xe8000000, "bcnd", "M,1,p")
|
||||
_MC88xxx(0xec000000, "bcnd.n", "M,1,p")
|
||||
_MC88xxx(0xc0000000, "br", "P")
|
||||
_MC88xxx(0xc4000000, "br.n", "P")
|
||||
_MC88xxx(0xc8000000, "bsr", "P")
|
||||
_MC88xxx(0xcc000000, "bsr.n", "P")
|
||||
_MC88xxx(0xf4008000, "clr", "d,1,2")
|
||||
_MC88xxx(0xf0008000, "clr", "d,1,b")
|
||||
_MC88xxx(0xf4007c00, "cmp", "d,1,2")
|
||||
_MC88xxx(0x7c000000, "cmp", "d,1,I")
|
||||
_MC88xxx(0xf4007800, "div", "d,1,2")
|
||||
_MC88xxx(0x78000000, "div", "d,1,I")
|
||||
_MC88xxx(0xf4007800, "divs", "d,1,2")
|
||||
_MC88xxx(0x78000000, "divs", "d,1,I")
|
||||
_MC88xxx(0xf4006800, "divu", "d,1,2")
|
||||
_MC88xxx(0x68000000, "divu", "d,1,I")
|
||||
_MC88xxx(0xf4009000, "ext", "d,1,2")
|
||||
_MC88xxx(0xf0009000, "ext", "d,1,b")
|
||||
_MC88xxx(0xf4009800, "extu", "d,1,2")
|
||||
_MC88xxx(0xf0009800, "extu", "d,1,b")
|
||||
_MC88xxx(0x84002800, "fadd.sss", "d,1,2")
|
||||
_MC88xxx(0x84002880, "fadd.ssd", "d,1,2")
|
||||
_MC88xxx(0x84002a00, "fadd.sds", "d,1,2")
|
||||
_MC88xxx(0x84002a80, "fadd.sdd", "d,1,2")
|
||||
_MC88xxx(0x84002820, "fadd.dss", "d,1,2")
|
||||
_MC88xxx(0x840028a0, "fadd.dsd", "d,1,2")
|
||||
_MC88xxx(0x84002a20, "fadd.dds", "d,1,2")
|
||||
_MC88xxx(0x84002aa0, "fadd.ddd", "d,1,2")
|
||||
_MC88xxx(0x84003a80, "fcmp.sdd", "d,1,2")
|
||||
_MC88xxx(0x84003a00, "fcmp.sds", "d,1,2")
|
||||
_MC88xxx(0x84003880, "fcmp.ssd", "d,1,2")
|
||||
_MC88xxx(0x84003800, "fcmp.sss", "d,1,2")
|
||||
_MC88xxx(0x84007000, "fdiv.sss", "d,1,2")
|
||||
_MC88xxx(0x84007080, "fdiv.ssd", "d,1,2")
|
||||
_MC88xxx(0x84007200, "fdiv.sds", "d,1,2")
|
||||
_MC88xxx(0x84007280, "fdiv.sdd", "d,1,2")
|
||||
_MC88xxx(0x84007020, "fdiv.dss", "d,1,2")
|
||||
_MC88xxx(0x840070a0, "fdiv.dsd", "d,1,2")
|
||||
_MC88xxx(0x84007220, "fdiv.dds", "d,1,2")
|
||||
_MC88xxx(0x840072a0, "fdiv.ddd", "d,1,2")
|
||||
_MC88xxx(0xf400ec00, "ff0", "d,2")
|
||||
_MC88xxx(0xf400e800, "ff1", "d,2")
|
||||
_MC88xxx(0x80004800, "fldcr", "d,f")
|
||||
_MC88xxx(0x84002020, "flt.ds", "d,2")
|
||||
_MC88xxx(0x84002000, "flt.ss", "d,2")
|
||||
_MC88xxx(0x84000000, "fmul.sss", "d,1,2")
|
||||
_MC88xxx(0x84000080, "fmul.ssd", "d,1,2")
|
||||
_MC88xxx(0x84000200, "fmul.sds", "d,1,2")
|
||||
_MC88xxx(0x84000280, "fmul.sdd", "d,1,2")
|
||||
_MC88xxx(0x84000020, "fmul.dss", "d,1,2")
|
||||
_MC88xxx(0x840000a0, "fmul.dsd", "d,1,2")
|
||||
_MC88xxx(0x84000220, "fmul.dds", "d,1,2")
|
||||
_MC88xxx(0x840002a0, "fmul.ddd", "d,1,2")
|
||||
_MC88xxx(0x80008800, "fstcr", "3,f")
|
||||
_MC88xxx(0x84003000, "fsub.sss", "d,1,2")
|
||||
_MC88xxx(0x84003080, "fsub.ssd", "d,1,2")
|
||||
_MC88xxx(0x84003200, "fsub.sds", "d,1,2")
|
||||
_MC88xxx(0x84003280, "fsub.sdd", "d,1,2")
|
||||
_MC88xxx(0x84003020, "fsub.dss", "d,1,2")
|
||||
_MC88xxx(0x840030a0, "fsub.dsd", "d,1,2")
|
||||
_MC88xxx(0x84003220, "fsub.dds", "d,1,2")
|
||||
_MC88xxx(0x840032a0, "fsub.ddd", "d,1,2")
|
||||
_MC88xxx(0x8000c800, "fxcr", "d,3,f")
|
||||
_MC88xxx(0x8400fc01, "illop1", "")
|
||||
_MC88xxx(0x8400fc02, "illop2", "")
|
||||
_MC88xxx(0x8400fc03, "illop3", "")
|
||||
_MC88xxx(0x84004880, "int.sd", "d,2")
|
||||
_MC88xxx(0x84004800, "int.ss", "d,2")
|
||||
_MC88xxx(0xf400c000, "jmp", "2")
|
||||
_MC88xxx(0xf400c400, "jmp.n", "2")
|
||||
_MC88xxx(0xf400c800, "jsr", "2")
|
||||
_MC88xxx(0xf400cc00, "jsr.n", "2")
|
||||
_MC88xxx(0xf4001400, "ld", "d,1,2")
|
||||
_MC88xxx(0xf4001600, "ld", "d,1[2]")
|
||||
_MC88xxx(0x14000000, "ld", "d,1,I")
|
||||
_MC88xxx(0xf4001e00, "ld.b", "d,1[2]")
|
||||
_MC88xxx(0xf4001c00, "ld.b", "d,1,2")
|
||||
_MC88xxx(0x1c000000, "ld.b", "d,1,I")
|
||||
_MC88xxx(0xf4001d00, "ld.b.usr", "d,1,2")
|
||||
_MC88xxx(0xf4001f00, "ld.b.usr", "d,1[2]")
|
||||
_MC88xxx(0xf4000e00, "ld.bu", "d,1[2]")
|
||||
_MC88xxx(0xf4000c00, "ld.bu", "d,1,2")
|
||||
_MC88xxx(0x0c000000, "ld.bu", "d,1,I")
|
||||
_MC88xxx(0xf4000d00, "ld.bu.usr", "d,1,2")
|
||||
_MC88xxx(0xf4000f00, "ld.bu.usr", "d,1[2]")
|
||||
_MC88xxx(0xf4001200, "ld.d", "d,1[2]")
|
||||
_MC88xxx(0xf4001000, "ld.d", "d,1,2")
|
||||
_MC88xxx(0x10000000, "ld.d", "d,1,I")
|
||||
_MC88xxx(0xf4001100, "ld.d.usr", "d,1,2")
|
||||
_MC88xxx(0xf4001300, "ld.d.usr", "d,1[2]")
|
||||
_MC88xxx(0xf4001a00, "ld.h", "d,1[2]")
|
||||
_MC88xxx(0xf4001800, "ld.h", "d,1,2")
|
||||
_MC88xxx(0x18000000, "ld.h", "d,1,I")
|
||||
_MC88xxx(0xf4001900, "ld.h.usr", "d,1,2")
|
||||
_MC88xxx(0xf4001b00, "ld.h.usr", "d,1[2]")
|
||||
_MC88xxx(0xf4000a00, "ld.hu", "d,1[2]")
|
||||
_MC88xxx(0xf4000800, "ld.hu", "d,1,2")
|
||||
_MC88xxx(0x08000000, "ld.hu", "d,1,I")
|
||||
_MC88xxx(0xf4000900, "ld.hu.usr", "d,1,2")
|
||||
_MC88xxx(0xf4000b00, "ld.hu.usr", "d,1[2]")
|
||||
_MC88xxx(0xf4001500, "ld.usr", "d,1,2")
|
||||
_MC88xxx(0xf4001700, "ld.usr", "d,1[2]")
|
||||
_MC88xxx(0xf4003600, "lda", "d,1[2]")
|
||||
_MC88xxx(0xf4006000, "lda", "?d,1,2") /* Output addu */
|
||||
_MC88xxx(0x60000000, "lda", "?d,1,I") /* Output addu */
|
||||
_MC88xxx(0xf4006000, "lda.b", "?d,1[2]") /* Output addu */
|
||||
_MC88xxx(0xf4006000, "lda.b", "?d,1,2") /* Output addu */
|
||||
_MC88xxx(0x60000000, "lda.b", "?d,1,I") /* Output addu */
|
||||
_MC88xxx(0xf4003200, "lda.d", "d,1[2]")
|
||||
_MC88xxx(0xf4006000, "lda.d", "?d,1,2") /* Output addu */
|
||||
_MC88xxx(0x60000000, "lda.d", "?d,1,I") /* Output addu */
|
||||
_MC88xxx(0xf4003a00, "lda.h", "d,1[2]")
|
||||
_MC88xxx(0xf4006000, "lda.h", "?d,1,2") /* Output addu */
|
||||
_MC88xxx(0x60000000, "lda.h", "?d,1,I") /* Output addu */
|
||||
_MC88xxx(0x80004000, "ldcr", "d,c")
|
||||
_MC88xxx(0xf400a000, "mak", "d,1,2")
|
||||
_MC88xxx(0xf000a000, "mak", "d,1,b")
|
||||
_MC88xxx(0x48000000, "mask", "d,1,I")
|
||||
_MC88xxx(0x4c000000, "mask.u", "d,1,I")
|
||||
_MC88xxx(0xf4006c00, "mul", "d,1,2")
|
||||
_MC88xxx(0x6c000000, "mul", "d,1,I")
|
||||
_MC88xxx(0xf4006c00, "mulu", "d,1,2") /* synonym for mul */
|
||||
_MC88xxx(0x6c000000, "mulu", "d,1,I") /* synonym for mul */
|
||||
_MC88xxx(0x84005080, "nint.sd", "d,2")
|
||||
_MC88xxx(0x84005000, "nint.ss", "d,2")
|
||||
_MC88xxx(0xf4005800, "or", "d,1,2")
|
||||
_MC88xxx(0x58000000, "or", "d,1,I")
|
||||
_MC88xxx(0xf4005c00, "or.c", "d,1,2")
|
||||
_MC88xxx(0x5c000000, "or.u", "d,1,I")
|
||||
_MC88xxx(0xf000a800, "rot", "d,1,b")
|
||||
_MC88xxx(0xf400a800, "rot", "d,1,2")
|
||||
_MC88xxx(0xf400fc00, "rte", "")
|
||||
_MC88xxx(0xf4008800, "set", "d,1,2")
|
||||
_MC88xxx(0xf0008800, "set", "d,1,b")
|
||||
_MC88xxx(0xf4002600, "st", "d,1[2]")
|
||||
_MC88xxx(0xf4002400, "st", "d,1,2")
|
||||
_MC88xxx(0x24000000, "st", "d,1,I")
|
||||
_MC88xxx(0xf4002e00, "st.b", "d,1[2]")
|
||||
_MC88xxx(0xf4002c00, "st.b", "d,1,2")
|
||||
_MC88xxx(0x2c000000, "st.b", "d,1,I")
|
||||
_MC88xxx(0xf4002d00, "st.b.usr", "d,1,2")
|
||||
_MC88xxx(0xf4002f00, "st.b.usr", "d,1[2]")
|
||||
_MC88xxx(0xf4002200, "st.d", "d,1[2]")
|
||||
_MC88xxx(0xf4002000, "st.d", "d,1,2")
|
||||
_MC88xxx(0x20000000, "st.d", "d,1,I")
|
||||
_MC88xxx(0xf4002100, "st.d.usr", "d,1,2")
|
||||
_MC88xxx(0xf4002300, "st.d.usr", "d,1[2]")
|
||||
_MC88xxx(0xf4002a00, "st.h", "d,1[2]")
|
||||
_MC88xxx(0xf4002800, "st.h", "d,1,2")
|
||||
_MC88xxx(0x28000000, "st.h", "d,1,I")
|
||||
_MC88xxx(0xf4002900, "st.h.usr", "d,1,2")
|
||||
_MC88xxx(0xf4002b00, "st.h.usr", "d,1[2]")
|
||||
_MC88xxx(0xf4002500, "st.usr", "d,1,2")
|
||||
_MC88xxx(0xf4002700, "st.usr", "d,1[2]")
|
||||
_MC88xxx(0x80008000, "stcr", "3,c")
|
||||
_MC88xxx(0xf4007400, "sub", "d,1,2")
|
||||
_MC88xxx(0x74000000, "sub", "d,1,I")
|
||||
_MC88xxx(0xf4007600, "sub.ci", "d,1,2")
|
||||
_MC88xxx(0xf4007700, "sub.cio", "d,1,2")
|
||||
_MC88xxx(0xf4007500, "sub.co", "d,1,2")
|
||||
_MC88xxx(0xf4006400, "subu", "d,1,2")
|
||||
_MC88xxx(0x64000000, "subu", "d,1,I")
|
||||
_MC88xxx(0xf4006600, "subu.ci", "d,1,2")
|
||||
_MC88xxx(0xf4006700, "subu.cio", "d,1,2")
|
||||
_MC88xxx(0xf4006500, "subu.co", "d,1,2")
|
||||
_MC88xxx(0xf000d000, "tb0", "B,1,V")
|
||||
_MC88xxx(0xf000d800, "tb1", "B,1,V")
|
||||
_MC88xxx(0xf400f800, "tbnd", "1,2")
|
||||
_MC88xxx(0xf8000000, "tbnd", "1,I")
|
||||
_MC88xxx(0xf000e800, "tcnd", "M,1,V")
|
||||
_MC88xxx(0x84005880, "trnc.sd", "d,2")
|
||||
_MC88xxx(0x84005800, "trnc.ss", "d,2")
|
||||
_MC88xxx(0x8000c000, "xcr", "d,1,c")
|
||||
_MC88xxx(0xf4000600, "xmem", "d,1[2]")
|
||||
_MC88xxx(0xf4000400, "xmem", "d,1,2")
|
||||
_MC88100(0x04000000, "xmem", "?d,1,I")
|
||||
_MC88xxx(0xf4000200, "xmem.bu", "d,1[2]")
|
||||
_MC88xxx(0xf4000000, "xmem.bu", "d,1,2")
|
||||
_MC88100(0x00000000, "xmem.bu", "?d,1,I")
|
||||
_MC88xxx(0xf4000300, "xmem.bu.usr", "d,1[2]")
|
||||
_MC88xxx(0xf4000100, "xmem.bu.usr", "d,1,2")
|
||||
_MC88100(0x00000100, "xmem.bu.usr", "?d,1,I")
|
||||
_MC88xxx(0xf4000700, "xmem.usr", "d,1[2]")
|
||||
_MC88xxx(0xf4000500, "xmem.usr", "d,1,2")
|
||||
_MC88100(0x04000100, "xmem.usr", "?d,1,I")
|
||||
_MC88xxx(0xf4005000, "xor", "d,1,2")
|
||||
_MC88xxx(0x50000000, "xor", "d,1,I")
|
||||
_MC88xxx(0xf4005400, "xor.c", "d,1,2")
|
||||
_MC88xxx(0x54000000, "xor.u", "d,1,I")
|
||||
_MC88xxx(0x00000000, "", 0)
|
||||
_MC88xxx (0xf4007000, "add", "d,1,2")
|
||||
_MC88xxx (0x70000000, "add", "d,1,I")
|
||||
_MC88xxx (0xf4007200, "add.ci", "d,1,2")
|
||||
_MC88xxx (0xf4007300, "add.cio", "d,1,2")
|
||||
_MC88xxx (0xf4007100, "add.co", "d,1,2")
|
||||
_MC88xxx (0xf4006000, "addu", "d,1,2")
|
||||
_MC88xxx (0x60000000, "addu", "d,1,I")
|
||||
_MC88xxx (0xf4006200, "addu.ci", "d,1,2")
|
||||
_MC88xxx (0xf4006300, "addu.cio", "d,1,2")
|
||||
_MC88xxx (0xf4006100, "addu.co", "d,1,2")
|
||||
_MC88xxx (0xf4004000, "and", "d,1,2")
|
||||
_MC88xxx (0x40000000, "and", "d,1,I")
|
||||
_MC88xxx (0xf4004400, "and.c", "d,1,2")
|
||||
_MC88xxx (0x44000000, "and.u", "d,1,I")
|
||||
_MC88xxx (0xd0000000, "bb0", "B,1,p")
|
||||
_MC88xxx (0xd4000000, "bb0.n", "B,1,p")
|
||||
_MC88xxx (0xd8000000, "bb1", "B,1,p")
|
||||
_MC88xxx (0xdc000000, "bb1.n", "B,1,p")
|
||||
_MC88xxx (0xe8000000, "bcnd", "M,1,p")
|
||||
_MC88xxx (0xec000000, "bcnd.n", "M,1,p")
|
||||
_MC88xxx (0xc0000000, "br", "P")
|
||||
_MC88xxx (0xc4000000, "br.n", "P")
|
||||
_MC88xxx (0xc8000000, "bsr", "P")
|
||||
_MC88xxx (0xcc000000, "bsr.n", "P")
|
||||
_MC88xxx (0xf4008000, "clr", "d,1,2")
|
||||
_MC88xxx (0xf0008000, "clr", "d,1,b")
|
||||
_MC88xxx (0xf4007c00, "cmp", "d,1,2")
|
||||
_MC88xxx (0x7c000000, "cmp", "d,1,I")
|
||||
_MC88xxx (0xf4007800, "div", "d,1,2")
|
||||
_MC88xxx (0x78000000, "div", "d,1,I")
|
||||
_MC88xxx (0xf4007800, "divs", "d,1,2")
|
||||
_MC88xxx (0x78000000, "divs", "d,1,I")
|
||||
_MC88xxx (0xf4006800, "divu", "d,1,2")
|
||||
_MC88xxx (0x68000000, "divu", "d,1,I")
|
||||
_MC88xxx (0xf4009000, "ext", "d,1,2")
|
||||
_MC88xxx (0xf0009000, "ext", "d,1,b")
|
||||
_MC88xxx (0xf4009800, "extu", "d,1,2")
|
||||
_MC88xxx (0xf0009800, "extu", "d,1,b")
|
||||
_MC88xxx (0x84002800, "fadd.sss", "d,1,2")
|
||||
_MC88xxx (0x84002880, "fadd.ssd", "d,1,2")
|
||||
_MC88xxx (0x84002a00, "fadd.sds", "d,1,2")
|
||||
_MC88xxx (0x84002a80, "fadd.sdd", "d,1,2")
|
||||
_MC88xxx (0x84002820, "fadd.dss", "d,1,2")
|
||||
_MC88xxx (0x840028a0, "fadd.dsd", "d,1,2")
|
||||
_MC88xxx (0x84002a20, "fadd.dds", "d,1,2")
|
||||
_MC88xxx (0x84002aa0, "fadd.ddd", "d,1,2")
|
||||
_MC88xxx (0x84003a80, "fcmp.sdd", "d,1,2")
|
||||
_MC88xxx (0x84003a00, "fcmp.sds", "d,1,2")
|
||||
_MC88xxx (0x84003880, "fcmp.ssd", "d,1,2")
|
||||
_MC88xxx (0x84003800, "fcmp.sss", "d,1,2")
|
||||
_MC88xxx (0x84007000, "fdiv.sss", "d,1,2")
|
||||
_MC88xxx (0x84007080, "fdiv.ssd", "d,1,2")
|
||||
_MC88xxx (0x84007200, "fdiv.sds", "d,1,2")
|
||||
_MC88xxx (0x84007280, "fdiv.sdd", "d,1,2")
|
||||
_MC88xxx (0x84007020, "fdiv.dss", "d,1,2")
|
||||
_MC88xxx (0x840070a0, "fdiv.dsd", "d,1,2")
|
||||
_MC88xxx (0x84007220, "fdiv.dds", "d,1,2")
|
||||
_MC88xxx (0x840072a0, "fdiv.ddd", "d,1,2")
|
||||
_MC88xxx (0xf400ec00, "ff0", "d,2")
|
||||
_MC88xxx (0xf400e800, "ff1", "d,2")
|
||||
_MC88xxx (0x80004800, "fldcr", "d,f")
|
||||
_MC88xxx (0x84002020, "flt.ds", "d,2")
|
||||
_MC88xxx (0x84002000, "flt.ss", "d,2")
|
||||
_MC88xxx (0x84000000, "fmul.sss", "d,1,2")
|
||||
_MC88xxx (0x84000080, "fmul.ssd", "d,1,2")
|
||||
_MC88xxx (0x84000200, "fmul.sds", "d,1,2")
|
||||
_MC88xxx (0x84000280, "fmul.sdd", "d,1,2")
|
||||
_MC88xxx (0x84000020, "fmul.dss", "d,1,2")
|
||||
_MC88xxx (0x840000a0, "fmul.dsd", "d,1,2")
|
||||
_MC88xxx (0x84000220, "fmul.dds", "d,1,2")
|
||||
_MC88xxx (0x840002a0, "fmul.ddd", "d,1,2")
|
||||
_MC88xxx (0x80008800, "fstcr", "3,f")
|
||||
_MC88xxx (0x84003000, "fsub.sss", "d,1,2")
|
||||
_MC88xxx (0x84003080, "fsub.ssd", "d,1,2")
|
||||
_MC88xxx (0x84003200, "fsub.sds", "d,1,2")
|
||||
_MC88xxx (0x84003280, "fsub.sdd", "d,1,2")
|
||||
_MC88xxx (0x84003020, "fsub.dss", "d,1,2")
|
||||
_MC88xxx (0x840030a0, "fsub.dsd", "d,1,2")
|
||||
_MC88xxx (0x84003220, "fsub.dds", "d,1,2")
|
||||
_MC88xxx (0x840032a0, "fsub.ddd", "d,1,2")
|
||||
_MC88xxx (0x8000c800, "fxcr", "d,3,f")
|
||||
_MC88xxx (0x8400fc01, "illop1", "")
|
||||
_MC88xxx (0x8400fc02, "illop2", "")
|
||||
_MC88xxx (0x8400fc03, "illop3", "")
|
||||
_MC88xxx (0x84004880, "int.sd", "d,2")
|
||||
_MC88xxx (0x84004800, "int.ss", "d,2")
|
||||
_MC88xxx (0xf400c000, "jmp", "2")
|
||||
_MC88xxx (0xf400c400, "jmp.n", "2")
|
||||
_MC88xxx (0xf400c800, "jsr", "2")
|
||||
_MC88xxx (0xf400cc00, "jsr.n", "2")
|
||||
_MC88xxx (0xf4001400, "ld", "d,1,2")
|
||||
_MC88xxx (0xf4001600, "ld", "d,1[2]")
|
||||
_MC88xxx (0x14000000, "ld", "d,1,I")
|
||||
_MC88xxx (0xf4001e00, "ld.b", "d,1[2]")
|
||||
_MC88xxx (0xf4001c00, "ld.b", "d,1,2")
|
||||
_MC88xxx (0x1c000000, "ld.b", "d,1,I")
|
||||
_MC88xxx (0xf4001d00, "ld.b.usr", "d,1,2")
|
||||
_MC88xxx (0xf4001f00, "ld.b.usr", "d,1[2]")
|
||||
_MC88xxx (0xf4000e00, "ld.bu", "d,1[2]")
|
||||
_MC88xxx (0xf4000c00, "ld.bu", "d,1,2")
|
||||
_MC88xxx (0x0c000000, "ld.bu", "d,1,I")
|
||||
_MC88xxx (0xf4000d00, "ld.bu.usr", "d,1,2")
|
||||
_MC88xxx (0xf4000f00, "ld.bu.usr", "d,1[2]")
|
||||
_MC88xxx (0xf4001200, "ld.d", "d,1[2]")
|
||||
_MC88xxx (0xf4001000, "ld.d", "d,1,2")
|
||||
_MC88xxx (0x10000000, "ld.d", "d,1,I")
|
||||
_MC88xxx (0xf4001100, "ld.d.usr", "d,1,2")
|
||||
_MC88xxx (0xf4001300, "ld.d.usr", "d,1[2]")
|
||||
_MC88xxx (0xf4001a00, "ld.h", "d,1[2]")
|
||||
_MC88xxx (0xf4001800, "ld.h", "d,1,2")
|
||||
_MC88xxx (0x18000000, "ld.h", "d,1,I")
|
||||
_MC88xxx (0xf4001900, "ld.h.usr", "d,1,2")
|
||||
_MC88xxx (0xf4001b00, "ld.h.usr", "d,1[2]")
|
||||
_MC88xxx (0xf4000a00, "ld.hu", "d,1[2]")
|
||||
_MC88xxx (0xf4000800, "ld.hu", "d,1,2")
|
||||
_MC88xxx (0x08000000, "ld.hu", "d,1,I")
|
||||
_MC88xxx (0xf4000900, "ld.hu.usr", "d,1,2")
|
||||
_MC88xxx (0xf4000b00, "ld.hu.usr", "d,1[2]")
|
||||
_MC88xxx (0xf4001500, "ld.usr", "d,1,2")
|
||||
_MC88xxx (0xf4001700, "ld.usr", "d,1[2]")
|
||||
_MC88xxx (0xf4003600, "lda", "d,1[2]")
|
||||
_MC88xxx (0xf4006000, "lda", "?d,1,2") /* Output addu */
|
||||
_MC88xxx (0x60000000, "lda", "?d,1,I") /* Output addu */
|
||||
_MC88xxx (0xf4006000, "lda.b", "?d,1[2]") /* Output addu */
|
||||
_MC88xxx (0xf4006000, "lda.b", "?d,1,2") /* Output addu */
|
||||
_MC88xxx (0x60000000, "lda.b", "?d,1,I") /* Output addu */
|
||||
_MC88xxx (0xf4003200, "lda.d", "d,1[2]")
|
||||
_MC88xxx (0xf4006000, "lda.d", "?d,1,2") /* Output addu */
|
||||
_MC88xxx (0x60000000, "lda.d", "?d,1,I") /* Output addu */
|
||||
_MC88xxx (0xf4003a00, "lda.h", "d,1[2]")
|
||||
_MC88xxx (0xf4006000, "lda.h", "?d,1,2") /* Output addu */
|
||||
_MC88xxx (0x60000000, "lda.h", "?d,1,I") /* Output addu */
|
||||
_MC88xxx (0x80004000, "ldcr", "d,c")
|
||||
_MC88xxx (0xf400a000, "mak", "d,1,2")
|
||||
_MC88xxx (0xf000a000, "mak", "d,1,b")
|
||||
_MC88xxx (0x48000000, "mask", "d,1,I")
|
||||
_MC88xxx (0x4c000000, "mask.u", "d,1,I")
|
||||
_MC88xxx (0xf4006c00, "mul", "d,1,2")
|
||||
_MC88xxx (0x6c000000, "mul", "d,1,I")
|
||||
_MC88xxx (0xf4006c00, "mulu", "d,1,2") /* synonym for mul */
|
||||
_MC88xxx (0x6c000000, "mulu", "d,1,I") /* synonym for mul */
|
||||
_MC88xxx (0x84005080, "nint.sd", "d,2")
|
||||
_MC88xxx (0x84005000, "nint.ss", "d,2")
|
||||
_MC88xxx (0xf4005800, "or", "d,1,2")
|
||||
_MC88xxx (0x58000000, "or", "d,1,I")
|
||||
_MC88xxx (0xf4005c00, "or.c", "d,1,2")
|
||||
_MC88xxx (0x5c000000, "or.u", "d,1,I")
|
||||
_MC88xxx (0xf000a800, "rot", "d,1,b")
|
||||
_MC88xxx (0xf400a800, "rot", "d,1,2")
|
||||
_MC88xxx (0xf400fc00, "rte", "")
|
||||
_MC88xxx (0xf4008800, "set", "d,1,2")
|
||||
_MC88xxx (0xf0008800, "set", "d,1,b")
|
||||
_MC88xxx (0xf4002600, "st", "d,1[2]")
|
||||
_MC88xxx (0xf4002400, "st", "d,1,2")
|
||||
_MC88xxx (0x24000000, "st", "d,1,I")
|
||||
_MC88xxx (0xf4002e00, "st.b", "d,1[2]")
|
||||
_MC88xxx (0xf4002c00, "st.b", "d,1,2")
|
||||
_MC88xxx (0x2c000000, "st.b", "d,1,I")
|
||||
_MC88xxx (0xf4002d00, "st.b.usr", "d,1,2")
|
||||
_MC88xxx (0xf4002f00, "st.b.usr", "d,1[2]")
|
||||
_MC88xxx (0xf4002200, "st.d", "d,1[2]")
|
||||
_MC88xxx (0xf4002000, "st.d", "d,1,2")
|
||||
_MC88xxx (0x20000000, "st.d", "d,1,I")
|
||||
_MC88xxx (0xf4002100, "st.d.usr", "d,1,2")
|
||||
_MC88xxx (0xf4002300, "st.d.usr", "d,1[2]")
|
||||
_MC88xxx (0xf4002a00, "st.h", "d,1[2]")
|
||||
_MC88xxx (0xf4002800, "st.h", "d,1,2")
|
||||
_MC88xxx (0x28000000, "st.h", "d,1,I")
|
||||
_MC88xxx (0xf4002900, "st.h.usr", "d,1,2")
|
||||
_MC88xxx (0xf4002b00, "st.h.usr", "d,1[2]")
|
||||
_MC88xxx (0xf4002500, "st.usr", "d,1,2")
|
||||
_MC88xxx (0xf4002700, "st.usr", "d,1[2]")
|
||||
_MC88xxx (0x80008000, "stcr", "3,c")
|
||||
_MC88xxx (0xf4007400, "sub", "d,1,2")
|
||||
_MC88xxx (0x74000000, "sub", "d,1,I")
|
||||
_MC88xxx (0xf4007600, "sub.ci", "d,1,2")
|
||||
_MC88xxx (0xf4007700, "sub.cio", "d,1,2")
|
||||
_MC88xxx (0xf4007500, "sub.co", "d,1,2")
|
||||
_MC88xxx (0xf4006400, "subu", "d,1,2")
|
||||
_MC88xxx (0x64000000, "subu", "d,1,I")
|
||||
_MC88xxx (0xf4006600, "subu.ci", "d,1,2")
|
||||
_MC88xxx (0xf4006700, "subu.cio", "d,1,2")
|
||||
_MC88xxx (0xf4006500, "subu.co", "d,1,2")
|
||||
_MC88xxx (0xf000d000, "tb0", "B,1,V")
|
||||
_MC88xxx (0xf000d800, "tb1", "B,1,V")
|
||||
_MC88xxx (0xf400f800, "tbnd", "1,2")
|
||||
_MC88xxx (0xf8000000, "tbnd", "1,I")
|
||||
_MC88xxx (0xf000e800, "tcnd", "M,1,V")
|
||||
_MC88xxx (0x84005880, "trnc.sd", "d,2")
|
||||
_MC88xxx (0x84005800, "trnc.ss", "d,2")
|
||||
_MC88xxx (0x8000c000, "xcr", "d,1,c")
|
||||
_MC88xxx (0xf4000600, "xmem", "d,1[2]")
|
||||
_MC88xxx (0xf4000400, "xmem", "d,1,2")
|
||||
_MC88100 (0x04000000, "xmem", "?d,1,I")
|
||||
_MC88xxx (0xf4000200, "xmem.bu", "d,1[2]")
|
||||
_MC88xxx (0xf4000000, "xmem.bu", "d,1,2")
|
||||
_MC88100 (0x00000000, "xmem.bu", "?d,1,I")
|
||||
_MC88xxx (0xf4000300, "xmem.bu.usr", "d,1[2]")
|
||||
_MC88xxx (0xf4000100, "xmem.bu.usr", "d,1,2")
|
||||
_MC88100 (0x00000100, "xmem.bu.usr", "?d,1,I")
|
||||
_MC88xxx (0xf4000700, "xmem.usr", "d,1[2]")
|
||||
_MC88xxx (0xf4000500, "xmem.usr", "d,1,2")
|
||||
_MC88100 (0x04000100, "xmem.usr", "?d,1,I")
|
||||
_MC88xxx (0xf4005000, "xor", "d,1,2")
|
||||
_MC88xxx (0x50000000, "xor", "d,1,I")
|
||||
_MC88xxx (0xf4005400, "xor.c", "d,1,2")
|
||||
_MC88xxx (0x54000000, "xor.u", "d,1,I")
|
||||
_MC88xxx (0x00000000, "", 0)
|
||||
};
|
||||
|
||||
#define NUMOPCODES ((sizeof m88k_opcodes)/(sizeof m88k_opcodes[0]))
|
||||
|
@ -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,46 +20,49 @@
|
||||
|
||||
#include "as.h"
|
||||
|
||||
static
|
||||
|
||||
const short seg_N_TYPE[] = {
|
||||
N_ABS,
|
||||
N_TEXT,
|
||||
N_DATA,
|
||||
N_BSS,
|
||||
N_UNDF, /* unknown */
|
||||
N_UNDF, /* absent */
|
||||
N_UNDF, /* pass1 */
|
||||
N_UNDF, /* error */
|
||||
N_UNDF, /* bignum/flonum */
|
||||
N_UNDF, /* difference */
|
||||
N_REGISTER, /* register */
|
||||
};
|
||||
static
|
||||
|
||||
const segT N_TYPE_seg [N_TYPE+2] = { /* N_TYPE == 0x1E = 32-2 */
|
||||
SEG_UNKNOWN, /* N_UNDF == 0 */
|
||||
SEG_GOOF,
|
||||
SEG_ABSOLUTE, /* N_ABS == 2 */
|
||||
SEG_GOOF,
|
||||
SEG_TEXT, /* N_TEXT == 4 */
|
||||
SEG_GOOF,
|
||||
SEG_DATA, /* N_DATA == 6 */
|
||||
SEG_GOOF,
|
||||
SEG_BSS, /* N_BSS == 8 */
|
||||
SEG_GOOF,
|
||||
SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF,
|
||||
SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF,
|
||||
SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF,
|
||||
SEG_REGISTER, /* dummy N_REGISTER for regs = 30 */
|
||||
SEG_GOOF,
|
||||
const short seg_N_TYPE[] =
|
||||
{
|
||||
N_ABS,
|
||||
N_TEXT,
|
||||
N_DATA,
|
||||
N_BSS,
|
||||
N_UNDF, /* unknown */
|
||||
N_UNDF, /* absent */
|
||||
N_UNDF, /* pass1 */
|
||||
N_UNDF, /* error */
|
||||
N_UNDF, /* bignum/flonum */
|
||||
N_UNDF, /* difference */
|
||||
N_REGISTER, /* register */
|
||||
};
|
||||
|
||||
const segT N_TYPE_seg[N_TYPE + 2] =
|
||||
{ /* N_TYPE == 0x1E = 32-2 */
|
||||
SEG_UNKNOWN, /* N_UNDF == 0 */
|
||||
SEG_GOOF,
|
||||
SEG_ABSOLUTE, /* N_ABS == 2 */
|
||||
SEG_GOOF,
|
||||
SEG_TEXT, /* N_TEXT == 4 */
|
||||
SEG_GOOF,
|
||||
SEG_DATA, /* N_DATA == 6 */
|
||||
SEG_GOOF,
|
||||
SEG_BSS, /* N_BSS == 8 */
|
||||
SEG_GOOF,
|
||||
SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF,
|
||||
SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF,
|
||||
SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF,
|
||||
SEG_REGISTER, /* dummy N_REGISTER for regs = 30 */
|
||||
SEG_GOOF,
|
||||
};
|
||||
|
||||
|
||||
void obj_symbol_new_hook(symbolP)
|
||||
symbolS *symbolP;
|
||||
void
|
||||
obj_symbol_new_hook (symbolP)
|
||||
symbolS *symbolP;
|
||||
{
|
||||
return;
|
||||
} /* obj_symbol_new_hook() */
|
||||
return;
|
||||
} /* obj_symbol_new_hook() */
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
|
@ -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. */
|
||||
@ -56,8 +56,8 @@ typedef void *object_headers;
|
||||
#define S_GET_VALUE(s) ((s)->sy_symbol.value)
|
||||
#define S_IS_DEFINED(s) (!((s)->sy_symbol.flags & BSF_UNDEFINED))
|
||||
|
||||
#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (0) /* your magic number */
|
||||
#define OBJ_EMIT_LINENO(a,b,c) /* must be *something*. This no-op's it out. */
|
||||
#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (0) /* your magic number */
|
||||
#define OBJ_EMIT_LINENO(a,b,c) /* must be *something*. This no-op's it out. */
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
|
@ -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. */
|
||||
@ -20,74 +20,77 @@
|
||||
#include "as.h"
|
||||
#include "obstack.h"
|
||||
#include "aout/stab_gnu.h"
|
||||
const short /* in: segT out: N_TYPE bits */
|
||||
seg_N_TYPE[] = {
|
||||
N_ABS,
|
||||
N_TEXT,
|
||||
N_DATA,
|
||||
N_BSS,
|
||||
N_UNDF, /* unknown */
|
||||
N_UNDF, /* absent */
|
||||
N_UNDF, /* pass1 */
|
||||
N_UNDF, /* error */
|
||||
N_UNDF, /* bignum/flonum */
|
||||
N_UNDF, /* difference */
|
||||
N_REGISTER, /* register */
|
||||
};
|
||||
const short /* in: segT out: N_TYPE bits */
|
||||
seg_N_TYPE[] =
|
||||
{
|
||||
N_ABS,
|
||||
N_TEXT,
|
||||
N_DATA,
|
||||
N_BSS,
|
||||
N_UNDF, /* unknown */
|
||||
N_UNDF, /* absent */
|
||||
N_UNDF, /* pass1 */
|
||||
N_UNDF, /* error */
|
||||
N_UNDF, /* bignum/flonum */
|
||||
N_UNDF, /* difference */
|
||||
N_REGISTER, /* register */
|
||||
};
|
||||
|
||||
const segT N_TYPE_seg [N_TYPE+2] = { /* N_TYPE == 0x1E = 32-2 */
|
||||
SEG_UNKNOWN, /* N_UNDF == 0 */
|
||||
SEG_GOOF,
|
||||
SEG_ABSOLUTE, /* N_ABS == 2 */
|
||||
SEG_GOOF,
|
||||
SEG_TEXT, /* N_TEXT == 4 */
|
||||
SEG_GOOF,
|
||||
SEG_DATA, /* N_DATA == 6 */
|
||||
SEG_GOOF,
|
||||
SEG_BSS, /* N_BSS == 8 */
|
||||
SEG_GOOF,
|
||||
SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF,
|
||||
SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF,
|
||||
SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF,
|
||||
SEG_REGISTER, /* dummy N_REGISTER for regs = 30 */
|
||||
SEG_GOOF,
|
||||
const segT N_TYPE_seg[N_TYPE + 2] =
|
||||
{ /* N_TYPE == 0x1E = 32-2 */
|
||||
SEG_UNKNOWN, /* N_UNDF == 0 */
|
||||
SEG_GOOF,
|
||||
SEG_ABSOLUTE, /* N_ABS == 2 */
|
||||
SEG_GOOF,
|
||||
SEG_TEXT, /* N_TEXT == 4 */
|
||||
SEG_GOOF,
|
||||
SEG_DATA, /* N_DATA == 6 */
|
||||
SEG_GOOF,
|
||||
SEG_BSS, /* N_BSS == 8 */
|
||||
SEG_GOOF,
|
||||
SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF,
|
||||
SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF,
|
||||
SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF,
|
||||
SEG_REGISTER, /* dummy N_REGISTER for regs = 30 */
|
||||
SEG_GOOF,
|
||||
};
|
||||
|
||||
#if __STDC__ == 1
|
||||
static void obj_bout_stab(int what);
|
||||
static void obj_bout_line(void);
|
||||
static void obj_bout_desc(void);
|
||||
static void obj_bout_stab (int what);
|
||||
static void obj_bout_line (void);
|
||||
static void obj_bout_desc (void);
|
||||
#else /* not __STDC__ */
|
||||
static void obj_bout_desc();
|
||||
static void obj_bout_stab();
|
||||
static void obj_bout_line();
|
||||
static void obj_bout_desc ();
|
||||
static void obj_bout_stab ();
|
||||
static void obj_bout_line ();
|
||||
#endif /* not __STDC__ */
|
||||
|
||||
const pseudo_typeS obj_pseudo_table[] = {
|
||||
/* stabs (aka a.out aka b.out directives for debug symbols) */
|
||||
{ "desc", obj_bout_desc, 0 }, /* def */
|
||||
{ "line", obj_bout_line, 0 }, /* source code line number */
|
||||
{ "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 },
|
||||
{ "endef", s_ignore, 0 },
|
||||
{ "ln", s_ignore, 0 },
|
||||
{ "scl", s_ignore, 0 },
|
||||
{ "size", s_ignore, 0 },
|
||||
{ "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 */
|
||||
const pseudo_typeS obj_pseudo_table[] =
|
||||
{
|
||||
/* stabs (aka a.out aka b.out directives for debug symbols) */
|
||||
{"desc", obj_bout_desc, 0}, /* def */
|
||||
{"line", obj_bout_line, 0}, /* source code line number */
|
||||
{"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},
|
||||
{"endef", s_ignore, 0},
|
||||
{"ln", s_ignore, 0},
|
||||
{"scl", s_ignore, 0},
|
||||
{"size", s_ignore, 0},
|
||||
{"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 */
|
||||
|
||||
/* Relocation. */
|
||||
|
||||
@ -96,129 +99,141 @@ const pseudo_typeS obj_pseudo_table[] = {
|
||||
*
|
||||
* Crawl along a fixS chain. Emit the segment's relocations.
|
||||
*/
|
||||
void obj_emit_relocations(where, fixP, segment_address_in_file)
|
||||
char **where;
|
||||
fixS *fixP; /* Fixup chain for this segment. */
|
||||
relax_addressT segment_address_in_file;
|
||||
void
|
||||
obj_emit_relocations (where, fixP, segment_address_in_file)
|
||||
char **where;
|
||||
fixS *fixP; /* Fixup chain for this segment. */
|
||||
relax_addressT segment_address_in_file;
|
||||
{
|
||||
for (; fixP; fixP = fixP->fx_next) {
|
||||
if (fixP->fx_addsy != NULL
|
||||
|| fixP->fx_r_type != NO_RELOC) {
|
||||
tc_bout_fix_to_chars(*where, fixP, segment_address_in_file);
|
||||
*where += sizeof(struct relocation_info);
|
||||
} /* if there's a symbol */
|
||||
} /* for each fixup */
|
||||
|
||||
} /* emit_relocations() */
|
||||
for (; fixP; fixP = fixP->fx_next)
|
||||
{
|
||||
if (fixP->fx_addsy != NULL
|
||||
|| fixP->fx_r_type != NO_RELOC)
|
||||
{
|
||||
tc_bout_fix_to_chars (*where, fixP, segment_address_in_file);
|
||||
*where += sizeof (struct relocation_info);
|
||||
} /* if there's a symbol */
|
||||
} /* for each fixup */
|
||||
|
||||
} /* emit_relocations() */
|
||||
|
||||
/* Aout file generation & utilities */
|
||||
|
||||
/* Convert a lvalue to machine dependent data */
|
||||
void obj_header_append(where, headers)
|
||||
char **where;
|
||||
object_headers *headers;
|
||||
void
|
||||
obj_header_append (where, headers)
|
||||
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));
|
||||
/* Always leave in host byte order */
|
||||
|
||||
headers->header.a_relaxable = linkrelax;
|
||||
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));
|
||||
|
||||
headers->header.a_relaxable = linkrelax;
|
||||
|
||||
#ifdef CROSS_COMPILE
|
||||
md_number_to_chars(*where, headers->header.a_magic, sizeof(headers->header.a_magic));
|
||||
*where += sizeof(headers->header.a_magic);
|
||||
md_number_to_chars(*where, headers->header.a_text, sizeof(headers->header.a_text));
|
||||
*where += sizeof(headers->header.a_text);
|
||||
md_number_to_chars(*where, headers->header.a_data, sizeof(headers->header.a_data));
|
||||
*where += sizeof(headers->header.a_data);
|
||||
md_number_to_chars(*where, headers->header.a_bss, sizeof(headers->header.a_bss));
|
||||
*where += sizeof(headers->header.a_bss);
|
||||
md_number_to_chars(*where, headers->header.a_syms, sizeof(headers->header.a_syms));
|
||||
*where += sizeof(headers->header.a_syms);
|
||||
md_number_to_chars(*where, headers->header.a_entry, sizeof(headers->header.a_entry));
|
||||
*where += sizeof(headers->header.a_entry);
|
||||
md_number_to_chars(*where, headers->header.a_trsize, sizeof(headers->header.a_trsize));
|
||||
*where += sizeof(headers->header.a_trsize);
|
||||
md_number_to_chars(*where, headers->header.a_drsize, sizeof(headers->header.a_drsize));
|
||||
*where += sizeof(headers->header.a_drsize);
|
||||
md_number_to_chars(*where, headers->header.a_tload, sizeof(headers->header.a_tload));
|
||||
*where += sizeof(headers->header.a_tload);
|
||||
md_number_to_chars(*where, headers->header.a_dload, sizeof(headers->header.a_dload));
|
||||
*where += sizeof(headers->header.a_dload);
|
||||
md_number_to_chars(*where, headers->header.a_talign, sizeof(headers->header.a_talign));
|
||||
*where += sizeof(headers->header.a_talign);
|
||||
md_number_to_chars(*where, headers->header.a_dalign, sizeof(headers->header.a_dalign));
|
||||
*where += sizeof(headers->header.a_dalign);
|
||||
md_number_to_chars(*where, headers->header.a_balign, sizeof(headers->header.a_balign));
|
||||
*where += sizeof(headers->header.a_balign);
|
||||
md_number_to_chars(*where, headers->header.a_relaxable, sizeof(headers->header.a_relaxable));
|
||||
*where += sizeof(headers->header.a_relaxable);
|
||||
md_number_to_chars (*where, headers->header.a_magic, sizeof (headers->header.a_magic));
|
||||
*where += sizeof (headers->header.a_magic);
|
||||
md_number_to_chars (*where, headers->header.a_text, sizeof (headers->header.a_text));
|
||||
*where += sizeof (headers->header.a_text);
|
||||
md_number_to_chars (*where, headers->header.a_data, sizeof (headers->header.a_data));
|
||||
*where += sizeof (headers->header.a_data);
|
||||
md_number_to_chars (*where, headers->header.a_bss, sizeof (headers->header.a_bss));
|
||||
*where += sizeof (headers->header.a_bss);
|
||||
md_number_to_chars (*where, headers->header.a_syms, sizeof (headers->header.a_syms));
|
||||
*where += sizeof (headers->header.a_syms);
|
||||
md_number_to_chars (*where, headers->header.a_entry, sizeof (headers->header.a_entry));
|
||||
*where += sizeof (headers->header.a_entry);
|
||||
md_number_to_chars (*where, headers->header.a_trsize, sizeof (headers->header.a_trsize));
|
||||
*where += sizeof (headers->header.a_trsize);
|
||||
md_number_to_chars (*where, headers->header.a_drsize, sizeof (headers->header.a_drsize));
|
||||
*where += sizeof (headers->header.a_drsize);
|
||||
md_number_to_chars (*where, headers->header.a_tload, sizeof (headers->header.a_tload));
|
||||
*where += sizeof (headers->header.a_tload);
|
||||
md_number_to_chars (*where, headers->header.a_dload, sizeof (headers->header.a_dload));
|
||||
*where += sizeof (headers->header.a_dload);
|
||||
md_number_to_chars (*where, headers->header.a_talign, sizeof (headers->header.a_talign));
|
||||
*where += sizeof (headers->header.a_talign);
|
||||
md_number_to_chars (*where, headers->header.a_dalign, sizeof (headers->header.a_dalign));
|
||||
*where += sizeof (headers->header.a_dalign);
|
||||
md_number_to_chars (*where, headers->header.a_balign, sizeof (headers->header.a_balign));
|
||||
*where += sizeof (headers->header.a_balign);
|
||||
md_number_to_chars (*where, headers->header.a_relaxable, sizeof (headers->header.a_relaxable));
|
||||
*where += sizeof (headers->header.a_relaxable);
|
||||
#else /* ! CROSS_COMPILE */
|
||||
append(where, (char *) &headers->header, sizeof(headers->header));
|
||||
append (where, (char *) &headers->header, sizeof (headers->header));
|
||||
#endif /* ! CROSS_COMPILE */
|
||||
} /* a_header_append() */
|
||||
} /* a_header_append() */
|
||||
|
||||
void obj_symbol_to_chars(where, symbolP)
|
||||
char **where;
|
||||
symbolS *symbolP;
|
||||
void
|
||||
obj_symbol_to_chars (where, symbolP)
|
||||
char **where;
|
||||
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)));
|
||||
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() */
|
||||
append (where, (char *) &symbolP->sy_symbol, sizeof (obj_symbol_type));
|
||||
} /* obj_symbol_to_chars() */
|
||||
|
||||
void obj_emit_symbols(where, symbol_rootP)
|
||||
char **where;
|
||||
symbolS *symbol_rootP;
|
||||
void
|
||||
obj_emit_symbols (where, symbol_rootP)
|
||||
char **where;
|
||||
symbolS *symbol_rootP;
|
||||
{
|
||||
symbolS * symbolP;
|
||||
|
||||
/*
|
||||
symbolS *symbolP;
|
||||
|
||||
/*
|
||||
* Emit all symbols left in the symbol chain.
|
||||
*/
|
||||
for(symbolP = symbol_rootP; symbolP; symbolP = symbol_next(symbolP)) {
|
||||
/* Used to save the offset of the name. It is used to point
|
||||
for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next (symbolP))
|
||||
{
|
||||
/* 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);
|
||||
}
|
||||
} /* emit_symbols() */
|
||||
char *temp;
|
||||
|
||||
void obj_symbol_new_hook(symbolP)
|
||||
symbolS *symbolP;
|
||||
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);
|
||||
}
|
||||
} /* emit_symbols() */
|
||||
|
||||
void
|
||||
obj_symbol_new_hook (symbolP)
|
||||
symbolS *symbolP;
|
||||
{
|
||||
S_SET_OTHER(symbolP, 0);
|
||||
S_SET_DESC(symbolP, 0);
|
||||
return;
|
||||
} /* obj_symbol_new_hook() */
|
||||
S_SET_OTHER (symbolP, 0);
|
||||
S_SET_DESC (symbolP, 0);
|
||||
return;
|
||||
} /* obj_symbol_new_hook() */
|
||||
|
||||
static void obj_bout_line() {
|
||||
/* Assume delimiter is part of expression. */
|
||||
/* BSD4.2 as fails with delightful bug, so we */
|
||||
/* are not being incompatible here. */
|
||||
new_logical_line ((char *)NULL, (int)(get_absolute_expression ()));
|
||||
demand_empty_rest_of_line();
|
||||
} /* obj_bout_line() */
|
||||
static void
|
||||
obj_bout_line ()
|
||||
{
|
||||
/* Assume delimiter is part of expression. */
|
||||
/* BSD4.2 as fails with delightful bug, so we */
|
||||
/* are not being incompatible here. */
|
||||
new_logical_line ((char *) NULL, (int) (get_absolute_expression ()));
|
||||
demand_empty_rest_of_line ();
|
||||
} /* obj_bout_line() */
|
||||
|
||||
/*
|
||||
* stab()
|
||||
@ -239,260 +254,294 @@ static void obj_bout_line() {
|
||||
* .stabX directives always make a symbol table entry. It may be junk if
|
||||
* the rest of your .stabX directive is malformed.
|
||||
*/
|
||||
static void obj_bout_stab(what)
|
||||
int what;
|
||||
static void
|
||||
obj_bout_stab (what)
|
||||
int what;
|
||||
{
|
||||
register symbolS * symbolP = 0;
|
||||
register char * string;
|
||||
int saved_type = 0;
|
||||
int length;
|
||||
int goof; /* TRUE if we have aborted. */
|
||||
long longint;
|
||||
|
||||
/*
|
||||
register symbolS *symbolP = 0;
|
||||
register char *string;
|
||||
int saved_type = 0;
|
||||
int length;
|
||||
int goof; /* TRUE if we have aborted. */
|
||||
long longint;
|
||||
|
||||
/*
|
||||
* Enter with input_line_pointer pointing past .stabX and any following
|
||||
* whitespace.
|
||||
*/
|
||||
goof = 0; /* JF who forgot this?? */
|
||||
if (what == 's') {
|
||||
string = demand_copy_C_string(& length);
|
||||
SKIP_WHITESPACE();
|
||||
if (*input_line_pointer == ',')
|
||||
input_line_pointer ++;
|
||||
else {
|
||||
as_bad("I need a comma after symbol's name");
|
||||
goof = 1;
|
||||
}
|
||||
} else
|
||||
string = "";
|
||||
|
||||
/*
|
||||
goof = 0; /* JF who forgot this?? */
|
||||
if (what == 's')
|
||||
{
|
||||
string = demand_copy_C_string (&length);
|
||||
SKIP_WHITESPACE ();
|
||||
if (*input_line_pointer == ',')
|
||||
input_line_pointer++;
|
||||
else
|
||||
{
|
||||
as_bad ("I need a comma after symbol's name");
|
||||
goof = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
string = "";
|
||||
|
||||
/*
|
||||
* Input_line_pointer->after ','. String->symbol name.
|
||||
*/
|
||||
if (!goof) {
|
||||
symbolP = symbol_new(string,
|
||||
SEG_UNKNOWN,
|
||||
0,
|
||||
(struct frag *)0);
|
||||
switch (what) {
|
||||
case 'd':
|
||||
S_SET_NAME(symbolP,NULL); /* .stabd feature. */
|
||||
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 {
|
||||
as_bad("I want a comma after the n_type expression");
|
||||
goof = 1;
|
||||
input_line_pointer--; /* Backup over a non-',' char. */
|
||||
}
|
||||
}
|
||||
if (! goof) {
|
||||
if (get_absolute_expression_and_terminator (& longint) == ',')
|
||||
S_SET_OTHER(symbolP,longint);
|
||||
else {
|
||||
as_bad("I want a comma after the n_other expression");
|
||||
goof = 1;
|
||||
input_line_pointer--; /* Backup over a non-',' char. */
|
||||
}
|
||||
}
|
||||
if (! goof) {
|
||||
S_SET_DESC(symbolP, get_absolute_expression ());
|
||||
if (what == 's' || what == 'n') {
|
||||
if (* input_line_pointer != ',') {
|
||||
as_bad("I want a comma after the n_desc expression");
|
||||
goof = 1;
|
||||
} else {
|
||||
input_line_pointer ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((! goof) && (what=='s' || what=='n')) {
|
||||
pseudo_set(symbolP);
|
||||
symbolP->sy_symbol.n_type = saved_type;
|
||||
}
|
||||
#ifndef NO_LISTING
|
||||
if (!goof)
|
||||
{
|
||||
symbolP = symbol_new (string,
|
||||
SEG_UNKNOWN,
|
||||
0,
|
||||
(struct frag *) 0);
|
||||
switch (what)
|
||||
{
|
||||
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
|
||||
|
||||
if (goof)
|
||||
ignore_rest_of_line ();
|
||||
else
|
||||
demand_empty_rest_of_line ();
|
||||
} /* obj_bout_stab() */
|
||||
case 'd':
|
||||
S_SET_NAME (symbolP, NULL); /* .stabd feature. */
|
||||
S_SET_VALUE (symbolP, obstack_next_free (&frags) -
|
||||
frag_now->fr_literal);
|
||||
symbolP->sy_frag = frag_now;
|
||||
break;
|
||||
|
||||
static void obj_bout_desc() {
|
||||
register char *name;
|
||||
register char c;
|
||||
register char *p;
|
||||
register symbolS * symbolP;
|
||||
register int temp;
|
||||
|
||||
/*
|
||||
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
|
||||
{
|
||||
as_bad ("I want a comma after the n_type expression");
|
||||
goof = 1;
|
||||
input_line_pointer--; /* Backup over a non-',' char. */
|
||||
}
|
||||
}
|
||||
if (!goof)
|
||||
{
|
||||
if (get_absolute_expression_and_terminator (&longint) == ',')
|
||||
S_SET_OTHER (symbolP, longint);
|
||||
else
|
||||
{
|
||||
as_bad ("I want a comma after the n_other expression");
|
||||
goof = 1;
|
||||
input_line_pointer--; /* Backup over a non-',' char. */
|
||||
}
|
||||
}
|
||||
if (!goof)
|
||||
{
|
||||
S_SET_DESC (symbolP, get_absolute_expression ());
|
||||
if (what == 's' || what == 'n')
|
||||
{
|
||||
if (*input_line_pointer != ',')
|
||||
{
|
||||
as_bad ("I want a comma after the n_desc expression");
|
||||
goof = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
input_line_pointer++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((!goof) && (what == 's' || what == 'n'))
|
||||
{
|
||||
pseudo_set (symbolP);
|
||||
symbolP->sy_symbol.n_type = saved_type;
|
||||
}
|
||||
#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
|
||||
|
||||
if (goof)
|
||||
ignore_rest_of_line ();
|
||||
else
|
||||
demand_empty_rest_of_line ();
|
||||
} /* obj_bout_stab() */
|
||||
|
||||
static void
|
||||
obj_bout_desc ()
|
||||
{
|
||||
register char *name;
|
||||
register char c;
|
||||
register char *p;
|
||||
register symbolS *symbolP;
|
||||
register int temp;
|
||||
|
||||
/*
|
||||
* Frob invented at RMS' request. Set the n_desc of a symbol.
|
||||
*/
|
||||
name = input_line_pointer;
|
||||
c = get_symbol_end();
|
||||
p = input_line_pointer;
|
||||
* p = c;
|
||||
SKIP_WHITESPACE();
|
||||
if (*input_line_pointer != ',') {
|
||||
*p = 0;
|
||||
as_bad("Expected comma after name \"%s\"", name);
|
||||
*p = c;
|
||||
ignore_rest_of_line();
|
||||
} else {
|
||||
input_line_pointer ++;
|
||||
temp = get_absolute_expression ();
|
||||
*p = 0;
|
||||
symbolP = symbol_find_or_make(name);
|
||||
*p = c;
|
||||
S_SET_DESC(symbolP,temp);
|
||||
}
|
||||
demand_empty_rest_of_line();
|
||||
} /* obj_bout_desc() */
|
||||
name = input_line_pointer;
|
||||
c = get_symbol_end ();
|
||||
p = input_line_pointer;
|
||||
*p = c;
|
||||
SKIP_WHITESPACE ();
|
||||
if (*input_line_pointer != ',')
|
||||
{
|
||||
*p = 0;
|
||||
as_bad ("Expected comma after name \"%s\"", name);
|
||||
*p = c;
|
||||
ignore_rest_of_line ();
|
||||
}
|
||||
else
|
||||
{
|
||||
input_line_pointer++;
|
||||
temp = get_absolute_expression ();
|
||||
*p = 0;
|
||||
symbolP = symbol_find_or_make (name);
|
||||
*p = c;
|
||||
S_SET_DESC (symbolP, temp);
|
||||
}
|
||||
demand_empty_rest_of_line ();
|
||||
} /* obj_bout_desc() */
|
||||
|
||||
void obj_read_begin_hook() {
|
||||
return;
|
||||
} /* obj_read_begin_hook() */
|
||||
|
||||
void obj_crawl_symbol_chain(headers)
|
||||
object_headers *headers;
|
||||
void
|
||||
obj_read_begin_hook ()
|
||||
{
|
||||
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
|
||||
return;
|
||||
} /* obj_read_begin_hook() */
|
||||
|
||||
void
|
||||
obj_crawl_symbol_chain (headers)
|
||||
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)
|
||||
|| S_IS_DEBUG(symbolP)
|
||||
|
||||
|
||||
if (1
|
||||
&& !S_IS_REGISTER (symbolP)
|
||||
&& (!S_GET_NAME (symbolP)
|
||||
|| S_IS_DEBUG (symbolP)
|
||||
#ifdef TC_I960
|
||||
/* FIXME-SOON this ifdef seems highly dubious to me. xoxorich. */
|
||||
|| !S_IS_DEFINED(symbolP)
|
||||
|| S_IS_EXTERNAL(symbolP)
|
||||
/* FIXME-SOON this ifdef seems highly dubious to me. xoxorich. */
|
||||
|| !S_IS_DEFINED (symbolP)
|
||||
|| S_IS_EXTERNAL (symbolP)
|
||||
#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
|
||||
|| (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)) {
|
||||
/* Ordinary case. */
|
||||
symbolP->sy_name_offset = string_byte_count;
|
||||
string_byte_count += strlen(S_GET_NAME(symbolP)) + 1;
|
||||
}
|
||||
else /* .Stabd case. */
|
||||
symbolP->sy_name_offset = 0;
|
||||
symbolPP = &(symbol_next(symbolP));
|
||||
} else {
|
||||
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() */
|
||||
if (!S_IS_STABD (symbolP))
|
||||
{
|
||||
/* Ordinary case. */
|
||||
symbolP->sy_name_offset = string_byte_count;
|
||||
string_byte_count += strlen (S_GET_NAME (symbolP)) + 1;
|
||||
}
|
||||
else /* .Stabd case. */
|
||||
symbolP->sy_name_offset = 0;
|
||||
symbolPP = &(symbol_next (symbolP));
|
||||
}
|
||||
else
|
||||
{
|
||||
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() */
|
||||
|
||||
/*
|
||||
* Find strings by crawling along symbol table chain.
|
||||
*/
|
||||
|
||||
void obj_emit_strings(where)
|
||||
char **where;
|
||||
void
|
||||
obj_emit_strings (where)
|
||||
char **where;
|
||||
{
|
||||
symbolS *symbolP;
|
||||
|
||||
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));
|
||||
*where += sizeof(string_byte_count);
|
||||
/* 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);
|
||||
#else /* CROSS_COMPILE */
|
||||
append(where, (char *) &string_byte_count, (unsigned long) sizeof(string_byte_count));
|
||||
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() */
|
||||
|
||||
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() */
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
|
@ -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
|
||||
@ -66,7 +66,7 @@
|
||||
#define OBJ_DEFAULT_OUTPUT_FILE_NAME "b.out"
|
||||
|
||||
extern const short seg_N_TYPE[];
|
||||
extern const segT N_TYPE_seg[];
|
||||
extern const segT N_TYPE_seg[];
|
||||
|
||||
#define BMAGIC 0415
|
||||
/* We don't accept the following (see N_BADMAG macro).
|
||||
@ -86,25 +86,26 @@ extern const segT N_TYPE_seg[];
|
||||
* 'n' indicates the corresponding segment must begin at an
|
||||
* address that is a multiple of (2**n).
|
||||
*/
|
||||
struct exec {
|
||||
/* Standard stuff */
|
||||
unsigned long a_magic; /* Identifies this as a b.out file */
|
||||
unsigned long a_text; /* Length of text */
|
||||
unsigned long a_data; /* Length of data */
|
||||
unsigned long a_bss; /* Length of runtime uninitialized data area */
|
||||
unsigned long a_syms; /* Length of symbol table */
|
||||
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 */
|
||||
unsigned char a_talign; /* Alignment of text segment */
|
||||
unsigned char a_dalign; /* Alignment of data segment */
|
||||
unsigned char a_balign; /* Alignment of bss segment */
|
||||
unsigned char a_relaxable; /* Contains enough info to relax */
|
||||
};
|
||||
struct exec
|
||||
{
|
||||
/* Standard stuff */
|
||||
unsigned long a_magic; /* Identifies this as a b.out file */
|
||||
unsigned long a_text; /* Length of text */
|
||||
unsigned long a_data; /* Length of data */
|
||||
unsigned long a_bss; /* Length of runtime uninitialized data area */
|
||||
unsigned long a_syms; /* Length of symbol table */
|
||||
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 */
|
||||
unsigned char a_talign; /* Alignment of text segment */
|
||||
unsigned char a_dalign; /* Alignment of data segment */
|
||||
unsigned char a_balign; /* Alignment of bss segment */
|
||||
unsigned char a_relaxable; /* Contains enough info to relax */
|
||||
};
|
||||
|
||||
#define N_BADMAG(x) (((x).a_magic)!=BMAGIC)
|
||||
#define N_TXTOFF(x) ( sizeof(struct exec) )
|
||||
@ -116,53 +117,57 @@ struct exec {
|
||||
|
||||
/* A single entry in the symbol table
|
||||
*/
|
||||
struct nlist {
|
||||
union {
|
||||
char *n_name;
|
||||
struct nlist *n_next;
|
||||
long n_strx; /* Index into string table */
|
||||
} n_un;
|
||||
unsigned char n_type; /* See below */
|
||||
char n_other; /* Used in i80960 support -- see below */
|
||||
short n_desc;
|
||||
unsigned long n_value;
|
||||
};
|
||||
struct nlist
|
||||
{
|
||||
union
|
||||
{
|
||||
char *n_name;
|
||||
struct nlist *n_next;
|
||||
long n_strx; /* Index into string table */
|
||||
}
|
||||
n_un;
|
||||
unsigned char n_type; /* See below */
|
||||
char n_other; /* Used in i80960 support -- see below */
|
||||
short n_desc;
|
||||
unsigned long n_value;
|
||||
};
|
||||
|
||||
typedef struct nlist obj_symbol_type;
|
||||
|
||||
/* Legal values of n_type
|
||||
*/
|
||||
#define N_UNDF 0 /* Undefined symbol */
|
||||
#define N_ABS 2 /* Absolute symbol */
|
||||
#define N_TEXT 4 /* Text symbol */
|
||||
#define N_DATA 6 /* Data symbol */
|
||||
#define N_BSS 8 /* BSS symbol */
|
||||
#define N_FN 31 /* Filename symbol */
|
||||
#define N_UNDF 0 /* Undefined symbol */
|
||||
#define N_ABS 2 /* Absolute symbol */
|
||||
#define N_TEXT 4 /* Text symbol */
|
||||
#define N_DATA 6 /* Data symbol */
|
||||
#define N_BSS 8 /* BSS symbol */
|
||||
#define N_FN 31 /* Filename symbol */
|
||||
|
||||
#define N_EXT 1 /* External symbol (OR'd in with one of above) */
|
||||
#define N_TYPE 036 /* Mask for all the type bits */
|
||||
#define N_STAB 0340 /* Mask for all bits used for SDB entries */
|
||||
#define N_EXT 1 /* External symbol (OR'd in with one of above) */
|
||||
#define N_TYPE 036 /* Mask for all the type bits */
|
||||
#define N_STAB 0340 /* Mask for all bits used for SDB entries */
|
||||
|
||||
#ifndef CUSTOM_RELOC_FORMAT
|
||||
struct relocation_info {
|
||||
int r_address; /* File address of item to be relocated */
|
||||
unsigned
|
||||
r_index:24,/* Index of symbol on which relocation is based*/
|
||||
r_pcrel:1, /* 1 => relocate PC-relative; else absolute
|
||||
struct relocation_info
|
||||
{
|
||||
int r_address; /* File address of item to be relocated */
|
||||
unsigned
|
||||
r_index:24, /* Index of symbol on which relocation is based*/
|
||||
r_pcrel:1, /* 1 => relocate PC-relative; else absolute
|
||||
* On i960, pc-relative implies 24-bit
|
||||
* address, absolute implies 32-bit.
|
||||
*/
|
||||
r_length:2, /* Number of bytes to relocate:
|
||||
r_length:2, /* Number of bytes to relocate:
|
||||
* 0 => 1 byte
|
||||
* 1 => 2 bytes
|
||||
* 2 => 4 bytes -- only value used for i960
|
||||
*/
|
||||
r_extern:1,
|
||||
r_bsr:1, /* Something for the GNU NS32K assembler */
|
||||
r_disp:1, /* Something for the GNU NS32K assembler */
|
||||
r_callj:1, /* 1 if relocation target is an i960 'callj' */
|
||||
nuthin:1; /* Unused */
|
||||
};
|
||||
r_extern:1, r_bsr:1, /* Something for the GNU NS32K assembler */
|
||||
r_disp:1, /* Something for the GNU NS32K assembler */
|
||||
r_callj:1, /* 1 if relocation target is an i960 'callj' */
|
||||
nuthin:1; /* Unused */
|
||||
};
|
||||
|
||||
#endif /* CUSTOM_RELOC_FORMAT */
|
||||
|
||||
/*
|
||||
@ -279,17 +284,20 @@ 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).
|
||||
*/
|
||||
#define segment_name(seg) ( seg_name[(int)(seg)] )
|
||||
extern char *const seg_name[];
|
||||
|
||||
typedef struct {
|
||||
struct exec header; /* a.out header */
|
||||
long string_table_size; /* names + '\0' + sizeof(int) */
|
||||
} object_headers;
|
||||
typedef struct
|
||||
{
|
||||
struct exec header; /* a.out header */
|
||||
long string_table_size; /* names + '\0' + sizeof(int) */
|
||||
}
|
||||
|
||||
object_headers;
|
||||
|
||||
/* unused hooks. */
|
||||
#define OBJ_EMIT_LINENO(a, b, c) {;}
|
||||
@ -297,9 +305,9 @@ typedef struct {
|
||||
|
||||
#if __STDC__
|
||||
struct fix;
|
||||
void tc_aout_fix_to_chars(char *where, struct fix *fixP, relax_addressT segment_address);
|
||||
void tc_aout_fix_to_chars (char *where, struct fix *fixP, relax_addressT segment_address);
|
||||
#else /* not __STDC__ */
|
||||
void tc_aout_fix_to_chars();
|
||||
void tc_aout_fix_to_chars ();
|
||||
#endif /* not __STDC__ */
|
||||
|
||||
/*
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,18 +1,22 @@
|
||||
|
||||
|
||||
|
||||
|
||||
/* 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. */
|
||||
@ -69,32 +73,32 @@
|
||||
#else
|
||||
help me
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
/* Define some processor dependent values according to the processor we are
|
||||
/* Define some processor dependent values according to the processor we are
|
||||
on. */
|
||||
#if defined(TC_H8300)
|
||||
#define BYTE_ORDERING 0
|
||||
#define FILE_HEADER_MAGIC H8300MAGIC
|
||||
#elif defined(TC_M68K)
|
||||
|
||||
#define BYTE_ORDERING F_AR32W /* See filehdr.h for more info. */
|
||||
#define BYTE_ORDERING F_AR32W /* See filehdr.h for more info. */
|
||||
#ifndef FILE_HEADER_MAGIC
|
||||
#define FILE_HEADER_MAGIC MC68MAGIC /* ... */
|
||||
#define FILE_HEADER_MAGIC MC68MAGIC /* ... */
|
||||
#endif /* FILE_HEADER_MAGIC */
|
||||
|
||||
#elif defined(TC_I386)
|
||||
|
||||
#define BYTE_ORDERING F_AR32WR /* See filehdr.h for more info. */
|
||||
#define BYTE_ORDERING F_AR32WR /* See filehdr.h for more info. */
|
||||
#ifndef FILE_HEADER_MAGIC
|
||||
#define FILE_HEADER_MAGIC I386MAGIC /* ... */
|
||||
#define FILE_HEADER_MAGIC I386MAGIC /* ... */
|
||||
#endif /* FILE_HEADER_MAGIC */
|
||||
|
||||
#elif defined(TC_I960)
|
||||
|
||||
#define BYTE_ORDERING F_AR32WR /* See filehdr.h for more info. */
|
||||
#define BYTE_ORDERING F_AR32WR /* See filehdr.h for more info. */
|
||||
#ifndef FILE_HEADER_MAGIC
|
||||
#define FILE_HEADER_MAGIC I960ROMAGIC /* ... */
|
||||
#define FILE_HEADER_MAGIC I960ROMAGIC /* ... */
|
||||
#endif /* FILE_HEADER_MAGIC */
|
||||
|
||||
#elif defined(TC_A29K)
|
||||
@ -104,17 +108,17 @@ help me
|
||||
#define FILE_HEADER_MAGIC SIPFBOMAGIC
|
||||
#endif /* FILE_HEADER_MAGIC */
|
||||
#else
|
||||
you lose
|
||||
#endif
|
||||
|
||||
you lose
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef OBJ_COFF_MAX_AUXENTRIES
|
||||
#define OBJ_COFF_MAX_AUXENTRIES 1
|
||||
#endif /* OBJ_COFF_MAX_AUXENTRIES */
|
||||
|
||||
|
||||
extern const segT N_TYPE_seg[];
|
||||
|
||||
|
||||
extern const segT N_TYPE_seg[];
|
||||
|
||||
/* Magic number of paged executable. */
|
||||
#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE 0x8300
|
||||
@ -129,13 +133,15 @@ 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;
|
||||
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;
|
||||
|
||||
#ifndef DO_NOT_STRIP
|
||||
#define DO_NOT_STRIP 0
|
||||
@ -143,7 +149,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.
|
||||
*/
|
||||
|
||||
@ -194,7 +200,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 */
|
||||
@ -280,27 +286,27 @@ typedef struct
|
||||
* differently.
|
||||
*/
|
||||
|
||||
#define SF_I960_MASK (0x000001ff) /* Bits 0-8 are used by the i960 port. */
|
||||
#define SF_SYSPROC (0x0000003f) /* bits 0-5 are used to store the sysproc number */
|
||||
#define SF_IS_SYSPROC (0x00000040) /* bit 6 marks symbols that are sysprocs */
|
||||
#define SF_BALNAME (0x00000080) /* bit 7 marks BALNAME symbols */
|
||||
#define SF_CALLNAME (0x00000100) /* bit 8 marks CALLNAME symbols */
|
||||
#define SF_I960_MASK (0x000001ff) /* Bits 0-8 are used by the i960 port. */
|
||||
#define SF_SYSPROC (0x0000003f) /* bits 0-5 are used to store the sysproc number */
|
||||
#define SF_IS_SYSPROC (0x00000040) /* bit 6 marks symbols that are sysprocs */
|
||||
#define SF_BALNAME (0x00000080) /* bit 7 marks BALNAME symbols */
|
||||
#define SF_CALLNAME (0x00000100) /* bit 8 marks CALLNAME symbols */
|
||||
|
||||
#define SF_NORMAL_MASK (0x0000ffff) /* bits 12-15 are general purpose. */
|
||||
#define SF_NORMAL_MASK (0x0000ffff) /* bits 12-15 are general purpose. */
|
||||
|
||||
#define SF_STATICS (0x00001000) /* Mark the .text & all symbols */
|
||||
#define SF_DEFINED (0x00002000) /* Symbol is defined in this file */
|
||||
#define SF_STRING (0x00004000) /* Symbol name length > 8 */
|
||||
#define SF_LOCAL (0x00008000) /* Symbol must not be emitted */
|
||||
#define SF_STATICS (0x00001000) /* Mark the .text & all symbols */
|
||||
#define SF_DEFINED (0x00002000) /* Symbol is defined in this file */
|
||||
#define SF_STRING (0x00004000) /* Symbol name length > 8 */
|
||||
#define SF_LOCAL (0x00008000) /* Symbol must not be emitted */
|
||||
|
||||
#define SF_DEBUG_MASK (0xffff0000) /* bits 16-31 are debug info */
|
||||
#define SF_DEBUG_MASK (0xffff0000) /* bits 16-31 are debug info */
|
||||
|
||||
#define SF_FUNCTION (0x00010000) /* The symbol is a function */
|
||||
#define SF_PROCESS (0x00020000) /* Process symbol before write */
|
||||
#define SF_TAGGED (0x00040000) /* Is associated with a tag */
|
||||
#define SF_TAG (0x00080000) /* Is a tag */
|
||||
#define SF_DEBUG (0x00100000) /* Is in debug or abs section */
|
||||
#define SF_GET_SEGMENT (0x00200000) /* Get the section of the forward symbol. */
|
||||
#define SF_FUNCTION (0x00010000) /* The symbol is a function */
|
||||
#define SF_PROCESS (0x00020000) /* Process symbol before write */
|
||||
#define SF_TAGGED (0x00040000) /* Is associated with a tag */
|
||||
#define SF_TAG (0x00080000) /* Is a tag */
|
||||
#define SF_DEBUG (0x00100000) /* Is in debug or abs section */
|
||||
#define SF_GET_SEGMENT (0x00200000) /* Get the section of the forward symbol. */
|
||||
/* All other bits are unused. */
|
||||
|
||||
/* Accessors */
|
||||
@ -318,11 +324,11 @@ typedef struct
|
||||
#define SF_GET_TAGGED(s) ((s)->sy_symbol.ost_flags & SF_TAGGED)
|
||||
#define SF_GET_TAG(s) ((s)->sy_symbol.ost_flags & SF_TAG)
|
||||
#define SF_GET_GET_SEGMENT(s) ((s)->sy_symbol.ost_flags & SF_GET_SEGMENT)
|
||||
#define SF_GET_I960(s) ((s)->sy_symbol.ost_flags & SF_I960_MASK) /* used by i960 */
|
||||
#define SF_GET_BALNAME(s) ((s)->sy_symbol.ost_flags & SF_BALNAME) /* used by i960 */
|
||||
#define SF_GET_CALLNAME(s) ((s)->sy_symbol.ost_flags & SF_CALLNAME) /* used by i960 */
|
||||
#define SF_GET_IS_SYSPROC(s) ((s)->sy_symbol.ost_flags & SF_IS_SYSPROC) /* used by i960 */
|
||||
#define SF_GET_SYSPROC(s) ((s)->sy_symbol.ost_flags & SF_SYSPROC) /* used by i960 */
|
||||
#define SF_GET_I960(s) ((s)->sy_symbol.ost_flags & SF_I960_MASK) /* used by i960 */
|
||||
#define SF_GET_BALNAME(s) ((s)->sy_symbol.ost_flags & SF_BALNAME) /* used by i960 */
|
||||
#define SF_GET_CALLNAME(s) ((s)->sy_symbol.ost_flags & SF_CALLNAME) /* used by i960 */
|
||||
#define SF_GET_IS_SYSPROC(s) ((s)->sy_symbol.ost_flags & SF_IS_SYSPROC) /* used by i960 */
|
||||
#define SF_GET_SYSPROC(s) ((s)->sy_symbol.ost_flags & SF_SYSPROC) /* used by i960 */
|
||||
|
||||
/* Modifiers */
|
||||
#define SF_SET(s,v) ((s)->sy_symbol.ost_flags = (v))
|
||||
@ -340,11 +346,11 @@ typedef struct
|
||||
#define SF_SET_TAGGED(s) ((s)->sy_symbol.ost_flags |= SF_TAGGED)
|
||||
#define SF_SET_TAG(s) ((s)->sy_symbol.ost_flags |= SF_TAG)
|
||||
#define SF_SET_GET_SEGMENT(s) ((s)->sy_symbol.ost_flags |= SF_GET_SEGMENT)
|
||||
#define SF_SET_I960(s,v) ((s)->sy_symbol.ost_flags |= ((v) & SF_I960_MASK)) /* used by i960 */
|
||||
#define SF_SET_BALNAME(s) ((s)->sy_symbol.ost_flags |= SF_BALNAME) /* used by i960 */
|
||||
#define SF_SET_CALLNAME(s) ((s)->sy_symbol.ost_flags |= SF_CALLNAME) /* used by i960 */
|
||||
#define SF_SET_IS_SYSPROC(s) ((s)->sy_symbol.ost_flags |= SF_IS_SYSPROC) /* used by i960 */
|
||||
#define SF_SET_SYSPROC(s,v) ((s)->sy_symbol.ost_flags |= ((v) & SF_SYSPROC)) /* used by i960 */
|
||||
#define SF_SET_I960(s,v) ((s)->sy_symbol.ost_flags |= ((v) & SF_I960_MASK)) /* used by i960 */
|
||||
#define SF_SET_BALNAME(s) ((s)->sy_symbol.ost_flags |= SF_BALNAME) /* used by i960 */
|
||||
#define SF_SET_CALLNAME(s) ((s)->sy_symbol.ost_flags |= SF_CALLNAME) /* used by i960 */
|
||||
#define SF_SET_IS_SYSPROC(s) ((s)->sy_symbol.ost_flags |= SF_IS_SYSPROC) /* used by i960 */
|
||||
#define SF_SET_SYSPROC(s,v) ((s)->sy_symbol.ost_flags |= ((v) & SF_SYSPROC)) /* used by i960 */
|
||||
|
||||
/* File header macro and type definition */
|
||||
|
||||
@ -451,79 +457,85 @@ typedef struct
|
||||
/* Segment flipping */
|
||||
#define segment_name(v) (seg_name[(int) (v)])
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
#ifdef BFD_HEADERS
|
||||
struct internal_aouthdr aouthdr; /* a.out header */
|
||||
struct internal_filehdr filehdr; /* File header, not machine dep. */
|
||||
struct internal_aouthdr aouthdr; /* a.out header */
|
||||
struct internal_filehdr filehdr; /* File header, not machine dep. */
|
||||
#else
|
||||
AOUTHDR aouthdr; /* a.out header */
|
||||
FILHDR filehdr; /* File header, not machine dep. */
|
||||
AOUTHDR aouthdr; /* a.out header */
|
||||
FILHDR filehdr; /* File header, not machine dep. */
|
||||
#endif
|
||||
long string_table_size; /* names + '\0' + sizeof(int) */
|
||||
long relocation_size; /* Cumulated size of relocation
|
||||
long string_table_size; /* names + '\0' + sizeof(int) */
|
||||
long relocation_size; /* Cumulated size of relocation
|
||||
information for all sections in
|
||||
bytes. */
|
||||
long lineno_size; /* Size of the line number information
|
||||
long lineno_size; /* Size of the line number information
|
||||
table in bytes */
|
||||
} object_headers;
|
||||
}
|
||||
|
||||
object_headers;
|
||||
|
||||
|
||||
|
||||
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 */
|
||||
} ;
|
||||
|
||||
struct bfd_internal_lineno line;
|
||||
char *frag; /* Frag to which the line number is related */
|
||||
struct lineno_list *next; /* Forward chain pointer */
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/* stack stuff */
|
||||
typedef struct {
|
||||
unsigned long chunk_size;
|
||||
unsigned long element_size;
|
||||
unsigned long size;
|
||||
char* data;
|
||||
unsigned long pointer;
|
||||
} stack;
|
||||
typedef struct
|
||||
{
|
||||
unsigned long chunk_size;
|
||||
unsigned long element_size;
|
||||
unsigned long size;
|
||||
char *data;
|
||||
unsigned long pointer;
|
||||
}
|
||||
|
||||
stack;
|
||||
|
||||
|
||||
|
||||
char *EXFUN(stack_pop,(stack *st));
|
||||
char *EXFUN(stack_push,(stack *st, char *element));
|
||||
char *EXFUN(stack_top,(stack *st));
|
||||
stack *EXFUN(stack_init,(unsigned long chunk_size, unsigned long element_size));
|
||||
void EXFUN(c_dot_file_symbol,(char *filename));
|
||||
void EXFUN(obj_extra_stuff,(object_headers *headers));
|
||||
void EXFUN(stack_delete,(stack *st));
|
||||
char *EXFUN (stack_pop, (stack * st));
|
||||
char *EXFUN (stack_push, (stack * st, char *element));
|
||||
char *EXFUN (stack_top, (stack * st));
|
||||
stack *EXFUN (stack_init, (unsigned long chunk_size, unsigned long element_size));
|
||||
void EXFUN (c_dot_file_symbol, (char *filename));
|
||||
void EXFUN (obj_extra_stuff, (object_headers * headers));
|
||||
void EXFUN (stack_delete, (stack * st));
|
||||
|
||||
|
||||
|
||||
void EXFUN(c_section_header,(
|
||||
|
||||
struct internal_scnhdr *header,
|
||||
char *name,
|
||||
long core_address,
|
||||
long size,
|
||||
long data_ptr,
|
||||
long reloc_ptr,
|
||||
long lineno_ptr,
|
||||
long reloc_number,
|
||||
long lineno_number,
|
||||
long alignment));
|
||||
void EXFUN (c_section_header, (
|
||||
|
||||
struct internal_scnhdr * header,
|
||||
char *name,
|
||||
long core_address,
|
||||
long size,
|
||||
long data_ptr,
|
||||
long reloc_ptr,
|
||||
long lineno_ptr,
|
||||
long reloc_number,
|
||||
long lineno_number,
|
||||
long alignment));
|
||||
|
||||
|
||||
/* sanity check */
|
||||
|
||||
#ifdef TC_I960
|
||||
#ifndef C_LEAFSTAT
|
||||
hey! Where is the C_LEAFSTAT definition? i960-coff support is depending on it.
|
||||
hey ! Where is the C_LEAFSTAT definition ? i960 - coff support is depending on it.
|
||||
#endif /* no C_LEAFSTAT */
|
||||
#endif /* TC_I960 */
|
||||
#ifdef BFD_HEADERS
|
||||
extern struct internal_scnhdr data_section_header;
|
||||
extern struct internal_scnhdr data_section_header;
|
||||
extern struct internal_scnhdr text_section_header;
|
||||
#else
|
||||
extern SCNHDR data_section_header;
|
||||
|
@ -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. */
|
||||
|
@ -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. */
|
||||
@ -43,32 +43,35 @@
|
||||
/* #define SYMBOLS_NEED_PACKPOINTERS */
|
||||
|
||||
/* */
|
||||
typedef struct {
|
||||
void *nothing;
|
||||
} obj_symbol_type; /* should be the format's symbol structure */
|
||||
typedef struct
|
||||
{
|
||||
void *nothing;
|
||||
}
|
||||
|
||||
obj_symbol_type; /* should be the format's symbol structure */
|
||||
|
||||
typedef void *object_headers;
|
||||
|
||||
/* symbols have names */
|
||||
#define S_GET_NAME(s) ("foo") /* get the name of a symbolP */
|
||||
#define S_GET_NAME(s) ("foo") /* get the name of a symbolP */
|
||||
#define S_SET_NAME(s,v) ;
|
||||
/* symbols have segments */
|
||||
/* symbols have segments */
|
||||
#define S_GET_SEGMENT(s) (SEG_UNKNOWN)
|
||||
#define S_SET_SEGMENT(s,v) ;
|
||||
/* symbols have a value */
|
||||
/* symbols have a value */
|
||||
#define S_GET_VALUE(s) (0)
|
||||
#define S_SET_VALUE(s,v) ;
|
||||
/* symbols may be external */
|
||||
/* symbols may be external */
|
||||
#define S_IS_EXTERNAL(s) (0)
|
||||
#define S_SET_EXTERNAL(s) ;
|
||||
|
||||
/* symbols may or may not be defined */
|
||||
|
||||
/* symbols may or may not be defined */
|
||||
#define S_IS_DEFINED(s) (0)
|
||||
|
||||
|
||||
#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (0) /* your magic number */
|
||||
#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (0) /* your magic number */
|
||||
|
||||
#define OBJ_EMIT_LINENO(a,b,c) /* must be *something*. This no-op's it out. */
|
||||
#define OBJ_EMIT_LINENO(a,b,c) /* must be *something*. This no-op's it out. */
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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,17 +22,21 @@
|
||||
|
||||
#include <bfd.h>
|
||||
|
||||
typedef struct
|
||||
typedef struct
|
||||
{
|
||||
asymbol sy;
|
||||
int seg;
|
||||
} obj_symbol_type;
|
||||
asymbol sy;
|
||||
int seg;
|
||||
}
|
||||
|
||||
obj_symbol_type;
|
||||
|
||||
#define S_GET_NAME(s) (((s)->sy_symbol.sy.name))
|
||||
|
||||
typedef struct {
|
||||
int x;
|
||||
}
|
||||
typedef struct
|
||||
{
|
||||
int x;
|
||||
}
|
||||
|
||||
object_headers;
|
||||
|
||||
#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE 1
|
||||
|
1702
gas/config/tc-a29k.c
1702
gas/config/tc-a29k.c
File diff suppressed because it is too large
Load Diff
@ -19,16 +19,16 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#define TC_A29K
|
||||
|
||||
#define tc_headers_hook(a) ; /* not used */
|
||||
#define tc_headers_hook(a) ; /* not used */
|
||||
#define tc_crawl_symbol_chain(a) ; /* not used */
|
||||
#define tc_coff_symbol_emit_hook(a) ; /* not used */
|
||||
#define tc_headers_hook(a) ; /* not used */
|
||||
#define tc_headers_hook(a) ; /* not used */
|
||||
#define tc_crawl_symbol_chain(a) ; /* not used */
|
||||
#define tc_coff_symbol_emit_hook(a) ; /* not used */
|
||||
|
||||
#define AOUT_MACHTYPE 101
|
||||
#define TC_COFF_FIX2RTYPE(fix_ptr) tc_coff_fix2rtype(fix_ptr)
|
||||
#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
|
||||
*/
|
||||
@ -37,4 +37,3 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#define COFF_FLAGS F_AR32W
|
||||
#define reloc_type int
|
||||
|
||||
|
3650
gas/config/tc-i386.c
3650
gas/config/tc-i386.c
File diff suppressed because it is too large
Load Diff
3742
gas/config/tc-i960.c
3742
gas/config/tc-i960.c
File diff suppressed because it is too large
Load Diff
7250
gas/config/tc-m68k.c
7250
gas/config/tc-m68k.c
File diff suppressed because it is too large
Load Diff
@ -102,18 +102,22 @@ struct field_val_assoc fcr_regs[] =
|
||||
struct field_val_assoc cmpslot[] =
|
||||
{
|
||||
/* Integer Floating point */
|
||||
{"nc", 0},
|
||||
{"cp", 1},
|
||||
{"nc", 0},
|
||||
{"cp", 1},
|
||||
{"eq", 2},
|
||||
{"ne", 3},
|
||||
{"gt", 4},
|
||||
{"le", 5},
|
||||
{"lt", 6},
|
||||
{"ge", 7},
|
||||
{"hi", 8}, {"ou", 8},
|
||||
{"ls", 9}, {"ib", 9},
|
||||
{"lo", 10}, {"in", 10},
|
||||
{"hs", 11}, {"ob", 11},
|
||||
{"hi", 8},
|
||||
{"ou", 8},
|
||||
{"ls", 9},
|
||||
{"ib", 9},
|
||||
{"lo", 10},
|
||||
{"in", 10},
|
||||
{"hs", 11},
|
||||
{"ob", 11},
|
||||
|
||||
{NULL, 0},
|
||||
};
|
||||
@ -163,8 +167,8 @@ const char EXP_CHARS[] = "eE";
|
||||
/* or 0H1.234E-12 (see exp chars above) */
|
||||
const char FLT_CHARS[] = "dDfF";
|
||||
|
||||
extern void float_cons (), cons (), s_globl (), s_line (),
|
||||
s_space (), s_set (), stringer (), s_lcomm ();
|
||||
extern void float_cons (), cons (), s_globl (), s_line (), s_space (),
|
||||
s_set (), stringer (), s_lcomm ();
|
||||
static void s_file ();
|
||||
static void s_bss ();
|
||||
|
||||
@ -174,11 +178,11 @@ const pseudo_typeS md_pseudo_table[] =
|
||||
{"dfloat", float_cons, 'd'},
|
||||
{"ffloat", float_cons, 'f'},
|
||||
{"global", s_globl, 0},
|
||||
{"half", cons, 2 },
|
||||
{"half", cons, 2},
|
||||
{"bss", s_bss, 0},
|
||||
{"ln", s_line, 0},
|
||||
{"string", stringer, 0},
|
||||
{"word", cons, 4 },
|
||||
{"word", cons, 4},
|
||||
{"zero", s_space, 0},
|
||||
{0}
|
||||
};
|
||||
@ -207,7 +211,7 @@ md_begin ()
|
||||
|
||||
if (retval != NULL && *retval != '\0')
|
||||
as_fatal ("Can't hash instruction '%s':%s",
|
||||
m88k_opcodes[i].name, retval);
|
||||
m88k_opcodes[i].name, retval);
|
||||
|
||||
/* skip to next unique mnemonic or end of list */
|
||||
|
||||
@ -742,7 +746,7 @@ get_bf (param, valp)
|
||||
*param++ = 0; /* Overwrite the '>' */
|
||||
|
||||
width = get_absolute_expression ();
|
||||
xp = get_bf_offset_expression (xp, &offset);
|
||||
xp = get_bf_offset_expression (xp, &offset);
|
||||
input_line_pointer = save_ptr;
|
||||
|
||||
if (xp + 1 != param)
|
||||
@ -867,7 +871,7 @@ get_vec9 (param, valp)
|
||||
|
||||
return param;
|
||||
}
|
||||
|
||||
|
||||
#define hexval(z) \
|
||||
(isdigit (z) ? (z) - '0' : \
|
||||
islower (z) ? (z) - 'a' + 10 : \
|
||||
@ -922,9 +926,9 @@ getval (param, valp)
|
||||
|
||||
void
|
||||
md_number_to_chars (buf, val, nbytes)
|
||||
char *buf;
|
||||
int val;
|
||||
int nbytes;
|
||||
char *buf;
|
||||
int val;
|
||||
int nbytes;
|
||||
{
|
||||
switch (nbytes)
|
||||
{
|
||||
@ -944,11 +948,11 @@ int nbytes;
|
||||
|
||||
void
|
||||
md_number_to_imm (buf, val, nbytes, fixP, seg_type)
|
||||
unsigned char *buf;
|
||||
unsigned int val;
|
||||
int nbytes;
|
||||
fixS *fixP;
|
||||
int seg_type;
|
||||
unsigned char *buf;
|
||||
unsigned int val;
|
||||
int nbytes;
|
||||
fixS *fixP;
|
||||
int seg_type;
|
||||
{
|
||||
if (seg_type != N_TEXT || fixP->fx_r_type == NO_RELOC)
|
||||
{
|
||||
@ -1015,9 +1019,9 @@ int seg_type;
|
||||
|
||||
void
|
||||
md_number_to_disp (buf, val, nbytes)
|
||||
char *buf;
|
||||
int val;
|
||||
int nbytes;
|
||||
char *buf;
|
||||
int val;
|
||||
int nbytes;
|
||||
{
|
||||
as_fatal ("md_number_to_disp not defined");
|
||||
md_number_to_chars (buf, val, nbytes);
|
||||
@ -1025,9 +1029,9 @@ int nbytes;
|
||||
|
||||
void
|
||||
md_number_to_field (buf, val, nbytes)
|
||||
char *buf;
|
||||
int val;
|
||||
int nbytes;
|
||||
char *buf;
|
||||
int val;
|
||||
int nbytes;
|
||||
{
|
||||
as_fatal ("md_number_to_field not defined");
|
||||
md_number_to_chars (buf, val, nbytes);
|
||||
@ -1045,11 +1049,11 @@ md_atof (type, litP, sizeP)
|
||||
char *litP;
|
||||
int *sizeP;
|
||||
{
|
||||
int prec;
|
||||
int prec;
|
||||
LITTLENUM_TYPE words[MAX_LITTLENUMS];
|
||||
LITTLENUM_TYPE *wordP;
|
||||
char *t;
|
||||
char *atof_ieee ();
|
||||
char *t;
|
||||
char *atof_ieee ();
|
||||
|
||||
switch (type)
|
||||
{
|
||||
@ -1078,20 +1082,20 @@ md_atof (type, litP, sizeP)
|
||||
break;
|
||||
|
||||
default:
|
||||
*sizeP=0;
|
||||
*sizeP = 0;
|
||||
return "Bad call to MD_ATOF()";
|
||||
}
|
||||
t=atof_ieee (input_line_pointer, type, words);
|
||||
t = atof_ieee (input_line_pointer, type, words);
|
||||
if (t)
|
||||
input_line_pointer=t;
|
||||
input_line_pointer = t;
|
||||
|
||||
*sizeP=prec * sizeof (LITTLENUM_TYPE);
|
||||
for (wordP=words;prec--;)
|
||||
*sizeP = prec * sizeof (LITTLENUM_TYPE);
|
||||
for (wordP = words; prec--;)
|
||||
{
|
||||
md_number_to_chars (litP, (long) (*wordP++), sizeof (LITTLENUM_TYPE));
|
||||
litP+=sizeof (LITTLENUM_TYPE);
|
||||
litP += sizeof (LITTLENUM_TYPE);
|
||||
}
|
||||
return ""; /* Someone should teach Dean about null pointers */
|
||||
return ""; /* Someone should teach Dean about null pointers */
|
||||
}
|
||||
|
||||
int md_short_jump_size = 4;
|
||||
@ -1103,7 +1107,10 @@ md_create_short_jump (ptr, from_addr, to_addr, frag, to_symbol)
|
||||
fragS *frag;
|
||||
symbolS *to_symbol;
|
||||
{
|
||||
ptr[0] = 0xc0; ptr[1] = 0x00; ptr[2] = 0x00; ptr[3] = 0x00;
|
||||
ptr[0] = 0xc0;
|
||||
ptr[1] = 0x00;
|
||||
ptr[2] = 0x00;
|
||||
ptr[3] = 0x00;
|
||||
fix_new (frag,
|
||||
ptr - frag->fr_literal,
|
||||
4,
|
||||
@ -1123,7 +1130,10 @@ md_create_long_jump (ptr, from_addr, to_addr, frag, to_symbol)
|
||||
fragS *frag;
|
||||
symbolS *to_symbol;
|
||||
{
|
||||
ptr[0] = 0xc0; ptr[1] = 0x00; ptr[2] = 0x00; ptr[3] = 0x00;
|
||||
ptr[0] = 0xc0;
|
||||
ptr[1] = 0x00;
|
||||
ptr[2] = 0x00;
|
||||
ptr[3] = 0x00;
|
||||
fix_new (frag,
|
||||
ptr - frag->fr_literal,
|
||||
4,
|
||||
@ -1142,7 +1152,8 @@ md_estimate_size_before_relax (fragP, segment_type)
|
||||
as_fatal ("Relaxation should never occur");
|
||||
}
|
||||
|
||||
const relax_typeS md_relax_table[] = {0};
|
||||
const relax_typeS md_relax_table[] =
|
||||
{0};
|
||||
|
||||
void
|
||||
md_convert_frag (fragP)
|
||||
@ -1162,104 +1173,114 @@ md_end ()
|
||||
*/
|
||||
void
|
||||
emit_relocations (fixP, segment_address_in_file)
|
||||
fixS *fixP;
|
||||
relax_addressT segment_address_in_file;
|
||||
fixS *fixP;
|
||||
relax_addressT segment_address_in_file;
|
||||
{
|
||||
struct reloc_info_m88k ri;
|
||||
symbolS *symbolP;
|
||||
extern char *next_object_file_charP;
|
||||
struct reloc_info_m88k ri;
|
||||
symbolS *symbolP;
|
||||
extern char *next_object_file_charP;
|
||||
|
||||
bzero ((char *) &ri, sizeof (ri));
|
||||
for (; fixP; fixP = fixP->fx_next) {
|
||||
bzero ((char *) &ri, sizeof (ri));
|
||||
for (; fixP; fixP = fixP->fx_next)
|
||||
{
|
||||
|
||||
if (fixP->fx_r_type >= NO_RELOC) {
|
||||
fprintf (stderr, "fixP->fx_r_type = %d\n", fixP->fx_r_type);
|
||||
abort ();
|
||||
if (fixP->fx_r_type >= NO_RELOC)
|
||||
{
|
||||
fprintf (stderr, "fixP->fx_r_type = %d\n", fixP->fx_r_type);
|
||||
abort ();
|
||||
}
|
||||
|
||||
if ((symbolP = fixP->fx_addsy) != NULL) {
|
||||
ri.r_address = fixP->fx_frag->fr_address +
|
||||
fixP->fx_where - segment_address_in_file;
|
||||
if ((symbolP->sy_type & N_TYPE) == N_UNDF) {
|
||||
ri.r_extern = 1;
|
||||
ri.r_symbolnum = symbolP->sy_number;
|
||||
} else {
|
||||
ri.r_extern = 0;
|
||||
ri.r_symbolnum = symbolP->sy_type & N_TYPE;
|
||||
if ((symbolP = fixP->fx_addsy) != NULL)
|
||||
{
|
||||
ri.r_address = fixP->fx_frag->fr_address +
|
||||
fixP->fx_where - segment_address_in_file;
|
||||
if ((symbolP->sy_type & N_TYPE) == N_UNDF)
|
||||
{
|
||||
ri.r_extern = 1;
|
||||
ri.r_symbolnum = symbolP->sy_number;
|
||||
}
|
||||
if (symbolP && symbolP->sy_frag) {
|
||||
ri.r_addend = symbolP->sy_frag->fr_address;
|
||||
else
|
||||
{
|
||||
ri.r_extern = 0;
|
||||
ri.r_symbolnum = symbolP->sy_type & N_TYPE;
|
||||
}
|
||||
ri.r_type = fixP->fx_r_type;
|
||||
if (fixP->fx_pcrel) {
|
||||
/* ri.r_addend -= fixP->fx_where; */
|
||||
ri.r_addend -= ri.r_address;
|
||||
} else {
|
||||
ri.r_addend = fixP->fx_addnumber;
|
||||
if (symbolP && symbolP->sy_frag)
|
||||
{
|
||||
ri.r_addend = symbolP->sy_frag->fr_address;
|
||||
}
|
||||
ri.r_type = fixP->fx_r_type;
|
||||
if (fixP->fx_pcrel)
|
||||
{
|
||||
/* ri.r_addend -= fixP->fx_where; */
|
||||
ri.r_addend -= ri.r_address;
|
||||
}
|
||||
else
|
||||
{
|
||||
ri.r_addend = fixP->fx_addnumber;
|
||||
}
|
||||
|
||||
/* md_ri_to_chars ((char *) &ri, ri); */
|
||||
append (&next_object_file_charP, (char *)& ri, sizeof (ri));
|
||||
/* md_ri_to_chars ((char *) &ri, ri); */
|
||||
append (&next_object_file_charP, (char *) &ri, sizeof (ri));
|
||||
}
|
||||
}
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
s_bss()
|
||||
s_bss ()
|
||||
{
|
||||
char *name;
|
||||
char c;
|
||||
char *p;
|
||||
int temp, bss_align = 1;
|
||||
symbolS *symbolP;
|
||||
extern const char is_end_of_line [256];
|
||||
extern const char is_end_of_line[256];
|
||||
|
||||
name = input_line_pointer;
|
||||
c = get_symbol_end();
|
||||
c = get_symbol_end ();
|
||||
p = input_line_pointer;
|
||||
*p = c;
|
||||
SKIP_WHITESPACE();
|
||||
if ( * input_line_pointer != ',' )
|
||||
SKIP_WHITESPACE ();
|
||||
if (*input_line_pointer != ',')
|
||||
{
|
||||
as_warn("Expected comma after name");
|
||||
ignore_rest_of_line();
|
||||
as_warn ("Expected comma after name");
|
||||
ignore_rest_of_line ();
|
||||
return;
|
||||
}
|
||||
input_line_pointer ++;
|
||||
if ((temp = get_absolute_expression()) < 0)
|
||||
input_line_pointer++;
|
||||
if ((temp = get_absolute_expression ()) < 0)
|
||||
{
|
||||
as_warn("BSS length (%d.) <0! Ignored.", temp);
|
||||
ignore_rest_of_line();
|
||||
as_warn ("BSS length (%d.) <0! Ignored.", temp);
|
||||
ignore_rest_of_line ();
|
||||
return;
|
||||
}
|
||||
*p = 0;
|
||||
symbolP = symbol_find_or_make(name);
|
||||
symbolP = symbol_find_or_make (name);
|
||||
*p = c;
|
||||
if (*input_line_pointer == ',')
|
||||
{
|
||||
input_line_pointer++;
|
||||
bss_align = get_absolute_expression();
|
||||
bss_align = get_absolute_expression ();
|
||||
while (local_bss_counter % bss_align != 0)
|
||||
local_bss_counter++;
|
||||
}
|
||||
|
||||
if (symbolP->sy_other == 0
|
||||
&& symbolP->sy_desc == 0
|
||||
&& ((symbolP->sy_type == N_BSS
|
||||
if (symbolP->sy_other == 0
|
||||
&& symbolP->sy_desc == 0
|
||||
&& ((symbolP->sy_type == N_BSS
|
||||
&& symbolP->sy_value == local_bss_counter)
|
||||
|| ((symbolP->sy_type & N_TYPE) == N_UNDF
|
||||
&& symbolP->sy_value == 0)))
|
||||
{
|
||||
symbolP->sy_value = local_bss_counter;
|
||||
symbolP->sy_type = N_BSS;
|
||||
symbolP->sy_frag = & bss_address_frag;
|
||||
symbolP->sy_type = N_BSS;
|
||||
symbolP->sy_frag = &bss_address_frag;
|
||||
local_bss_counter += temp;
|
||||
}
|
||||
else
|
||||
{
|
||||
as_warn( "Ignoring attempt to re-define symbol from %d. to %d.",
|
||||
symbolP->sy_value, local_bss_counter );
|
||||
as_warn ("Ignoring attempt to re-define symbol from %d. to %d.",
|
||||
symbolP->sy_value, local_bss_counter);
|
||||
}
|
||||
while (!is_end_of_line[*input_line_pointer])
|
||||
{
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
/* m88k.h -- Assembler for the Motorola 88000
|
||||
Contributed by Devon Bowen of Buffalo University
|
||||
and Torbjorn Granlund of the Swedish Institute of Computer Science.
|
||||
@ -34,12 +35,12 @@ enum reloc_type
|
||||
|
||||
struct reloc_info_m88k
|
||||
{
|
||||
unsigned long int r_address;
|
||||
unsigned int r_symbolnum: 24;
|
||||
unsigned int r_extern : 1;
|
||||
unsigned int r_pad : 3;
|
||||
enum reloc_type r_type : 4;
|
||||
long int r_addend;
|
||||
unsigned long int r_address;
|
||||
unsigned int r_symbolnum:24;
|
||||
unsigned int r_extern:1;
|
||||
unsigned int r_pad:3;
|
||||
enum reloc_type r_type:4;
|
||||
long int r_addend;
|
||||
};
|
||||
|
||||
#define relocation_info reloc_info_m88k
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,41 +1,40 @@
|
||||
/* 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. */
|
||||
|
||||
#define TC_SPARC 1
|
||||
|
||||
#define NO_LISTING
|
||||
#define LOCAL_LABELS_FB
|
||||
|
||||
#ifdef OBJ_BOUT
|
||||
#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE ((0x103 << 16) | BMAGIC) /* Magic number for header */
|
||||
#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE ((0x103 << 16) | BMAGIC) /* Magic number for header */
|
||||
#else
|
||||
#ifdef OBJ_AOUT
|
||||
#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE ((0x103 << 16) | OMAGIC) /* Magic number for header */
|
||||
#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE ((0x103 << 16) | OMAGIC) /* Magic number for header */
|
||||
#endif /* OBJ_AOUT */
|
||||
#endif /* OBJ_BOUT */
|
||||
|
||||
#define AOUT_MACHTYPE 3
|
||||
|
||||
#define tc_headers_hook(a) {;} /* don't need it. */
|
||||
#define tc_crawl_symbol_chain(a) {;} /* don't need it. */
|
||||
#define tc_headers_hook(a) {;} /* don't need it. */
|
||||
#define tc_crawl_symbol_chain(a) {;} /* don't need it. */
|
||||
|
||||
void tc_aout_pre_write_hook();
|
||||
void tc_aout_pre_write_hook ();
|
||||
|
||||
#define LISTING_HEADER "SPARC GAS "
|
||||
|
||||
|
4421
gas/config/tc-vax.c
4421
gas/config/tc-vax.c
File diff suppressed because it is too large
Load Diff
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user