2000-09-12 Kazu Hirata <kazu@hxi.com>

* config/obj-aout.c: Fix formatting.
	* config/obj-aout.h: Likewise.
	* config/obj-bout.c: Likewise.
	* config/obj-bout.h: Likewise.
	* config/obj-coff.c: Likewise.
	* config/obj-coff.h: Likewise.
This commit is contained in:
Kazu Hirata 2000-09-12 21:49:09 +00:00
parent a01b9fa4ba
commit dcd619bedd
7 changed files with 111 additions and 145 deletions

View file

@ -3,6 +3,12 @@
* as.h: Fix formatting.
* asintl.h: Likewise.
* bit_fix.h: Likewise.
* config/obj-aout.c: Likewise.
* config/obj-aout.h: Likewise.
* config/obj-bout.c: Likewise.
* config/obj-bout.h: Likewise.
* config/obj-coff.c: Likewise.
* config/obj-coff.h: Likewise.
* dwarf2dbg.h: Likewise.
* expr.h: Likewise.
* flonum.h: Likewise.

View file

@ -17,7 +17,7 @@ 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, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
02111-1307, USA. */
#define OBJ_HEADER "obj-aout.h"
@ -99,7 +99,6 @@ const pseudo_typeS aout_pseudo_table[] =
{NULL, NULL, 0} /* end sentinel */
}; /* aout_pseudo_table */
#ifdef BFD_ASSEMBLER
void
@ -223,7 +222,7 @@ obj_aout_frob_file ()
#else /* ! BFD_ASSEMBLER */
/* Relocation. */
/* Relocation. */
/*
* emit_relocations()
@ -233,7 +232,7 @@ obj_aout_frob_file ()
void
obj_emit_relocations (where, fixP, segment_address_in_file)
char **where;
fixS *fixP; /* Fixup chain for this segment. */
fixS *fixP; /* Fixup chain for this segment. */
relax_addressT segment_address_in_file;
{
for (; fixP; fixP = fixP->fx_next)
@ -322,13 +321,13 @@ obj_emit_symbols (where, symbol_rootP)
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. */
to the string in memory but must be a file offset. */
register char *temp;
temp = S_GET_NAME (symbolP);
S_SET_OFFSET (symbolP, symbolP->sy_name_offset);
/* Any symbol still undefined and is not a dbg symbol is made N_EXT. */
/* 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);
@ -359,7 +358,7 @@ obj_aout_line (ignore)
{
/* Assume delimiter is part of expression.
BSD4.2 as fails with delightful bug, so we
are not being incompatible here. */
are not being incompatible here. */
new_logical_line ((char *) NULL, (int) (get_absolute_expression ()));
demand_empty_rest_of_line ();
} /* obj_aout_line() */
@ -450,7 +449,7 @@ obj_crawl_symbol_chain (headers)
tc_crawl_symbol_chain (headers);
symbolPP = &symbol_rootP; /*->last symbol chain link. */
symbolPP = &symbol_rootP; /*->last symbol chain link. */
while ((symbolP = *symbolPP) != NULL)
{
if (symbolP->sy_mri_common)
@ -491,8 +490,7 @@ obj_crawl_symbol_chain (headers)
switch was passed to gas.
All other symbols are output. We complain if a deleted
symbol was marked external. */
symbol was marked external. */
if (!S_IS_REGISTER (symbolP)
&& (!S_GET_NAME (symbolP)
@ -508,11 +506,11 @@ obj_crawl_symbol_chain (headers)
end of each string */
if (!S_IS_STABD (symbolP))
{
/* Ordinary case. */
/* Ordinary case. */
symbolP->sy_name_offset = string_byte_count;
string_byte_count += strlen (S_GET_NAME (symbolP)) + 1;
}
else /* .Stabd case. */
else /* .Stabd case. */
symbolP->sy_name_offset = 0;
symbolPP = &symbolP->sy_next;
}
@ -524,7 +522,7 @@ obj_crawl_symbol_chain (headers)
register names... */
{
as_bad (_("Local symbol %s never defined."), decode_local_label_name (S_GET_NAME (symbolP)));
} /* oops. */
} /* oops. */
/* Unhook it from the chain */
*symbolPP = symbol_next (symbolP);
@ -757,5 +755,3 @@ const struct format_ops aout_format_ops =
0 /* symbol_new_hook */
};
#endif BFD_ASSEMBLER
/* end of obj-aout.c */

View file

