* app.c: MRI compatibility - allow single quote to start a string.
* as.c: fix typo recently introduced. * as.h : Don't include aout/reloc.h - it's not right for COFF! * expr.c: Much rewriting, to accomodate MRI syntax for expressions. Also easier to read now. * listing.c: Put back defuns * read.c: modified to accept MRI syntax, put back listing pseudo ops so that an assembler built with NO_LISTING ignores list ops rather than pukes. * write.c, write.h: fixs - only keep a reloc type in a fix if the target machine is a SPARC or a 29K. * config/obj-aout.c: added s_sect pseudo op * config/obj-coffbfd.c: lints, set the filehdr flags right and fill in the timestamp. * config/obj-coffbfd.h: Since we don't include aout/reloc.h anymore, define all the relocs which the tc-<x> bit will use so we can translate from them to the coff types. * config/tc-a29k.c: reloc_type isn't ane enum any more * config/tc-m68k.c: Added NO_RELOC definition. Now compiles for sparc aout, 68k aout (MRI and MIT syntax), 29k coff. So far works as replacement for sparc and 68k /bin/as.
This commit is contained in:
parent
3b548344d0
commit
c593cf412b
@ -30,6 +30,7 @@ Things-to-keep:
|
|||||||
.gdbinit
|
.gdbinit
|
||||||
COPYING
|
COPYING
|
||||||
ChangeLog
|
ChangeLog
|
||||||
|
Makefile.bat
|
||||||
Makefile.in
|
Makefile.in
|
||||||
NOTES
|
NOTES
|
||||||
NOTES.config
|
NOTES.config
|
||||||
@ -51,7 +52,7 @@ bignum-copy.c
|
|||||||
bignum.h
|
bignum.h
|
||||||
cond.c
|
cond.c
|
||||||
config
|
config
|
||||||
configdos.bat
|
configure.bat
|
||||||
configure.in
|
configure.in
|
||||||
debug.c
|
debug.c
|
||||||
doc
|
doc
|
||||||
@ -105,7 +106,33 @@ echo Done in `pwd`.
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
# $Log$
|
# $Log$
|
||||||
# Revision 1.9 1992/02/17 15:52:52 rich
|
# Revision 1.10 1992/02/22 20:44:46 sac
|
||||||
|
# * app.c: MRI compatibility - allow single quote to start a string.
|
||||||
|
# * as.c: fix typo recently introduced.
|
||||||
|
# * as.h : Don't include aout/reloc.h - it's not right for COFF!
|
||||||
|
# * expr.c: Much rewriting, to accomodate MRI syntax for
|
||||||
|
# expressions. Also easier to read now.
|
||||||
|
# * listing.c: Put back defuns
|
||||||
|
# * read.c: modified to accept MRI syntax, put back listing pseudo
|
||||||
|
# ops so that an assembler built with NO_LISTING ignores list ops
|
||||||
|
# rather than pukes.
|
||||||
|
# * write.c, write.h: fixs - only keep a reloc type in a fix if the target
|
||||||
|
# machine is a SPARC or a 29K.
|
||||||
|
# * config/obj-aout.c: added s_sect pseudo op
|
||||||
|
# * config/obj-coffbfd.c: lints, set the filehdr flags right and
|
||||||
|
# fill in the timestamp.
|
||||||
|
# * config/obj-coffbfd.h: Since we don't include aout/reloc.h
|
||||||
|
# anymore, define all the relocs which the tc-<x> bit will use so we
|
||||||
|
# can translate from them to the coff types.
|
||||||
|
# * config/tc-a29k.c: reloc_type isn't ane enum any more
|
||||||
|
# * config/tc-m68k.c: Added NO_RELOC definition.
|
||||||
|
#
|
||||||
|
# Now compiles for sparc aout, 68k aout (MRI and MIT syntax),
|
||||||
|
# 29k coff.
|
||||||
|
#
|
||||||
|
# So far works as replacement for sparc and 68k /bin/as.
|
||||||
|
#
|
||||||
|
# Revision 1.9 1992/02/17 15:52:52 rich
|
||||||
# fighting bitrot in a major way
|
# fighting bitrot in a major way
|
||||||
#
|
#
|
||||||
# Revision 1.8 1992/02/14 00:21:34 pesch
|
# Revision 1.8 1992/02/14 00:21:34 pesch
|
||||||
|
@ -1,5 +1,30 @@
|
|||||||
|
Sat Feb 22 12:26:28 1992 Steve Chamberlain (sac at rtl.cygnus.com)
|
||||||
|
|
||||||
|
* app.c: MRI compatibility - allow single quote to start a string.
|
||||||
|
* as.c: fix typo recently introduced.
|
||||||
|
* as.h : Don't include aout/reloc.h - it's not right for COFF!
|
||||||
|
* expr.c: Much rewriting, to accomodate MRI syntax for
|
||||||
|
expressions. Also easier to read now.
|
||||||
|
* listing.c: Put back defuns
|
||||||
|
* read.c: modified to accept MRI syntax, put back listing pseudo
|
||||||
|
ops so that an assembler built with NO_LISTING ignores list ops
|
||||||
|
rather than pukes.
|
||||||
|
* write.c, write.h: fixs - only keep a reloc type in a fix if the target
|
||||||
|
machine is a SPARC or a 29K.
|
||||||
|
* config/obj-aout.c: added s_sect pseudo op
|
||||||
|
* config/obj-coffbfd.c: lints, set the filehdr flags right and
|
||||||
|
fill in the timestamp.
|
||||||
|
* config/obj-coffbfd.h: Since we don't include aout/reloc.h
|
||||||
|
anymore, define all the relocs which the tc-<x> bit will use so we
|
||||||
|
can translate from them to the coff types.
|
||||||
|
* config/tc-a29k.c: reloc_type isn't ane enum any more
|
||||||
|
* config/tc-m68k.c: Added NO_RELOC definition.
|
||||||
|
|
||||||
Fri Feb 21 06:21:07 1992 K. Richard Pixley (rich@rtl.cygnus.com)
|
Fri Feb 21 06:21:07 1992 K. Richard Pixley (rich@rtl.cygnus.com)
|
||||||
|
|
||||||
|
* Makefile.in: put header files before C source for TAGS; remove
|
||||||
|
references to non-existent syscalls.h.
|
||||||
|
|
||||||
* read.c, write.c subsegs.c: back out the .bss changes.
|
* read.c, write.c subsegs.c: back out the .bss changes.
|
||||||
|
|
||||||
Fri Feb 21 01:08:48 1992 Minh Tran-Le (TRANLE@INTELLICORP.COM)
|
Fri Feb 21 01:08:48 1992 Minh Tran-Le (TRANLE@INTELLICORP.COM)
|
||||||
|
9
gas/as.h
9
gas/as.h
@ -65,7 +65,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "listing.h"
|
|
||||||
#define obstack_chunk_alloc xmalloc
|
#define obstack_chunk_alloc xmalloc
|
||||||
#define obstack_chunk_free xfree
|
#define obstack_chunk_free xfree
|
||||||
|
|
||||||
@ -263,7 +263,7 @@ struct frag /* a code fragment */
|
|||||||
|
|
||||||
typedef struct frag fragS;
|
typedef struct frag fragS;
|
||||||
|
|
||||||
COMMON fragS * frag_now; /* -> current frag we are building. */
|
COMMON fragS *frag_now; /* -> current frag we are building. */
|
||||||
/* This frag is incomplete. */
|
/* This frag is incomplete. */
|
||||||
/* It is, however, included in frchain_now. */
|
/* It is, however, included in frchain_now. */
|
||||||
/* Frag_now->fr_fix is bogus. Use: */
|
/* Frag_now->fr_fix is bogus. Use: */
|
||||||
@ -389,7 +389,8 @@ void subsegs_begin();
|
|||||||
|
|
||||||
/* these define types needed by the interfaces */
|
/* these define types needed by the interfaces */
|
||||||
#include "struc-symbol.h"
|
#include "struc-symbol.h"
|
||||||
#include "aout/reloc.h"
|
/*#include "aout/reloc.h"*/
|
||||||
|
|
||||||
#include "write.h"
|
#include "write.h"
|
||||||
#include "expr.h"
|
#include "expr.h"
|
||||||
#include "frags.h"
|
#include "frags.h"
|
||||||
@ -400,6 +401,8 @@ void subsegs_begin();
|
|||||||
#include "tc.h"
|
#include "tc.h"
|
||||||
#include "obj.h"
|
#include "obj.h"
|
||||||
|
|
||||||
|
#include "listing.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Local Variables:
|
* Local Variables:
|
||||||
* comment-column: 0
|
* comment-column: 0
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -40,6 +40,20 @@
|
|||||||
#elif defined(TC_A29K)
|
#elif defined(TC_A29K)
|
||||||
#include "coff/a29k.h"
|
#include "coff/a29k.h"
|
||||||
#define TARGET_FORMAT "coff-a29k-big"
|
#define TARGET_FORMAT "coff-a29k-big"
|
||||||
|
|
||||||
|
/* Allow translate from aout relocs to coff relocs */
|
||||||
|
#define NO_RELOC 20
|
||||||
|
#define RELOC_32 1
|
||||||
|
#define RELOC_8 2
|
||||||
|
#define RELOC_CONST 3
|
||||||
|
#define RELOC_CONSTH 4
|
||||||
|
#define RELOC_JUMPTARG 5
|
||||||
|
#define RELOC_BASE22 6
|
||||||
|
#define RELOC_HI22 7
|
||||||
|
#define RELOC_LO10 8
|
||||||
|
#define RELOC_BASE13 9
|
||||||
|
#define RELOC_WDISP22 10
|
||||||
|
#define RELOC_WDISP30 11
|
||||||
#else
|
#else
|
||||||
help me
|
help me
|
||||||
#endif
|
#endif
|
||||||
|
@ -48,7 +48,10 @@ struct machine_it {
|
|||||||
expressionS exp;
|
expressionS exp;
|
||||||
int pcrel;
|
int pcrel;
|
||||||
int reloc_offset; /* Offset of reloc within insn */
|
int reloc_offset; /* Offset of reloc within insn */
|
||||||
enum reloc_type reloc;
|
|
||||||
|
int reloc;
|
||||||
|
|
||||||
|
|
||||||
} the_insn;
|
} the_insn;
|
||||||
|
|
||||||
#if __STDC__ == 1
|
#if __STDC__ == 1
|
||||||
@ -861,10 +864,6 @@ short tc_coff_fix2rtype(fixP)
|
|||||||
fixS *fixP;
|
fixS *fixP;
|
||||||
{
|
{
|
||||||
|
|
||||||
/* FIXME-NOW: relocation type handling is not yet written for
|
|
||||||
a29k. */
|
|
||||||
|
|
||||||
|
|
||||||
switch (fixP->fx_r_type) {
|
switch (fixP->fx_r_type) {
|
||||||
case RELOC_32: return(R_WORD);
|
case RELOC_32: return(R_WORD);
|
||||||
case RELOC_8: return(R_BYTE);
|
case RELOC_8: return(R_BYTE);
|
||||||
|
@ -1,38 +1,42 @@
|
|||||||
/* tc-a29k.h -- Assemble for the AMD 29000.
|
/* tc-a29k.h -- Assemble for the AMD 29000.
|
||||||
Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
|
Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GAS, the GNU Assembler.
|
This file is part of GAS, the GNU Assembler.
|
||||||
|
|
||||||
GAS is free software; you can redistribute it and/or modify
|
GAS is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
the Free Software Foundation; either version 2, or (at your option)
|
||||||
any later version.
|
any later version.
|
||||||
|
|
||||||
GAS is distributed in the hope that it will be useful,
|
GAS is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with GAS; see the file COPYING. If not, write to
|
along with GAS; see the file COPYING. If not, write to
|
||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
|
/* $Id$ */
|
||||||
|
|
||||||
#define TC_A29K
|
#define TC_A29K
|
||||||
|
|
||||||
#define tc_aout_pre_write_hook(x) {;} /* not used */
|
#define tc_headers_hook(a) ; /* not used */
|
||||||
#define tc_coff_symbol_emit_hook(a) {;} /* not used */
|
#define tc_headers_hook(a) ; /* not used */
|
||||||
#define tc_crawl_symbol_chain(a) {;} /* not used */
|
#define tc_crawl_symbol_chain(a) ; /* not used */
|
||||||
#define tc_headers_hook(a) {;} /* not used */
|
#define tc_coff_symbol_emit_hook(a) ; /* not used */
|
||||||
|
|
||||||
#define AOUT_MACHTYPE 101
|
#define AOUT_MACHTYPE 101
|
||||||
#define TC_COFF_FIX2RTYPE(fix_ptr) tc_coff_fix2rtype(fix_ptr)
|
#define TC_COFF_FIX2RTYPE(fix_ptr) tc_coff_fix2rtype(fix_ptr)
|
||||||
#define BFD_ARCH bfd_arch_a29k
|
#define BFD_ARCH bfd_arch_a29k
|
||||||
#define COFF_MAGIC SIPFBOMAGIC
|
#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 29k, this is true only if there is a symbol attatched.
|
||||||
on the h8, this is allways true, since no fixup is done
|
on the h8, this is allways true, since no fixup is done
|
||||||
*/
|
*/
|
||||||
#define TC_COUNT_RELOC(x) (x->fx_addsy)
|
#define TC_COUNT_RELOC(x) (x->fx_addsy)
|
||||||
|
|
||||||
/* end of tc-a29k.h */
|
/* end of tc-a29k.h */
|
||||||
|
|
||||||
|
#define COFF_FLAGS F_AR32W
|
||||||
|
#define reloc_type int
|
||||||
|
|
||||||
|
1257
gas/expr.c
1257
gas/expr.c
File diff suppressed because it is too large
Load Diff
1544
gas/listing.c
1544
gas/listing.c
File diff suppressed because it is too large
Load Diff
89
gas/write.c
89
gas/write.c
@ -18,16 +18,7 @@
|
|||||||
along with GAS; see the file COPYING. If not, write to
|
along with GAS; see the file COPYING. If not, write to
|
||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
/*
|
/* This thing should be set up to do byteordering correctly. But... */
|
||||||
|
|
||||||
This thing should be set up to do byteordering correctly. But...
|
|
||||||
|
|
||||||
In order to cross-assemble the target machine must have an a.out header
|
|
||||||
similar to the one in a.out.h on THIS machine. Byteorder doesn't matter,
|
|
||||||
we take special care of it, but the numbers must be the same SIZE (# of
|
|
||||||
bytes) and in the same PLACE. If this is not true, you will have some
|
|
||||||
trouble.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "as.h"
|
#include "as.h"
|
||||||
#include "subsegs.h"
|
#include "subsegs.h"
|
||||||
@ -45,11 +36,9 @@
|
|||||||
#ifndef MANY_SEGMENTS
|
#ifndef MANY_SEGMENTS
|
||||||
static struct frag *text_frag_root;
|
static struct frag *text_frag_root;
|
||||||
static struct frag *data_frag_root;
|
static struct frag *data_frag_root;
|
||||||
static struct frag *bss_frag_root;
|
|
||||||
|
|
||||||
static struct frag *text_last_frag; /* Last frag in segment. */
|
static struct frag *text_last_frag; /* Last frag in segment. */
|
||||||
static struct frag *data_last_frag; /* Last frag in segment. */
|
static struct frag *data_last_frag; /* Last frag in segment. */
|
||||||
static struct frag *bss_last_frag; /* Last frag in segment. */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static object_headers headers;
|
static object_headers headers;
|
||||||
@ -94,7 +83,9 @@ symbolS *add_symbol; /* X_add_symbol. */
|
|||||||
symbolS *sub_symbol; /* X_subtract_symbol. */
|
symbolS *sub_symbol; /* X_subtract_symbol. */
|
||||||
long offset; /* X_add_number. */
|
long offset; /* X_add_number. */
|
||||||
int pcrel; /* TRUE if PC-relative relocation. */
|
int pcrel; /* TRUE if PC-relative relocation. */
|
||||||
enum reloc_type r_type; /* Relocation type */
|
#if defined(TC_SPARC) || defined(TC_A29K)
|
||||||
|
int r_type; /* Relocation type */
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
fixS *fixP;
|
fixS *fixP;
|
||||||
|
|
||||||
@ -107,8 +98,9 @@ enum reloc_type r_type; /* Relocation type */
|
|||||||
fixP->fx_subsy = sub_symbol;
|
fixP->fx_subsy = sub_symbol;
|
||||||
fixP->fx_offset = offset;
|
fixP->fx_offset = offset;
|
||||||
fixP->fx_pcrel = pcrel;
|
fixP->fx_pcrel = pcrel;
|
||||||
|
#if defined(TC_SPARC) || defined(TC_A29K)
|
||||||
fixP->fx_r_type = r_type;
|
fixP->fx_r_type = r_type;
|
||||||
|
#endif
|
||||||
/* JF these 'cuz of the NS32K stuff */
|
/* JF these 'cuz of the NS32K stuff */
|
||||||
fixP->fx_im_disp = 0;
|
fixP->fx_im_disp = 0;
|
||||||
fixP->fx_pcrel_adjust = 0;
|
fixP->fx_pcrel_adjust = 0;
|
||||||
@ -207,23 +199,17 @@ void write_object_file()
|
|||||||
for (frchainP = frchain_root; frchainP; frchainP = next_frchainP) {
|
for (frchainP = frchain_root; frchainP; frchainP = next_frchainP) {
|
||||||
know( frchainP->frch_root );
|
know( frchainP->frch_root );
|
||||||
* prev_fragPP = frchainP->frch_root;
|
* prev_fragPP = frchainP->frch_root;
|
||||||
prev_fragPP = & frchainP->frch_last->fr_next;
|
prev_fragPP = & frchainP->frch_last->fr_next;
|
||||||
next_frchainP = frchainP->frch_next;
|
|
||||||
|
if (((next_frchainP = frchainP->frch_next) == NULL)
|
||||||
if (next_frchainP == NULL)
|
|| next_frchainP == data0_frchainP) {
|
||||||
{
|
prev_fragPP = & data_frag_root;
|
||||||
bss_last_frag = frchainP->frch_last;
|
if (next_frchainP) {
|
||||||
}
|
text_last_frag = frchainP->frch_last;
|
||||||
else if (next_frchainP == data0_frchainP)
|
} else {
|
||||||
{
|
data_last_frag = frchainP->frch_last;
|
||||||
text_last_frag = frchainP->frch_last;
|
}
|
||||||
prev_fragPP = & data_frag_root;
|
}
|
||||||
}
|
|
||||||
else if (next_frchainP == bss0_frchainP)
|
|
||||||
{
|
|
||||||
data_last_frag = frchainP->frch_last;
|
|
||||||
prev_fragPP = & bss_frag_root;
|
|
||||||
}
|
|
||||||
} /* walk the frag chain */
|
} /* walk the frag chain */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -248,7 +234,6 @@ void write_object_file()
|
|||||||
|
|
||||||
relax_segment(text_frag_root, SEG_TEXT);
|
relax_segment(text_frag_root, SEG_TEXT);
|
||||||
relax_segment(data_frag_root, SEG_DATA);
|
relax_segment(data_frag_root, SEG_DATA);
|
||||||
relax_segment(bss_frag_root, SEG_BSS);
|
|
||||||
/*
|
/*
|
||||||
* Now the addresses of frags are correct within the segment.
|
* Now the addresses of frags are correct within the segment.
|
||||||
*/
|
*/
|
||||||
@ -287,18 +272,7 @@ void write_object_file()
|
|||||||
bss_address_frag.fr_address = (H_GET_TEXT_SIZE(&headers) +
|
bss_address_frag.fr_address = (H_GET_TEXT_SIZE(&headers) +
|
||||||
H_GET_DATA_SIZE(&headers));
|
H_GET_DATA_SIZE(&headers));
|
||||||
|
|
||||||
H_SET_BSS_SIZE(&headers, bss_last_frag->fr_address);
|
H_SET_BSS_SIZE(&headers,local_bss_counter);
|
||||||
|
|
||||||
/*
|
|
||||||
* now fixup all bss frags addresses
|
|
||||||
*/
|
|
||||||
if (bss_frag_root)
|
|
||||||
{
|
|
||||||
relax_addressT slide;
|
|
||||||
slide = bss_address_frag.fr_address;
|
|
||||||
for (fragP = bss_frag_root; fragP; fragP = fragP->fr_next)
|
|
||||||
fragP->fr_address += slide;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
@ -410,11 +384,17 @@ void write_object_file()
|
|||||||
lie->sub,
|
lie->sub,
|
||||||
lie->addnum,
|
lie->addnum,
|
||||||
0, 0, 2, 0, 0);
|
0, 0, 2, 0, 0);
|
||||||
#else /* TC_NS32K */
|
#elif defined(TC_SPARC) || defined(TC_A29K)
|
||||||
fix_new( lie->frag, lie->word_goes_here - lie->frag->fr_literal,
|
fix_new( lie->frag, lie->word_goes_here - lie->frag->fr_literal,
|
||||||
2, lie->add,
|
2, lie->add,
|
||||||
lie->sub, lie->addnum,
|
lie->sub, lie->addnum,
|
||||||
0, NO_RELOC);
|
0, NO_RELOC);
|
||||||
|
#else
|
||||||
|
fix_new( lie->frag, lie->word_goes_here - lie->frag->fr_literal,
|
||||||
|
2, lie->add,
|
||||||
|
lie->sub, lie->addnum,
|
||||||
|
0, 0);
|
||||||
|
|
||||||
#endif /* TC_NS32K */
|
#endif /* TC_NS32K */
|
||||||
/* md_number_to_chars(lie->word_goes_here,
|
/* md_number_to_chars(lie->word_goes_here,
|
||||||
S_GET_VALUE(lie->add)
|
S_GET_VALUE(lie->add)
|
||||||
@ -620,14 +600,14 @@ void write_object_file()
|
|||||||
|
|
||||||
void relax_segment(segment_frag_root, segment)
|
void relax_segment(segment_frag_root, segment)
|
||||||
struct frag * segment_frag_root;
|
struct frag * segment_frag_root;
|
||||||
segT segment; /* SEG_DATA or SEG_TEXT or SEG_BSS */
|
segT segment; /* SEG_DATA or SEG_TEXT */
|
||||||
{
|
{
|
||||||
register struct frag * fragP;
|
register struct frag * fragP;
|
||||||
register relax_addressT address;
|
register relax_addressT address;
|
||||||
/* register relax_addressT old_address; JF unused */
|
/* register relax_addressT old_address; JF unused */
|
||||||
/* register relax_addressT new_address; JF unused */
|
/* register relax_addressT new_address; JF unused */
|
||||||
#ifndef MANY_SEGMENTS
|
#ifndef MANY_SEGMENTS
|
||||||
know(segment == SEG_DATA || segment == SEG_TEXT || segment == SEG_BSS);
|
know(segment == SEG_DATA || segment == SEG_TEXT);
|
||||||
#endif
|
#endif
|
||||||
/* In case md_estimate_size_before_relax() wants to make fixSs. */
|
/* In case md_estimate_size_before_relax() wants to make fixSs. */
|
||||||
subseg_change(segment, 0);
|
subseg_change(segment, 0);
|
||||||
@ -768,10 +748,7 @@ segT segment; /* SEG_DATA or SEG_TEXT or SEG_BSS */
|
|||||||
if (symbolP) {
|
if (symbolP) {
|
||||||
#ifdef MANY_SEGMENTS
|
#ifdef MANY_SEGMENTS
|
||||||
#else
|
#else
|
||||||
know((S_GET_SEGMENT(symbolP) == SEG_ABSOLUTE)
|
know((S_GET_SEGMENT(symbolP) == SEG_ABSOLUTE) || (S_GET_SEGMENT(symbolP) == SEG_DATA) || (S_GET_SEGMENT(symbolP) == SEG_TEXT));
|
||||||
|| (S_GET_SEGMENT(symbolP) == SEG_DATA)
|
|
||||||
|| (S_GET_SEGMENT(symbolP) == SEG_TEXT)
|
|
||||||
|| (S_GET_SEGMENT(symbolP) == SEG_BSS));
|
|
||||||
know(symbolP->sy_frag);
|
know(symbolP->sy_frag);
|
||||||
know(!(S_GET_SEGMENT(symbolP) == SEG_ABSOLUTE) || (symbolP->sy_frag == &zero_address_frag));
|
know(!(S_GET_SEGMENT(symbolP) == SEG_ABSOLUTE) || (symbolP->sy_frag == &zero_address_frag));
|
||||||
#endif
|
#endif
|
||||||
@ -1084,16 +1061,10 @@ segT this_segment_type; /* N_TYPE bits for segment. */
|
|||||||
#endif /* TC_I960 */
|
#endif /* TC_I960 */
|
||||||
|
|
||||||
#ifdef OBJ_COFF
|
#ifdef OBJ_COFF
|
||||||
/* This really needed to be
|
#ifdef TE_I386AIX
|
||||||
like this for COFF output.
|
|
||||||
- mtranle@paris
|
|
||||||
|
|
||||||
But I'm not sure it's right
|
|
||||||
for i960 or a29k coff.
|
|
||||||
xoxorich. */
|
|
||||||
|
|
||||||
if (S_IS_COMMON(add_symbolP))
|
if (S_IS_COMMON(add_symbolP))
|
||||||
add_number += S_GET_VALUE(add_symbolP);
|
add_number += S_GET_VALUE(add_symbolP);
|
||||||
|
#endif /* TE_I386AIX */
|
||||||
#endif /* OBJ_COFF */
|
#endif /* OBJ_COFF */
|
||||||
++seg_reloc_count;
|
++seg_reloc_count;
|
||||||
|
|
||||||
|
60
gas/write.h
60
gas/write.h
@ -35,49 +35,32 @@
|
|||||||
|
|
||||||
#define S_LOCAL_NAME(s) (LOCAL_LABEL(S_GET_NAME(s)))
|
#define S_LOCAL_NAME(s) (LOCAL_LABEL(S_GET_NAME(s)))
|
||||||
|
|
||||||
/* The bit_fix was implemented to support machines that need variables
|
#include "bit_fix.h"
|
||||||
to be inserted in bitfields other than 1, 2 and 4 bytes.
|
|
||||||
Furthermore it gives us a possibillity to mask in bits in the symbol
|
|
||||||
when it's fixed in the objectcode and check the symbols limits.
|
|
||||||
|
|
||||||
The or-mask is used to set the huffman bits in displacements for the
|
|
||||||
ns32k port.
|
|
||||||
The acbi, addqi, movqi, cmpqi instruction requires an assembler that
|
|
||||||
can handle bitfields. Ie handle an expression, evaluate it and insert
|
|
||||||
the result in an some bitfield. ( ex: 5 bits in a short field of a opcode)
|
|
||||||
*/
|
|
||||||
|
|
||||||
struct bit_fix {
|
|
||||||
int fx_bit_size; /* Length of bitfield */
|
|
||||||
int fx_bit_offset; /* Bit offset to bitfield */
|
|
||||||
long fx_bit_base; /* Where do we apply the bitfix.
|
|
||||||
If this is zero, default is assumed. */
|
|
||||||
long fx_bit_base_adj;/* Adjustment of base */
|
|
||||||
long fx_bit_max; /* Signextended max for bitfield */
|
|
||||||
long fx_bit_min; /* Signextended min for bitfield */
|
|
||||||
long fx_bit_add; /* Or mask, used for huffman prefix */
|
|
||||||
};
|
|
||||||
typedef struct bit_fix bit_fixS;
|
|
||||||
/*
|
/*
|
||||||
* FixSs may be built up in any order.
|
* FixSs may be built up in any order.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct fix {
|
struct fix {
|
||||||
fragS *fx_frag; /* Which frag? */
|
fragS *fx_frag; /* Which frag? */
|
||||||
long fx_where; /* Where is the 1st byte to fix up? */
|
long fx_where; /* Where is the 1st byte to fix up? */
|
||||||
symbolS *fx_addsy; /* NULL or Symbol whose value we add in. */
|
symbolS *fx_addsy; /* NULL or Symbol whose value we add in. */
|
||||||
symbolS *fx_subsy; /* NULL or Symbol whose value we subtract. */
|
symbolS *fx_subsy; /* NULL or Symbol whose value we subtract. */
|
||||||
long fx_offset; /* Absolute number we add in. */
|
long fx_offset; /* Absolute number we add in. */
|
||||||
struct fix *fx_next; /* NULL or -> next fixS. */
|
struct fix *fx_next; /* NULL or -> next fixS. */
|
||||||
short int fx_size; /* How many bytes are involved? */
|
short int fx_size; /* How many bytes are involved? */
|
||||||
char fx_pcrel; /* TRUE: pc-relative. */
|
char fx_pcrel; /* TRUE: pc-relative. */
|
||||||
char fx_pcrel_adjust;/* pc-relative offset adjust */
|
char fx_pcrel_adjust; /* pc-relative offset adjust */
|
||||||
char fx_im_disp; /* TRUE: value is a displacement */
|
char fx_im_disp; /* TRUE: value is a displacement */
|
||||||
bit_fixS *fx_bit_fixP; /* IF NULL no bitfix's to do */
|
bit_fixS *fx_bit_fixP; /* IF NULL no bitfix's to do */
|
||||||
char fx_bsr; /* sequent-hack */
|
char fx_bsr; /* sequent-hack */
|
||||||
enum reloc_type fx_r_type; /* Sparc hacks */
|
#if defined(TC_SPARC) || defined(TC_A29K)
|
||||||
char fx_callj; /* TRUE if target is a 'callj'
|
/* Hacks for machines where the type of reloc can't be
|
||||||
(used by i960) */
|
worked out by looking at how big it is */
|
||||||
|
|
||||||
|
int fx_r_type;
|
||||||
|
#endif
|
||||||
|
char fx_callj; /* TRUE if target is a 'callj' (used by i960) */
|
||||||
long fx_addnumber;
|
long fx_addnumber;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -88,6 +71,7 @@ COMMON char *next_object_file_charP;
|
|||||||
#ifndef MANY_SEGMENTS
|
#ifndef MANY_SEGMENTS
|
||||||
COMMON fixS *text_fix_root, *text_fix_tail; /* Chains fixSs. */
|
COMMON fixS *text_fix_root, *text_fix_tail; /* Chains fixSs. */
|
||||||
COMMON fixS *data_fix_root, *data_fix_tail; /* Chains fixSs. */
|
COMMON fixS *data_fix_root, *data_fix_tail; /* Chains fixSs. */
|
||||||
|
COMMON fixS *bss_fix_root, *bss_fix_tail; /* Chains fixSs. */
|
||||||
#endif
|
#endif
|
||||||
COMMON fixS **seg_fix_rootP, **seg_fix_tailP; /* -> one of above. */
|
COMMON fixS **seg_fix_rootP, **seg_fix_tailP; /* -> one of above. */
|
||||||
extern long string_byte_count;
|
extern long string_byte_count;
|
||||||
@ -95,7 +79,7 @@ extern int section_alignment[];
|
|||||||
|
|
||||||
#if __STDC__ == 1
|
#if __STDC__ == 1
|
||||||
|
|
||||||
bit_fixS *bit_fix_new(char size, char offset, long base_type, long base_adj, long min, long max, long add);
|
bit_fixS *bit_fix_new(int size, int offset, long base_type, long base_adj, long min, long max, long add);
|
||||||
void append(char **charPP, char *fromP, unsigned long length);
|
void append(char **charPP, char *fromP, unsigned long length);
|
||||||
void record_alignment(segT seg, int align);
|
void record_alignment(segT seg, int align);
|
||||||
void write_object_file(void);
|
void write_object_file(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user