@ -17,7 +17,7 @@
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, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
02111-1307, USA. */
/* Tag to validate a.out object file format processing */
#define OBJ_AOUT 1
@ -33,7 +33,7 @@
#else /* ! BFD_ASSEMBLER */
#ifndef VMS
#include "aout_gnu.h" /* Needed to define struct nlist. Sigh. */
#include "aout_gnu.h" /* Needed to define struct nlist. Sigh. */
#else
#include "a_out.h"
#endif
@ -234,7 +234,7 @@ typedef struct
object_headers;
/* line numbering stuff. */
/* line numbering stuff. */
#define OBJ_EMIT_LINENO(a, b, c) {;}
struct fix;
@ -248,5 +248,3 @@ void tc_aout_fix_to_chars PARAMS ((char *where, struct fix *fixP, relax_addressT
#define EMIT_SECTION_SYMBOLS 0
#define AOUT_STABS
/* end of obj-aout.h */

View file

@ -110,7 +110,7 @@ obj_emit_relocations (where, fixP, segment_address_in_file)
} /* for each fixup */
}
/* Aout file generation & utilities . */
/* Aout file generation & utilities . */
/* Convert a lvalue to machine dependent data. */

View file

@ -1,5 +1,5 @@
/* b.out object file format
Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 1996
Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 2000
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -17,7 +17,7 @@
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, 59 Temple Place - Suite 330, Cambridge, MA
02139, USA. */
02139, USA. */
/*
* This file is a modified version of 'a.out.h'. It is to be used in all GNU
@ -56,7 +56,6 @@
* relocation info are never sent to the target.
*/
#define OBJ_BOUT 1
#define OUTPUT_FLAVOR bfd_target_aout_flavour
@ -297,7 +296,7 @@ typedef struct
object_headers;
/* unused hooks. */
/* unused hooks. */
#define OBJ_EMIT_LINENO(a, b, c) {;}
#define obj_pre_write_hook(a) {;}
@ -312,5 +311,3 @@ extern void tc_bout_fix_to_chars PARAMS ((char *where,
relax_addressT segment_address));
#define AOUT_STABS
/* end of obj-bout.h */

View file

@ -211,7 +211,7 @@ obj_coff_weak (ignore)
char *name;
int c;
symbolS *symbolP;
do
{
name = input_line_pointer;
@ -323,7 +323,7 @@ S_SET_STORAGE_CLASS (sym, val)
return val;
}
/* Merge a debug symbol containing debug information into a normal symbol. */
/* Merge a debug symbol containing debug information into a normal symbol. */
void
c_symbol_merge (debug, normal)
@ -347,7 +347,7 @@ c_symbol_merge (debug, normal)
* sizeof (*SYM_AUXINFO (debug))));
}
/* Move the debug flags. */
/* Move the debug flags. */
SF_SET_DEBUG_FIELD (normal, SF_GET_DEBUG_FIELD (debug));
}
@ -408,7 +408,7 @@ coff_obj_symbol_new_hook (symbolP)
{
long sz = (OBJ_COFF_MAX_AUXENTRIES + 1) * sizeof (combined_entry_type);
char * s = (char *) xmalloc (sz);
memset (s, 0, sz);
coffsymbol (symbol_get_bfdsym (symbolP))->native = (combined_entry_type *) s;
@ -418,7 +418,7 @@ coff_obj_symbol_new_hook (symbolP)
if (S_IS_STRING (symbolP))
SF_SET_STRING (symbolP);
if (S_IS_LOCAL (symbolP))
SF_SET_LOCAL (symbolP);
}
@ -445,7 +445,7 @@ add_lineno (frag, offset, num)
{
abort ();
}
if (num <= 0)
if (num <= 0)
{
/* Zero is used as an end marker in the file. */
as_warn (_("Line numbers must be positive integers\n"));
@ -670,7 +670,7 @@ obj_coff_endef (ignore)
return;
} /* if not inside .def/.endef */
/* Set the section number according to storage class. */
/* Set the section number according to storage class. */
switch (S_GET_STORAGE_CLASS (def_symbol_in_progress))
{
case C_STRTAG:
@ -685,7 +685,7 @@ obj_coff_endef (ignore)
break;
case C_EFCN:
SF_SET_LOCAL (def_symbol_in_progress); /* Do not emit this symbol. */
SF_SET_LOCAL (def_symbol_in_progress); /* Do not emit this symbol. */
/* intentional fallthrough */
case C_BLOCK:
SF_SET_PROCESS (def_symbol_in_progress); /* Will need processing before writing */
@ -700,7 +700,7 @@ obj_coff_endef (ignore)
{
switch (name[1])
{
case 'b':
case 'b':
/* .bf */
if (! in_function ())
as_warn (_("`%s' symbol without preceding function"), name);
@ -709,12 +709,12 @@ obj_coff_endef (ignore)
clear_function ();
break;
#ifdef TE_PE
case 'e':
case 'e':
/* .ef */
/* The MS compilers output the actual endline, not the
function-relative one... we want to match without
changing the assembler input. */
SA_SET_SYM_LNNO (def_symbol_in_progress,
SA_SET_SYM_LNNO (def_symbol_in_progress,
(SA_GET_SYM_LNNO (def_symbol_in_progress)
+ coff_line_base));
break;
@ -739,10 +739,10 @@ obj_coff_endef (ignore)
A special section number (-2) marks symbolic debugging symbols,
including structure/union/enumeration tag names, typedefs, and
the name of the file. A section number of -1 indicates that the
the name of the file. A section number of -1 indicates that the
symbol has a value but is not relocatable. Examples of
absolute-valued symbols include automatic and register variables,
function arguments, and .eos symbols.
absolute-valued symbols include automatic and register variables,
function arguments, and .eos symbols.
But from Ian Lance Taylor:
@ -756,7 +756,7 @@ obj_coff_endef (ignore)
http://sources.redhat.com/ml/binutils/2000-08/msg00210.html
By defining STRICTCOFF, a COFF port can make the assembler to
follow the documented behavior. */
follow the documented behavior. */
#ifdef STRICTCOFF
case C_MOS:
case C_MOE:
@ -808,11 +808,11 @@ obj_coff_endef (ignore)
lineno entry MUST point to the definition function or else it
will point off into space when obj_crawl_symbol_chain() merges
the debug symbol into the real symbol. Therefor, let's presume
the debug symbol is a real function reference. */
the debug symbol is a real function reference. */
/* FIXME-SOON If for some reason the definition label/symbol is
never seen, this will probably leave an undefined symbol at link
time. */
time. */
if (S_GET_STORAGE_CLASS (def_symbol_in_progress) == C_EFCN
|| S_GET_STORAGE_CLASS (def_symbol_in_progress) == C_LABEL
@ -843,7 +843,7 @@ obj_coff_endef (ignore)
symbols. [loic] */
/* The debug entry (def_symbol_in_progress) is merged into the
previous definition. */
previous definition. */
c_symbol_merge (def_symbol_in_progress, symbolP);
symbol_remove (def_symbol_in_progress, &symbol_rootP, &symbol_lastP);
@ -856,7 +856,7 @@ obj_coff_endef (ignore)
{
/* For functions, and tags, and static symbols, the symbol
*must* be where the debug symbol appears. Move the
existing symbol to the current place. */
existing symbol to the current place. */
/* If it already is at the end of the symbol list, do nothing */
if (def_symbol_in_progress != symbol_lastP)
{
@ -886,7 +886,7 @@ obj_coff_endef (ignore)
if (symbolP == NULL)
{
/* That is, if this is the first time we've seen the
function... */
function... */
symbol_table_insert (def_symbol_in_progress);
} /* definition follows debug */
} /* Create the line number entry pointing to the function being defined */
@ -1022,7 +1022,7 @@ obj_coff_tag (ignore)
#endif
/* Assume that the symbol referred to by .tag is always defined.
This was a bad assumption. I've added find_or_make. xoxorich. */
This was a bad assumption. I've added find_or_make. xoxorich. */
SA_SET_SYM_TAGNDX (def_symbol_in_progress,
tag_find_or_make (symbol_name));
if (SA_GET_SYM_TAGNDX (def_symbol_in_progress) == 0L)
@ -1105,7 +1105,7 @@ obj_coff_val (ignore)
just below. */
}
/* Otherwise, it is the name of a non debug symbol and its value
will be calculated later. */
will be calculated later. */
*input_line_pointer = name_end;
}
else
@ -1119,7 +1119,7 @@ obj_coff_val (ignore)
void
coff_obj_read_begin_hook ()
{
/* These had better be the same. Usually 18 bytes. */
/* These had better be the same. Usually 18 bytes. */
#ifndef BFD_HEADERS
know (sizeof (SYMENT) == sizeof (AUXENT));
know (SYMESZ == AUXESZ);
@ -1127,7 +1127,6 @@ coff_obj_read_begin_hook ()
tag_init ();
}
symbolS *coff_last_function;
static symbolS *coff_last_bf;
@ -1239,7 +1238,7 @@ coff_frob_symbol (symp, punt)
if (SF_GET_FUNCTION (symp))
symbol_get_bfdsym (symp)->flags |= BSF_FUNCTION;
/* more ... */
/* more ... */
}
/* Double check weak symbols. */
@ -1470,7 +1469,7 @@ obj_coff_section (ignore)
Provide a default if no flags were parsed. */
if (flags == SEC_NO_FLAGS)
flags = TC_COFF_SECTION_DEFAULT_ATTRIBUTES;
#ifdef COFF_LONG_SECTION_NAMES
/* Add SEC_LINK_ONCE and SEC_LINK_DUPLICATES_DISCARD to .gnu.linkonce
sections so adjust_reloc_syms in write.c will correctly handle
@ -1519,7 +1518,7 @@ coff_frob_section (sec)
rounded up to multiples of the corresponding section alignments,
supposedly because standard COFF has no other way of encoding alignment
for sections. If your COFF flavor has a different way of encoding
section alignment, then skip this step, as TICOFF does. */
section alignment, then skip this step, as TICOFF does. */
size = bfd_get_section_size_before_reloc (sec);
mask = ((bfd_vma) 1 << align_power) - 1;
#if !defined(TICOFF)
@ -1527,7 +1526,7 @@ coff_frob_section (sec)
{
bfd_vma new_size;
fragS *last;
new_size = (size + mask) & ~mask;
bfd_set_section_size (stdoutput, sec, new_size);
@ -1598,9 +1597,9 @@ obj_coff_init_stab_section (seg)
char *stabstr_name;
unsigned int stroff;
/* Make space for this first symbol. */
/* Make space for this first symbol. */
p = frag_more (12);
/* Zero it out. */
/* Zero it out. */
memset (p, 0, 12);
as_where (&file, (unsigned int *) NULL);
stabstr_name = (char *) alloca (strlen (seg->name) + 4);
@ -1641,7 +1640,7 @@ symbol_dump ()
#else /* not BFD_ASSEMBLER */
#include "frags.h"
/* This is needed because we include internal bfd things. */
/* This is needed because we include internal bfd things. */
#include <time.h>
#include "libbfd.h"
@ -1688,7 +1687,7 @@ int function_lineoff = -1; /* Offset in line#s where the last function
/* structure used to keep the filenames which
are too long around so that we can stick them
into the string table */
struct filename_list
struct filename_list
{
char *filename;
struct filename_list *next;
@ -1713,22 +1712,18 @@ bfd *abfd;
static void fixup_segment PARAMS ((segment_info_type *segP,
segT this_segment_type));
static void fixup_mdeps PARAMS ((fragS *,
object_headers *,
segT));
static void fill_section PARAMS ((bfd * abfd,
object_headers *,
unsigned long *));
static int c_line_new PARAMS ((symbolS * symbol, long paddr,
int line_number,
fragS * frag));
static void w_symbols PARAMS ((bfd * abfd, char *where,
symbolS * symbol_rootP));
@ -1789,7 +1784,6 @@ relax_align (address, alignment)
return (new_address - address);
}
segT
s_get_segment (x)
symbolS * x;
@ -1852,7 +1846,6 @@ size_section (abfd, idx)
return size;
}
static unsigned int
count_entries_in_chain (idx)
unsigned int idx;
@ -2058,7 +2051,6 @@ do_relocs_for (abfd, h, file_cursor)
H_SET_RELOCATION_SIZE (h, *file_cursor - reloc_start, 0);
}
/* run through a frag chain and write out the data to go with it, fill
in the scnhdrs with the info on the file postions
*/
@ -2253,7 +2245,6 @@ coff_header_append (abfd, h)
}
}
char *
symbol_to_chars (abfd, where, symbolP)
bfd * abfd;
@ -2304,7 +2295,7 @@ coff_obj_symbol_new_hook (symbolP)
char underscore = 0; /* Symbol has leading _ */
/* Effective symbol */
/* Store the pointer in the offset. */
/* Store the pointer in the offset. */
S_SET_ZEROES (symbolP, 0L);
S_SET_DATA_TYPE (symbolP, T_NULL);
S_SET_STORAGE_CLASS (symbolP, 0);
@ -2432,7 +2423,6 @@ obj_coff_def (what)
unsigned int dim_index;
static void
obj_coff_endef (ignore)
int ignore ATTRIBUTE_UNUSED;
@ -2447,7 +2437,7 @@ obj_coff_endef (ignore)
return;
} /* if not inside .def/.endef */
/* Set the section number according to storage class. */
/* Set the section number according to storage class. */
switch (S_GET_STORAGE_CLASS (def_symbol_in_progress))
{
case C_STRTAG:
@ -2462,7 +2452,7 @@ obj_coff_endef (ignore)
break;
case C_EFCN:
SF_SET_LOCAL (def_symbol_in_progress); /* Do not emit this symbol. */
SF_SET_LOCAL (def_symbol_in_progress); /* Do not emit this symbol. */
/* intentional fallthrough */
case C_BLOCK:
SF_SET_PROCESS (def_symbol_in_progress); /* Will need processing before writing */
@ -2483,7 +2473,7 @@ obj_coff_endef (ignore)
SF_SET_PROCESS (def_symbol_in_progress);
function_lineoff = -1;
}
/* Value is always set to . */
/* Value is always set to . */
def_symbol_in_progress->sy_frag = frag_now;
S_SET_VALUE (def_symbol_in_progress, (valueT) frag_now_fix ());
break;
@ -2534,11 +2524,11 @@ obj_coff_endef (ignore)
lineno entry MUST point to the definition function or else it
will point off into space when crawl_symbols() merges the debug
symbol into the real symbol. Therefor, let's presume the debug
symbol is a real function reference. */
symbol is a real function reference. */
/* FIXME-SOON If for some reason the definition label/symbol is
never seen, this will probably leave an undefined symbol at link
time. */
time. */
if (S_GET_STORAGE_CLASS (def_symbol_in_progress) == C_EFCN
|| S_GET_STORAGE_CLASS (def_symbol_in_progress) == C_LABEL
@ -2564,7 +2554,7 @@ obj_coff_endef (ignore)
previous definition. */
c_symbol_merge (def_symbol_in_progress, symbolP);
/* FIXME-SOON Should *def_symbol_in_progress be free'd? xoxorich. */
/* FIXME-SOON Should *def_symbol_in_progress be free'd? xoxorich. */
def_symbol_in_progress = symbolP;
if (SF_GET_FUNCTION (def_symbol_in_progress)
@ -2573,7 +2563,7 @@ obj_coff_endef (ignore)
{
/* For functions, and tags, and static symbols, the symbol
*must* be where the debug symbol appears. Move the
existing symbol to the current place. */
existing symbol to the current place. */
/* If it already is at the end of the symbol list, do nothing */
if (def_symbol_in_progress != symbol_lastP)
{
@ -2607,7 +2597,7 @@ obj_coff_endef (ignore)
if (symbolP == NULL)
{
/* That is, if this is the first time we've seen the
function... */
function... */
symbol_table_insert (def_symbol_in_progress);
} /* definition follows debug */
} /* Create the line number entry pointing to the function being defined */
@ -2754,7 +2744,7 @@ obj_coff_tag (ignore)
#endif
/* Assume that the symbol referred to by .tag is always defined.
This was a bad assumption. I've added find_or_make. xoxorich. */
This was a bad assumption. I've added find_or_make. xoxorich. */
SA_SET_SYM_TAGNDX (def_symbol_in_progress,
(long) tag_find_or_make (symbol_name));
if (SA_GET_SYM_TAGNDX (def_symbol_in_progress) == 0L)
@ -2836,7 +2826,7 @@ obj_coff_val (ignore)
just below. */
}
/* Otherwise, it is the name of a non debug symbol and
its value will be calculated later. */
its value will be calculated later. */
*input_line_pointer = name_end;
/* FIXME: this is to avoid an error message in the
@ -2874,7 +2864,7 @@ obj_coff_pe_handle_link_once (type)
void
coff_obj_read_begin_hook ()
{
/* These had better be the same. Usually 18 bytes. */
/* These had better be the same. Usually 18 bytes. */
#ifndef BFD_HEADERS
know (sizeof (SYMENT) == sizeof (AUXENT));
know (SYMESZ == AUXESZ);
@ -2929,7 +2919,7 @@ yank_symbols ()
/* Debug symbols do not need all this rubbish */
symbolS *real_symbolP;
/* L* and C_EFCN symbols never merge. */
/* L* and C_EFCN symbols never merge. */
if (!SF_GET_LOCAL (symbolP)
&& !SF_GET_STATICS (symbolP)
&& S_GET_STORAGE_CLASS (symbolP) != C_LABEL
@ -2938,12 +2928,12 @@ yank_symbols ()
&& real_symbolP != symbolP)
{
/* FIXME-SOON: where do dups come from?
Maybe tag references before definitions? xoxorich. */
Maybe tag references before definitions? xoxorich. */
/* Move the debug data from the debug symbol to the
real symbol. Do NOT do the oposite (i.e. move from
real symbol to debug symbol and remove real symbol from the
list.) Because some pointers refer to the real symbol
whereas no pointers refer to the debug symbol. */
whereas no pointers refer to the debug symbol. */
c_symbol_merge (symbolP, real_symbolP);
/* Replace the current symbol by the real one */
/* The symbols will never be the last or the first
@ -2981,7 +2971,7 @@ yank_symbols ()
/* Mainly to speed up if not -g */
if (SF_GET_PROCESS (symbolP))
{
/* Handle the nested blocks auxiliary info. */
/* Handle the nested blocks auxiliary info. */
if (S_GET_STORAGE_CLASS (symbolP) == C_BLOCK)
{
if (!strcmp (S_GET_NAME (symbolP), ".bb"))
@ -2999,7 +2989,7 @@ yank_symbols ()
/* If we are able to identify the type of a function, and we
are out of a function (last_functionP == 0) then, the
function symbol will be associated with an auxiliary
entry. */
entry. */
if (last_functionP == (symbolS *) 0 &&
SF_GET_FUNCTION (symbolP))
{
@ -3010,7 +3000,7 @@ yank_symbols ()
S_SET_NUMBER_AUXILIARY (symbolP, 1);
} /* make it at least 1 */
/* Clobber possible stale .dim information. */
/* Clobber possible stale .dim information. */
#if 0
/* Iffed out by steve - this fries the lnnoptr info too */
bzero (symbolP->sy_symbol.ost_auxent[0].x_sym.x_fcnary.x_ary.x_dimen,
@ -3043,7 +3033,7 @@ yank_symbols ()
else if (SF_GET_TAG (symbolP))
{
/* First descriptor of a structure must point to
the first slot after the structure description. */
the first slot after the structure description. */
last_tagP = symbolP;
}
@ -3083,8 +3073,7 @@ yank_symbols ()
[21] foo external
[22] .be
ld will move the symbol 21 to the end of the list but
endndx will still be 22 instead of 21. */
endndx will still be 22 instead of 21. */
if (SF_GET_LOCAL (symbolP))
{
@ -3158,7 +3147,6 @@ yank_symbols ()
}
static unsigned int
glue_symbols (head, tail)
symbolS **head;
@ -3237,7 +3225,7 @@ crawl_symbols (h, abfd)
* undefined symbols at the end of the list.
*/
/* Is there a .file symbol ? If not insert one at the beginning. */
/* Is there a .file symbol ? If not insert one at the beginning. */
if (symbol_rootP == NULL
|| S_GET_STORAGE_CLASS (symbol_rootP) != C_FILE)
{
@ -3248,7 +3236,6 @@ crawl_symbols (h, abfd)
* Build up static symbols for the sections, they are filled in later
*/
for (i = SEG_E0; i < SEG_LAST; i++)
if (segment_info[i].scnhdr.s_name[0])
segment_info[i].dot = c_section_symbol (segment_info[i].name,
@ -3344,7 +3331,6 @@ do_linenos_for (abfd, h, file_cursor)
{
segment_info_type *s = segment_info + idx;
if (s->scnhdr.s_nlnno != 0)
{
struct lineno_list *line_ptr;
@ -3373,7 +3359,6 @@ do_linenos_for (abfd, h, file_cursor)
line_ptr->line.l_addr.l_paddr += ((struct frag *) (line_ptr->frag))->fr_address;
}
(void) bfd_coff_swap_lineno_out (abfd, &(line_ptr->line), dst);
dst++;
@ -3390,7 +3375,6 @@ do_linenos_for (abfd, h, file_cursor)
H_SET_LINENO_SIZE (h, *file_cursor - start);
}
/* Now we run through the list of frag chains in a segment and
make all the subsegment frags appear at the end of the
list, as if the seg 0 was extra long */
@ -3431,7 +3415,6 @@ write_object_file ()
unsigned int addr;
abfd = bfd_openw (out_file_name, TARGET_FORMAT);
if (abfd == 0)
{
as_perror (_("FATAL: Can't create %s"), out_file_name);
@ -3471,10 +3454,8 @@ write_object_file ()
know (frag_now->fr_next == NULL);
}
remove_subsegs ();
for (i = SEG_E0; i < SEG_UNKNOWN; i++)
{
relax_segment (segment_info[i].frchainP->frch_root, i);
@ -3548,7 +3529,7 @@ write_object_file ()
}
/* Look for ".stab" segments and fill in their initial symbols
correctly. */
correctly. */
for (i = SEG_E0; i < SEG_UNKNOWN; i++)
{
name = segment_info[i].name;
@ -3609,7 +3590,7 @@ write_object_file ()
coff_header_append (abfd, &headers);
#if 0
/* Recent changes to write need this, but where it should
go is up to Ken.. */
go is up to Ken.. */
if (bfd_close_all_done (abfd) == false)
as_fatal (_("Can't close %s: %s"), out_file_name,
bfd_errmsg (bfd_get_error ()));
@ -3755,7 +3736,6 @@ obj_coff_section (ignore)
demand_empty_rest_of_line ();
}
static void
obj_coff_text (ignore)
int ignore ATTRIBUTE_UNUSED;
@ -3763,7 +3743,6 @@ obj_coff_text (ignore)
subseg_new (".text", get_absolute_expression ());
}
static void
obj_coff_data (ignore)
int ignore ATTRIBUTE_UNUSED;
@ -3805,7 +3784,7 @@ c_symbol_merge (debug, normal)
(unsigned int) (S_GET_NUMBER_AUXILIARY (debug) * AUXESZ));
} /* Move all the auxiliary information */
/* Move the debug flags. */
/* Move the debug flags. */
SF_SET_DEBUG_FIELD (normal, SF_GET_DEBUG_FIELD (debug));
} /* c_symbol_merge() */
@ -3835,7 +3814,6 @@ c_line_new (symbol, paddr, line_number, frag)
new_line->frag = (char *) frag;
new_line->next = (struct lineno_list *) NULL;
if (s->lineno_list_head == (struct lineno_list *) NULL)
{
s->lineno_list_head = new_line;
@ -3877,13 +3855,13 @@ c_dot_file_symbol (filename)
SA_SET_FILE_FNAME_ZEROS (symbolP, 0);
SA_SET_FILE_FNAME_OFFSET (symbolP, 1);
if (filename_list_tail)
if (filename_list_tail)
filename_list_tail->next = f;
else
filename_list_head = f;
filename_list_tail = f;
filename_list_tail = f;
}
else
else
{
SA_SET_FILE_FNAME (symbolP, filename);
}
@ -4002,7 +3980,7 @@ w_symbols (abfd, where, symbol_rootP)
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. */
to the string in memory but must be a file offset. */
register char *temp;
/* We can't fix the lnnoptr field in yank_symbols with the other
@ -4184,7 +4162,7 @@ fixup_segment (segP, this_segment_type)
if (fixP->fx_tcbit && SF_GET_CALLNAME (add_symbolP))
{
/* Relocation should be done via the associated 'bal' entry
point symbol. */
point symbol. */
if (!SF_GET_BALNAME (tc_get_bal_of_call (add_symbolP)))
{
@ -4282,7 +4260,7 @@ fixup_segment (segP, this_segment_type)
{
/* Difference of 2 symbols from same segment. Can't
make difference of 2 undefineds: 'value' means
something different for N_UNDF. */
something different for N_UNDF. */
#ifdef TC_I960
/* Makes no sense to use the difference of 2 arbitrary symbols
as the target of a call instruction. */
@ -4309,7 +4287,7 @@ fixup_segment (segP, this_segment_type)
}
else
{
/* Different segments in subtraction. */
/* Different segments in subtraction. */
know (!(S_IS_EXTERNAL (sub_symbolP) && (S_GET_SEGMENT (sub_symbolP) == absolute_section)));
if ((S_GET_SEGMENT (sub_symbolP) == absolute_section))
@ -4318,7 +4296,7 @@ fixup_segment (segP, this_segment_type)
}
#ifdef DIFF_EXPR_OK
else if (S_GET_SEGMENT (sub_symbolP) == this_segment_type
#if 0 /* Okay for 68k, at least... */
#if 0 /* Okay for 68k, at least... */
&& !pcrel
#endif
)
@ -4378,7 +4356,7 @@ fixup_segment (segP, this_segment_type)
the i386 are relaxed, this could only arise with a
call instruction. */
pcrel = 0; /* Lie. Don't want further pcrel processing. */
pcrel = 0; /* Lie. Don't want further pcrel processing. */
if (!TC_FORCE_RELOCATION (fixP))
{
fixP->fx_addsy = NULL;
@ -4404,7 +4382,6 @@ fixup_segment (segP, this_segment_type)
break;
default:
#if defined(TC_A29K) || (defined(TE_PE) && defined(TC_I386)) || defined(TC_M88K)
/* This really should be handled in the linker, but
backward compatibility forbids. */
@ -4439,13 +4416,12 @@ fixup_segment (segP, this_segment_type)
/* This is also true for 68k COFF on sysv machines
(Checked on Motorola sysv68 R3V6 and R3V7.1, and also on
UNIX System V/M68000, Release 1.0 from ATT/Bell Labs)
Philippe De Muyter <phdm@info.ucl.ac.be>. */
Philippe De Muyter <phdm@info.ucl.ac.be>. */
if (S_IS_COMMON (add_symbolP))
add_number += S_GET_VALUE (add_symbolP);
#endif
break;
} /* switch on symbol seg */
} /* if not in local seg */
} /* if there was a + symbol */
@ -4524,7 +4500,7 @@ fixup_segment (segP, this_segment_type)
(unsigned long) (fragP->fr_address + where));
#endif
} /* not a bit fix */
} /* For each fixS in this segment. */
} /* For each fixS in this segment. */
} /* fixup_segment() */
#endif
@ -4540,9 +4516,9 @@ obj_coff_init_stab_section (seg)
char *stabstr_name;
unsigned int stroff;
/* Make space for this first symbol. */
/* Make space for this first symbol. */
p = frag_more (12);
/* Zero it out. */
/* Zero it out. */
memset (p, 0, 12);
as_where (&file, (unsigned int *) NULL);
stabstr_name = (char *) alloca (strlen (segment_info[seg].name) + 4);
@ -4567,7 +4543,7 @@ adjust_stab_section(abfd, seg)
int i, strsz = 0, nsyms;
fragS *frag = segment_info[seg].frchainP->frch_root;
/* Look for the associated string table section. */
/* Look for the associated string table section. */
secname = segment_info[seg].name;
name = (char *) alloca (strlen (secname) + 4);
@ -4584,14 +4560,14 @@ adjust_stab_section(abfd, seg)
}
}
/* If we found the section, get its size. */
/* If we found the section, get its size. */
if (stabstrseg != SEG_UNKNOWN)
strsz = size_section (abfd, stabstrseg);
nsyms = size_section (abfd, seg) / 12 - 1;
/* Look for the first frag of sufficient size for the initial stab
symbol, and collect a pointer to it. */
symbol, and collect a pointer to it. */
while (frag && frag->fr_fix < 12)
frag = frag->fr_next;
assert (frag != 0);
@ -4599,7 +4575,7 @@ adjust_stab_section(abfd, seg)
assert (p != 0);
/* Write in the number of stab symbols and the size of the string
table. */
table. */
bfd_h_put_16 (abfd, (bfd_vma) nsyms, (bfd_byte *) p + 6);
bfd_h_put_32 (abfd, (bfd_vma) strsz, (bfd_byte *) p + 8);
}

View file

@ -39,7 +39,7 @@
#include "bfd.h"
/* This internal_lineno crap is to stop namespace pollution from the
bfd internal coff headerfile. */
bfd internal coff headerfile. */
#define internal_lineno bfd_internal_lineno
#include "coff/internal.h"
#undef internal_lineno
@ -255,7 +255,7 @@ extern void obj_coff_section PARAMS ((int));
/* The number of auxiliary entries */
#define S_SET_NUMBER_AUXILIARY(s,v) (S_GET_NUMBER_AUXILIARY (s) = (v))
/* True if a symbol name is in the string table, i.e. its length is > 8. */
/* True if a symbol name is in the string table, i.e. its length is > 8. */
#define S_IS_STRING(s) (strlen(S_GET_NAME(s)) > 8 ? 1 : 0)
extern int S_SET_DATA_TYPE PARAMS ((symbolS *, int));
@ -299,13 +299,13 @@ extern void SA_SET_SYM_ENDNDX PARAMS ((symbolS *, symbolS *));
* differently.
*/
#define SF_I960_MASK (0x000001ff) /* Bits 0-8 are used by the i960 port. */
#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 */
@ -319,8 +319,8 @@ extern void SA_SET_SYM_ENDNDX PARAMS ((symbolS *, symbolS *));
#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. */
#define SF_GET_SEGMENT (0x00200000) /* Get the section of the forward symbol. */
/* All other bits are unused. */
/* Accessors */
#define SF_GET(s) (*symbol_get_obj (s))
@ -373,7 +373,6 @@ extern int coff_n_line_nos;
#define obj_emit_lineno(WHERE,LINE,FILE_START) abort ()
extern void coff_add_linesym PARAMS ((symbolS *));
void c_dot_file_symbol PARAMS ((const char *filename));
#define obj_app_file c_dot_file_symbol
@ -435,10 +434,9 @@ hey ! Where is the C_LEAFSTAT definition ? i960 - coff support is depending on i
extern const segT N_TYPE_seg[];
/* Magic number of paged executable. */
/* Magic number of paged executable. */
#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE 0x8300
/* SYMBOL TABLE */
/* Symbol table entry data type */
@ -447,7 +445,7 @@ typedef struct
{
/* Basic symbol */
struct internal_syment ost_entry;
/* Auxiliary entry. */
/* Auxiliary entry. */
union internal_auxent ost_auxent[OBJ_COFF_MAX_AUXENTRIES];
/* obj_coff internal use only flags */
unsigned int ost_flags;
@ -507,7 +505,7 @@ typedef struct
*/
#define S_IS_COMMON(s) ((s)->sy_symbol.ost_entry.n_scnum == 0 \
&& S_GET_VALUE (s) != 0)
/* True if a symbol name is in the string table, i.e. its length is > 8. */
/* True if a symbol name is in the string table, i.e. its length is > 8. */
#define S_IS_STRING(s) (strlen(S_GET_NAME(s)) > 8 ? 1 : 0)
/* True if a symbol is defined as weak. */
@ -596,13 +594,13 @@ typedef struct
* differently.
*/
#define SF_I960_MASK (0x000001ff) /* Bits 0-8 are used by the i960 port. */
#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 */
@ -616,9 +614,9 @@ typedef struct
#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_GET_SEGMENT (0x00200000) /* Get the section of the forward symbol. */
#define SF_ADJ_LNNOPTR (0x00400000) /* Has a lnnoptr */
/* All other bits are unused. */
/* All other bits are unused. */
/* Accessors */
#define SF_GET(s) ((s)->sy_symbol.ost_flags)
@ -772,17 +770,15 @@ typedef struct
typedef struct
{
struct internal_aouthdr aouthdr; /* a.out header */
struct internal_filehdr filehdr; /* File header, not machine dep. */
struct internal_filehdr filehdr; /* File header, not machine dep. */
long string_table_size; /* names + '\0' + sizeof(int) */
long relocation_size; /* Cumulated size of relocation
information for all sections in
bytes. */
bytes. */
long lineno_size; /* Size of the line number information
table in bytes */
} object_headers;
struct lineno_list
{
struct bfd_internal_lineno line;
@ -790,9 +786,6 @@ struct lineno_list
struct lineno_list *next; /* Forward chain pointer */
};
#define obj_segment_name(i) (segment_info[(int) (i)].scnhdr.s_name)
#define obj_add_segment(s) obj_coff_add_segment (s)