1999-05-03 09:29:11 +02:00
|
|
|
|
/* coff object file format
|
2018-01-03 06:17:27 +01:00
|
|
|
|
Copyright (C) 1989-2018 Free Software Foundation, Inc.
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
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
|
2007-07-03 13:01:12 +02:00
|
|
|
|
the Free Software Foundation; either version 3, or (at your option)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
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
|
2005-05-05 11:13:19 +02:00
|
|
|
|
Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
|
|
|
|
|
02110-1301, USA. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
#define OBJ_HEADER "obj-coff.h"
|
|
|
|
|
|
|
|
|
|
#include "as.h"
|
2010-01-27 23:01:38 +01:00
|
|
|
|
#include "safe-ctype.h"
|
1999-05-03 09:29:11 +02:00
|
|
|
|
#include "subsegs.h"
|
2012-10-18 19:00:56 +02:00
|
|
|
|
#include "struc-symbol.h"
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2004-11-08 09:12:53 +01:00
|
|
|
|
#ifdef TE_PE
|
|
|
|
|
#include "coff/pe.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2011-05-18 09:58:36 +02:00
|
|
|
|
#ifdef OBJ_XCOFF
|
|
|
|
|
#include "coff/xcoff.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2005-03-16 15:57:00 +01:00
|
|
|
|
#define streq(a,b) (strcmp ((a), (b)) == 0)
|
|
|
|
|
#define strneq(a,b,n) (strncmp ((a), (b), (n)) == 0)
|
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
/* I think this is probably always correct. */
|
|
|
|
|
#ifndef KEEP_RELOC_INFO
|
|
|
|
|
#define KEEP_RELOC_INFO
|
|
|
|
|
#endif
|
|
|
|
|
|
* README-vms: Delete.
* config-gas.com: Delete.
* makefile.vms: Delete.
* vmsconf.sh: Delete.
* config/atof-tahoe.c: Delete.
* config/m88k-opcode.h: Delete.
* config/obj-bout.c: Delete.
* config/obj-bout.h: Delete.
* config/obj-hp300.c: Delete.
* config/obj-hp300.h: Delete.
* config/tc-a29k.c: Delete.
* config/tc-a29k.h: Delete.
* config/tc-h8500.c: Delete.
* config/tc-h8500.h: Delete.
* config/tc-m88k.c: Delete.
* config/tc-m88k.h: Delete.
* config/tc-tahoe.c: Delete.
* config/tc-tahoe.h: Delete.
* config/tc-tic80.c: Delete.
* config/tc-tic80.h: Delete.
* config/tc-w65.c: Delete.
* config/tc-w65.h: Delete.
* config/te-aux.h: Delete.
* config/te-delt88.h: Delete.
* config/te-delta.h: Delete.
* config/te-dpx2.h: Delete.
* config/te-hp300.h: Delete.
* config/te-ic960.h: Delete.
* config/vms-a-conf.h: Delete.
* doc/c-a29k.texi: Delete.
* doc/c-h8500.texi: Delete.
* doc/c-m88k.texi: Delete.
* README: Remove obsolete examples, and list of supported targets.
* Makefile.am: Remove a29k, h8500, m88k, tahoe, tic80, w65,
bout and hp300 support.
(DEP_FLAGS): Don't define BFD_ASSEMBLER.
* configure.in: Remove --enable-bfd-assembler, need_bfd,
primary_bfd_gas.
* configure.tgt: Remove a29k, h8300-coff, h8500-*, i960 non-elf,
m68k non bfd, m88k, or32-coff, tic80-*, vax non-bfd, w65k-*, *-nindy.
* as.c: Remove all non-BFD_ASSEMBLER code, support for above targets.
* as.h: Likewise.
* dw2gencfi.c: Likewise.
* dwarf2dbg.c: Likewise.
* ehopt.c: Likewise.
* input-file.c: Likewise.
* listing.c: Likewise.
* literal.c: Likewise.
* messages.c: Likewise.
* obj.h: Likewise.
* output-file.c: Likewise.
* read.c: Likewise.
* stabs.c: Likewise.
* struc-symbol.h: Likewise.
* subsegs.c: Likewise.
* subsegs.h: Likewise.
* symbols.c: Likewise.
* symbols.h: Likewise.
* tc.h: Likewise.
* write.c: Likewise.
* write.h: Likewise.
* config/aout_gnu.h: Likewise.
* config/obj-aout.c: Likewise.
* config/obj-aout.h: Likewise.
* config/obj-coff.c: Likewise.
* config/obj-coff.h: Likewise.
* config/obj-evax.h: Likewise.
* config/obj-ieee.h: Likewise.
* config/tc-arm.c: Likewise.
* config/tc-arm.h: Likewise.
* config/tc-avr.c: Likewise.
* config/tc-avr.h: Likewise.
* config/tc-crx.h: Likewise.
* config/tc-d10v.h: Likewise.
* config/tc-d30v.h: Likewise.
* config/tc-dlx.h: Likewise.
* config/tc-fr30.h: Likewise.
* config/tc-frv.h: Likewise.
* config/tc-h8300.c: Likewise.
* config/tc-h8300.h: Likewise.
* config/tc-hppa.h: Likewise.
* config/tc-i370.h: Likewise.
* config/tc-i386.c: Likewise.
* config/tc-i386.h: Likewise.
* config/tc-i860.h: Likewise.
* config/tc-i960.c: Likewise.
* config/tc-i960.h: Likewise.
* config/tc-ip2k.h: Likewise.
* config/tc-iq2000.h: Likewise.
* config/tc-m32c.h: Likewise.
* config/tc-m32r.h: Likewise.
* config/tc-m68hc11.h: Likewise.
* config/tc-m68k.c: Likewise.
* config/tc-m68k.h: Likewise.
* config/tc-maxq.c: Likewise.
* config/tc-maxq.h: Likewise.
* config/tc-mcore.c: Likewise.
* config/tc-mcore.h: Likewise.
* config/tc-mn10200.h: Likewise.
* config/tc-mn10300.c: Likewise.
* config/tc-mn10300.h: Likewise.
* config/tc-ms1.h: Likewise.
* config/tc-msp430.c: Likewise.
* config/tc-msp430.h: Likewise.
* config/tc-ns32k.c: Likewise.
* config/tc-ns32k.h: Likewise.
* config/tc-openrisc.h: Likewise.
* config/tc-or32.c: Likewise.
* config/tc-or32.h: Likewise.
* config/tc-ppc.c: Likewise.
* config/tc-ppc.h: Likewise.
* config/tc-s390.h: Likewise.
* config/tc-sh.c: Likewise.
* config/tc-sh.h: Likewise.
* config/tc-sparc.c: Likewise.
* config/tc-tic30.c: Likewise.
* config/tc-tic30.h: Likewise.
* config/tc-tic4x.c: Likewise.
* config/tc-tic4x.h: Likewise.
* config/tc-tic54x.c: Likewise.
* config/tc-tic54x.h: Likewise.
* config/tc-v850.h: Likewise.
* config/tc-vax.c: Likewise.
* config/tc-vax.h: Likewise.
* config/tc-xstormy16.h: Likewise.
* config/tc-xtensa.h: Likewise.
* config/tc-z8k.c: Likewise.
* config/tc-z8k.h: Likewise.
* config/vms-a-conf.h
* doc/Makefile.am: Likewise.
* doc/all.texi: Likewise.
* doc/as.texinfo: Likewise.
* doc/Makefile.in: Regenerate.
* Makefile.in: Regenerate.
* configure: Regenerate.
* config.in: Regenerate.
* po/POTFILES.in: Regenerate.
2005-08-11 03:25:29 +02:00
|
|
|
|
/* obj_coff_section will use this macro to set a new section's
|
|
|
|
|
attributes when a directive has no valid flags or the "w" flag is
|
|
|
|
|
used. This default should be appropriate for most. */
|
2000-07-06 19:18:10 +02:00
|
|
|
|
#ifndef TC_COFF_SECTION_DEFAULT_ATTRIBUTES
|
|
|
|
|
#define TC_COFF_SECTION_DEFAULT_ATTRIBUTES (SEC_LOAD | SEC_DATA)
|
|
|
|
|
#endif
|
|
|
|
|
|
2001-08-09 16:42:07 +02:00
|
|
|
|
/* This is used to hold the symbol built by a sequence of pseudo-ops
|
|
|
|
|
from .def and .endef. */
|
|
|
|
|
static symbolS *def_symbol_in_progress;
|
2004-11-08 09:12:53 +01:00
|
|
|
|
#ifdef TE_PE
|
|
|
|
|
/* PE weak alternate symbols begin with this string. */
|
|
|
|
|
static const char weak_altprefix[] = ".weak.";
|
|
|
|
|
#endif /* TE_PE */
|
2001-08-09 16:42:07 +02:00
|
|
|
|
|
2009-08-17 13:45:23 +02:00
|
|
|
|
#include "obj-coff-seh.c"
|
|
|
|
|
|
2001-08-09 16:42:07 +02:00
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
unsigned long chunk_size;
|
|
|
|
|
unsigned long element_size;
|
|
|
|
|
unsigned long size;
|
|
|
|
|
char *data;
|
|
|
|
|
unsigned long pointer;
|
|
|
|
|
}
|
|
|
|
|
stack;
|
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* Stack stuff. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
static stack *
|
2005-03-16 15:57:00 +01:00
|
|
|
|
stack_init (unsigned long chunk_size,
|
|
|
|
|
unsigned long element_size)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
stack *st;
|
|
|
|
|
|
2016-04-06 22:26:46 +02:00
|
|
|
|
st = XNEW (stack);
|
|
|
|
|
st->data = XNEWVEC (char, chunk_size);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
if (!st->data)
|
|
|
|
|
{
|
|
|
|
|
free (st);
|
2005-03-16 15:57:00 +01:00
|
|
|
|
return NULL;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
|
|
|
|
st->pointer = 0;
|
|
|
|
|
st->size = chunk_size;
|
|
|
|
|
st->chunk_size = chunk_size;
|
|
|
|
|
st->element_size = element_size;
|
|
|
|
|
return st;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static char *
|
2005-03-16 15:57:00 +01:00
|
|
|
|
stack_push (stack *st, char *element)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
if (st->pointer + st->element_size >= st->size)
|
|
|
|
|
{
|
|
|
|
|
st->size += st->chunk_size;
|
2016-04-06 22:26:46 +02:00
|
|
|
|
st->data = XRESIZEVEC (char, st->data, st->size);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
|
|
|
|
memcpy (st->data + st->pointer, element, st->element_size);
|
|
|
|
|
st->pointer += st->element_size;
|
|
|
|
|
return st->data + st->pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static char *
|
2005-03-16 15:57:00 +01:00
|
|
|
|
stack_pop (stack *st)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
if (st->pointer < st->element_size)
|
|
|
|
|
{
|
|
|
|
|
st->pointer = 0;
|
2005-03-16 15:57:00 +01:00
|
|
|
|
return NULL;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
|
|
|
|
st->pointer -= st->element_size;
|
|
|
|
|
return st->data + st->pointer;
|
|
|
|
|
}
|
|
|
|
|
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* Maintain a list of the tagnames of the structures. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
static struct hash_control *tag_hash;
|
|
|
|
|
|
|
|
|
|
static void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
tag_init (void)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
tag_hash = hash_new ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
tag_insert (const char *name, symbolS *symbolP)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
const char *error_string;
|
|
|
|
|
|
|
|
|
|
if ((error_string = hash_jam (tag_hash, name, (char *) symbolP)))
|
2005-03-16 15:57:00 +01:00
|
|
|
|
as_fatal (_("Inserting \"%s\" into structure table failed: %s"),
|
|
|
|
|
name, error_string);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static symbolS *
|
2005-03-16 15:57:00 +01:00
|
|
|
|
tag_find (char *name)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
return (symbolS *) hash_find (tag_hash, name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static symbolS *
|
2005-03-16 15:57:00 +01:00
|
|
|
|
tag_find_or_make (char *name)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
symbolS *symbolP;
|
|
|
|
|
|
|
|
|
|
if ((symbolP = tag_find (name)) == NULL)
|
|
|
|
|
{
|
|
|
|
|
symbolP = symbol_new (name, undefined_section,
|
|
|
|
|
0, &zero_address_frag);
|
|
|
|
|
|
|
|
|
|
tag_insert (S_GET_NAME (symbolP), symbolP);
|
|
|
|
|
symbol_table_insert (symbolP);
|
2005-03-16 15:57:00 +01:00
|
|
|
|
}
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
return symbolP;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* We accept the .bss directive to set the section for backward
|
|
|
|
|
compatibility with earlier versions of gas. */
|
|
|
|
|
|
|
|
|
|
static void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
obj_coff_bss (int ignore ATTRIBUTE_UNUSED)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
if (*input_line_pointer == '\n')
|
|
|
|
|
subseg_new (".bss", get_absolute_expression ());
|
|
|
|
|
else
|
|
|
|
|
s_lcomm (0);
|
|
|
|
|
}
|
|
|
|
|
|
2009-05-19 18:08:08 +02:00
|
|
|
|
#ifdef TE_PE
|
|
|
|
|
/* Called from read.c:s_comm after we've parsed .comm symbol, size.
|
|
|
|
|
Parse a possible alignment value. */
|
|
|
|
|
|
|
|
|
|
static symbolS *
|
|
|
|
|
obj_coff_common_parse (int ignore ATTRIBUTE_UNUSED, symbolS *symbolP, addressT size)
|
|
|
|
|
{
|
|
|
|
|
addressT align = 0;
|
|
|
|
|
|
|
|
|
|
if (*input_line_pointer == ',')
|
|
|
|
|
{
|
|
|
|
|
align = parse_align (0);
|
|
|
|
|
if (align == (addressT) -1)
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
S_SET_VALUE (symbolP, size);
|
|
|
|
|
S_SET_EXTERNAL (symbolP);
|
|
|
|
|
S_SET_SEGMENT (symbolP, bfd_com_section_ptr);
|
|
|
|
|
|
|
|
|
|
symbol_get_bfdsym (symbolP)->flags |= BSF_OBJECT;
|
|
|
|
|
|
|
|
|
|
/* There is no S_SET_ALIGN (symbolP, align) in COFF/PE.
|
|
|
|
|
Instead we must add a note to the .drectve section. */
|
|
|
|
|
if (align)
|
|
|
|
|
{
|
|
|
|
|
segT current_seg = now_seg;
|
|
|
|
|
subsegT current_subseg = now_subseg;
|
|
|
|
|
flagword oldflags;
|
|
|
|
|
asection *sec;
|
|
|
|
|
size_t pfxlen, numlen;
|
|
|
|
|
char *frag;
|
|
|
|
|
char numbuff[20];
|
|
|
|
|
|
|
|
|
|
sec = subseg_new (".drectve", 0);
|
|
|
|
|
oldflags = bfd_get_section_flags (stdoutput, sec);
|
|
|
|
|
if (oldflags == SEC_NO_FLAGS)
|
|
|
|
|
{
|
|
|
|
|
if (!bfd_set_section_flags (stdoutput, sec,
|
|
|
|
|
TC_COFF_SECTION_DEFAULT_ATTRIBUTES))
|
|
|
|
|
as_warn (_("error setting flags for \"%s\": %s"),
|
|
|
|
|
bfd_section_name (stdoutput, sec),
|
|
|
|
|
bfd_errmsg (bfd_get_error ()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Emit a string. Note no NUL-termination. */
|
2010-07-11 10:45:51 +02:00
|
|
|
|
pfxlen = strlen (" -aligncomm:") + 2 + strlen (S_GET_NAME (symbolP)) + 1;
|
2009-05-19 18:08:08 +02:00
|
|
|
|
numlen = snprintf (numbuff, sizeof (numbuff), "%d", (int) align);
|
|
|
|
|
frag = frag_more (pfxlen + numlen);
|
2010-07-11 10:45:51 +02:00
|
|
|
|
(void) sprintf (frag, " -aligncomm:\"%s\",", S_GET_NAME (symbolP));
|
2009-05-19 18:08:08 +02:00
|
|
|
|
memcpy (frag + pfxlen, numbuff, numlen);
|
|
|
|
|
/* Restore original subseg. */
|
|
|
|
|
subseg_set (current_seg, current_subseg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return symbolP;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
obj_coff_comm (int ignore ATTRIBUTE_UNUSED)
|
|
|
|
|
{
|
|
|
|
|
s_comm_internal (ignore, obj_coff_common_parse);
|
|
|
|
|
}
|
|
|
|
|
#endif /* TE_PE */
|
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
#define GET_FILENAME_STRING(X) \
|
2005-03-16 15:57:00 +01:00
|
|
|
|
((char *) (&((X)->sy_symbol.ost_auxent->x_file.x_n.x_offset))[1])
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* @@ Ick. */
|
|
|
|
|
static segT
|
2005-03-16 15:57:00 +01:00
|
|
|
|
fetch_coff_debug_section (void)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
static segT debug_section;
|
2005-03-16 15:57:00 +01:00
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
if (!debug_section)
|
|
|
|
|
{
|
2002-06-08 09:37:16 +02:00
|
|
|
|
const asymbol *s;
|
2005-03-16 15:57:00 +01:00
|
|
|
|
|
|
|
|
|
s = bfd_make_debug_symbol (stdoutput, NULL, 0);
|
* gas/app, gas/as.c, gas/as.h, gas/atof-generic.c, gas/cgen.c,
gas/config/atof-ieee.c, gas/config/obj-aout.c,
gas/config/obj-coff.c, gas/config/obj-ecoff.c,
gas/config/obj-elf.c, gas/config/obj-som.c, gas/config/tc-alpha.c,
gas/config/tc-arc.c, gas/config/tc-arm.c, gas/config/tc-cr16.c,
gas/config/tc-cris.c, gas/config/tc-crx.c, gas/config/tc-d30v.c,
gas/config/tc-dlx.c, gas/config/tc-hppa.c, gas/config/tc-i370.c,
gas/config/tc-i386-intel.c, gas/config/tc-i386.c,
gas/config/tc-i860.c, gas/config/tc-i960.c, gas/config/tc-ia64.c,
gas/config/tc-iq2000.c, gas/config/tc-m32c.c,
gas/config/tc-m32r.c, gas/config/tc-m68hc11.c,
gas/config/tc-m68k.c, gas/config/tc-maxq.c, gas/config/tc-mcore.c,
gas/config/tc-mep.c, gas/config/tc-mips.c, gas/config/tc-mmix.c,
gas/config/tc-mn10300.c, gas/config/tc-moxie.c,
gas/config/tc-ns32k.c, gas/config/tc-pj.c, gas/config/tc-ppc.c,
gas/config/tc-s390.c, gas/config/tc-score.c,
gas/config/tc-score7.c, gas/config/tc-sh.c, gas/config/tc-sparc.c,
gas/config/tc-spu.c, gas/config/tc-tic30.c, gas/config/tc-vax.c,
gas/config/tc-xtensa.c, gas/config/xtensa-relax.c,
gas/dw2gencfi.c, gas/dwarf2dbg.c, gas/ehopt.c, gas/expr.c,
gas/frags.c, gas/input-file.c, gas/read.c, gas/sb.c,
gas/subsegs.c, gas/symbols.c, gas/write.c: Change the name of the
gas macro `assert' to `gas_assert'.
2009-06-22 19:56:02 +02:00
|
|
|
|
gas_assert (s != 0);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
debug_section = s->section;
|
|
|
|
|
}
|
|
|
|
|
return debug_section;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
SA_SET_SYM_ENDNDX (symbolS *sym, symbolS *val)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
combined_entry_type *entry, *p;
|
|
|
|
|
|
Add support for storing local symbols in a small structure to save
memory when assembling large files.
* as.h: Don't include struc-symbol.h.
(symbolS): Add typedef.
* symbols.c: Include struc-symbol.h.
(local_hash): New static variable.
(save_symbol_name): New static function, from symbol_create.
(symbol_create): Call save_symbol_name.
(local_symbol_count): New static variable.
(local_symbol_conversion_count): Likewise.
(LOCAL_SYMBOL_CHECK): Define.
(local_symbol_make): New static function.
(local_symbol_convert): New static function.
(colon): Handle local symbols. Create local symbol for local
label name.
(symbol_table_insert): Handle local symbols.
(symbol_find_or_make): Create local symbol for local label name.
(symbol_find_base): Check for local symbol.
(symbol_append, symbol_insert): Check for local symbols.
(symbol_clear_list_pointers, symbol_remove): Likewise.
(verify_symbol_chain): Likewise.
(copy_symbol_attributes): Likewise.
(resolve_symbol_value): Handle local symbols.
(resolve_local_symbol): New static function.
(resolve_local_symbol_values): New function.
(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
(symbol_previous, symbol_next): New functions.
(symbol_get_value_expression): Likewise.
(symbol_set_value_expression): Likewise.
(symbol_set_frag, symbol_get_frag): Likewise.
(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
(symbol_mark_used_in_reloc): Likewise.
(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
(symbol_mri_common_p): Likewise.
(symbol_mark_written, symbol_clear_written): Likewise.
(symbol_written_p): Likewise.
(symbol_mark_resolved, symbol_resolved_p): Likewise.
(symbol_section_p, symbol_equated_p): Likewise.
(symbol_constant_p): Likewise.
(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
(symbol_get_obj, symbol_set_obj): Likewise.
(symbol_get_tc, symbol_set_tc): Likewise.
(symbol_begin): Initialize local_hash.
(print_symbol_value_1): Handle local symbols.
(symbol_print_statistics): Print local symbol statistics.
* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
Declare new symbols.c functions. Move many declarations here from
struc-symbol.h.
(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
(struct symbol): Move bsym to make it clearly the first field.
Remove TARGET_SYMBOL_FIELDS.
(symbolS): Don't typedef.
(struct broken_word): Remove.
(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
(symbol_clear_list_pointers): Likewise.
(symbol_insert, symbol_remove): Likewise.
(symbol_previous, symbol_append): Likewise.
(verify_symbol_chain, verify_symbol_chain_2): Likewise.
(struct local_symbol): Define.
(local_symbol_converted_p, local_symbol_mark_converted): Define.
(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
(local_symbol_get_frag, local_symbol_set_frag): Define.
(local_symbol_get_real_symbol): Define.
(local_symbol_set_real_symbol): Define.
Define.
* write.c (write_object_file): Call resolve_local_symbol_values.
* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-multi.h (struct elf_obj_sy): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
* config/tc-mcore.h: Don't include struc-symbol.h.
(TARGET_SYMBOL_FIELDS): Don't define.
(struct mcore_tc_sy): Define.
(TC_SYMFIELD_TYPE): Define.
* Many files: Use symbolS instead of struct symbol. Use new
accessor functions rather than referring to symbolS fields
directly.
* read.c (s_mri_common): Don't add in value of line_label.
* config/tc-mips.c (md_apply_fix): Correct parenthesization when
checking for SEC_LINK_ONCE.
* config/tc-sh.h (sh_fix_adjustable): Declare.
1999-06-03 02:29:48 +02:00
|
|
|
|
entry = &coffsymbol (symbol_get_bfdsym (sym))->native[1];
|
|
|
|
|
p = coffsymbol (symbol_get_bfdsym (val))->native;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
entry->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.p = p;
|
|
|
|
|
entry->fix_end = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
SA_SET_SYM_TAGNDX (symbolS *sym, symbolS *val)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
combined_entry_type *entry, *p;
|
|
|
|
|
|
Add support for storing local symbols in a small structure to save
memory when assembling large files.
* as.h: Don't include struc-symbol.h.
(symbolS): Add typedef.
* symbols.c: Include struc-symbol.h.
(local_hash): New static variable.
(save_symbol_name): New static function, from symbol_create.
(symbol_create): Call save_symbol_name.
(local_symbol_count): New static variable.
(local_symbol_conversion_count): Likewise.
(LOCAL_SYMBOL_CHECK): Define.
(local_symbol_make): New static function.
(local_symbol_convert): New static function.
(colon): Handle local symbols. Create local symbol for local
label name.
(symbol_table_insert): Handle local symbols.
(symbol_find_or_make): Create local symbol for local label name.
(symbol_find_base): Check for local symbol.
(symbol_append, symbol_insert): Check for local symbols.
(symbol_clear_list_pointers, symbol_remove): Likewise.
(verify_symbol_chain): Likewise.
(copy_symbol_attributes): Likewise.
(resolve_symbol_value): Handle local symbols.
(resolve_local_symbol): New static function.
(resolve_local_symbol_values): New function.
(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
(symbol_previous, symbol_next): New functions.
(symbol_get_value_expression): Likewise.
(symbol_set_value_expression): Likewise.
(symbol_set_frag, symbol_get_frag): Likewise.
(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
(symbol_mark_used_in_reloc): Likewise.
(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
(symbol_mri_common_p): Likewise.
(symbol_mark_written, symbol_clear_written): Likewise.
(symbol_written_p): Likewise.
(symbol_mark_resolved, symbol_resolved_p): Likewise.
(symbol_section_p, symbol_equated_p): Likewise.
(symbol_constant_p): Likewise.
(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
(symbol_get_obj, symbol_set_obj): Likewise.
(symbol_get_tc, symbol_set_tc): Likewise.
(symbol_begin): Initialize local_hash.
(print_symbol_value_1): Handle local symbols.
(symbol_print_statistics): Print local symbol statistics.
* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
Declare new symbols.c functions. Move many declarations here from
struc-symbol.h.
(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
(struct symbol): Move bsym to make it clearly the first field.
Remove TARGET_SYMBOL_FIELDS.
(symbolS): Don't typedef.
(struct broken_word): Remove.
(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
(symbol_clear_list_pointers): Likewise.
(symbol_insert, symbol_remove): Likewise.
(symbol_previous, symbol_append): Likewise.
(verify_symbol_chain, verify_symbol_chain_2): Likewise.
(struct local_symbol): Define.
(local_symbol_converted_p, local_symbol_mark_converted): Define.
(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
(local_symbol_get_frag, local_symbol_set_frag): Define.
(local_symbol_get_real_symbol): Define.
(local_symbol_set_real_symbol): Define.
Define.
* write.c (write_object_file): Call resolve_local_symbol_values.
* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-multi.h (struct elf_obj_sy): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
* config/tc-mcore.h: Don't include struc-symbol.h.
(TARGET_SYMBOL_FIELDS): Don't define.
(struct mcore_tc_sy): Define.
(TC_SYMFIELD_TYPE): Define.
* Many files: Use symbolS instead of struct symbol. Use new
accessor functions rather than referring to symbolS fields
directly.
* read.c (s_mri_common): Don't add in value of line_label.
* config/tc-mips.c (md_apply_fix): Correct parenthesization when
checking for SEC_LINK_ONCE.
* config/tc-sh.h (sh_fix_adjustable): Declare.
1999-06-03 02:29:48 +02:00
|
|
|
|
entry = &coffsymbol (symbol_get_bfdsym (sym))->native[1];
|
|
|
|
|
p = coffsymbol (symbol_get_bfdsym (val))->native;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
entry->u.auxent.x_sym.x_tagndx.p = p;
|
|
|
|
|
entry->fix_tag = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
2005-03-16 15:57:00 +01:00
|
|
|
|
S_GET_DATA_TYPE (symbolS *sym)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
Add support for storing local symbols in a small structure to save
memory when assembling large files.
* as.h: Don't include struc-symbol.h.
(symbolS): Add typedef.
* symbols.c: Include struc-symbol.h.
(local_hash): New static variable.
(save_symbol_name): New static function, from symbol_create.
(symbol_create): Call save_symbol_name.
(local_symbol_count): New static variable.
(local_symbol_conversion_count): Likewise.
(LOCAL_SYMBOL_CHECK): Define.
(local_symbol_make): New static function.
(local_symbol_convert): New static function.
(colon): Handle local symbols. Create local symbol for local
label name.
(symbol_table_insert): Handle local symbols.
(symbol_find_or_make): Create local symbol for local label name.
(symbol_find_base): Check for local symbol.
(symbol_append, symbol_insert): Check for local symbols.
(symbol_clear_list_pointers, symbol_remove): Likewise.
(verify_symbol_chain): Likewise.
(copy_symbol_attributes): Likewise.
(resolve_symbol_value): Handle local symbols.
(resolve_local_symbol): New static function.
(resolve_local_symbol_values): New function.
(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
(symbol_previous, symbol_next): New functions.
(symbol_get_value_expression): Likewise.
(symbol_set_value_expression): Likewise.
(symbol_set_frag, symbol_get_frag): Likewise.
(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
(symbol_mark_used_in_reloc): Likewise.
(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
(symbol_mri_common_p): Likewise.
(symbol_mark_written, symbol_clear_written): Likewise.
(symbol_written_p): Likewise.
(symbol_mark_resolved, symbol_resolved_p): Likewise.
(symbol_section_p, symbol_equated_p): Likewise.
(symbol_constant_p): Likewise.
(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
(symbol_get_obj, symbol_set_obj): Likewise.
(symbol_get_tc, symbol_set_tc): Likewise.
(symbol_begin): Initialize local_hash.
(print_symbol_value_1): Handle local symbols.
(symbol_print_statistics): Print local symbol statistics.
* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
Declare new symbols.c functions. Move many declarations here from
struc-symbol.h.
(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
(struct symbol): Move bsym to make it clearly the first field.
Remove TARGET_SYMBOL_FIELDS.
(symbolS): Don't typedef.
(struct broken_word): Remove.
(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
(symbol_clear_list_pointers): Likewise.
(symbol_insert, symbol_remove): Likewise.
(symbol_previous, symbol_append): Likewise.
(verify_symbol_chain, verify_symbol_chain_2): Likewise.
(struct local_symbol): Define.
(local_symbol_converted_p, local_symbol_mark_converted): Define.
(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
(local_symbol_get_frag, local_symbol_set_frag): Define.
(local_symbol_get_real_symbol): Define.
(local_symbol_set_real_symbol): Define.
Define.
* write.c (write_object_file): Call resolve_local_symbol_values.
* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-multi.h (struct elf_obj_sy): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
* config/tc-mcore.h: Don't include struc-symbol.h.
(TARGET_SYMBOL_FIELDS): Don't define.
(struct mcore_tc_sy): Define.
(TC_SYMFIELD_TYPE): Define.
* Many files: Use symbolS instead of struct symbol. Use new
accessor functions rather than referring to symbolS fields
directly.
* read.c (s_mri_common): Don't add in value of line_label.
* config/tc-mips.c (md_apply_fix): Correct parenthesization when
checking for SEC_LINK_ONCE.
* config/tc-sh.h (sh_fix_adjustable): Declare.
1999-06-03 02:29:48 +02:00
|
|
|
|
return coffsymbol (symbol_get_bfdsym (sym))->native->u.syment.n_type;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
2005-03-16 15:57:00 +01:00
|
|
|
|
S_SET_DATA_TYPE (symbolS *sym, int val)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
Add support for storing local symbols in a small structure to save
memory when assembling large files.
* as.h: Don't include struc-symbol.h.
(symbolS): Add typedef.
* symbols.c: Include struc-symbol.h.
(local_hash): New static variable.
(save_symbol_name): New static function, from symbol_create.
(symbol_create): Call save_symbol_name.
(local_symbol_count): New static variable.
(local_symbol_conversion_count): Likewise.
(LOCAL_SYMBOL_CHECK): Define.
(local_symbol_make): New static function.
(local_symbol_convert): New static function.
(colon): Handle local symbols. Create local symbol for local
label name.
(symbol_table_insert): Handle local symbols.
(symbol_find_or_make): Create local symbol for local label name.
(symbol_find_base): Check for local symbol.
(symbol_append, symbol_insert): Check for local symbols.
(symbol_clear_list_pointers, symbol_remove): Likewise.
(verify_symbol_chain): Likewise.
(copy_symbol_attributes): Likewise.
(resolve_symbol_value): Handle local symbols.
(resolve_local_symbol): New static function.
(resolve_local_symbol_values): New function.
(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
(symbol_previous, symbol_next): New functions.
(symbol_get_value_expression): Likewise.
(symbol_set_value_expression): Likewise.
(symbol_set_frag, symbol_get_frag): Likewise.
(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
(symbol_mark_used_in_reloc): Likewise.
(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
(symbol_mri_common_p): Likewise.
(symbol_mark_written, symbol_clear_written): Likewise.
(symbol_written_p): Likewise.
(symbol_mark_resolved, symbol_resolved_p): Likewise.
(symbol_section_p, symbol_equated_p): Likewise.
(symbol_constant_p): Likewise.
(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
(symbol_get_obj, symbol_set_obj): Likewise.
(symbol_get_tc, symbol_set_tc): Likewise.
(symbol_begin): Initialize local_hash.
(print_symbol_value_1): Handle local symbols.
(symbol_print_statistics): Print local symbol statistics.
* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
Declare new symbols.c functions. Move many declarations here from
struc-symbol.h.
(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
(struct symbol): Move bsym to make it clearly the first field.
Remove TARGET_SYMBOL_FIELDS.
(symbolS): Don't typedef.
(struct broken_word): Remove.
(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
(symbol_clear_list_pointers): Likewise.
(symbol_insert, symbol_remove): Likewise.
(symbol_previous, symbol_append): Likewise.
(verify_symbol_chain, verify_symbol_chain_2): Likewise.
(struct local_symbol): Define.
(local_symbol_converted_p, local_symbol_mark_converted): Define.
(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
(local_symbol_get_frag, local_symbol_set_frag): Define.
(local_symbol_get_real_symbol): Define.
(local_symbol_set_real_symbol): Define.
Define.
* write.c (write_object_file): Call resolve_local_symbol_values.
* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-multi.h (struct elf_obj_sy): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
* config/tc-mcore.h: Don't include struc-symbol.h.
(TARGET_SYMBOL_FIELDS): Don't define.
(struct mcore_tc_sy): Define.
(TC_SYMFIELD_TYPE): Define.
* Many files: Use symbolS instead of struct symbol. Use new
accessor functions rather than referring to symbolS fields
directly.
* read.c (s_mri_common): Don't add in value of line_label.
* config/tc-mips.c (md_apply_fix): Correct parenthesization when
checking for SEC_LINK_ONCE.
* config/tc-sh.h (sh_fix_adjustable): Declare.
1999-06-03 02:29:48 +02:00
|
|
|
|
coffsymbol (symbol_get_bfdsym (sym))->native->u.syment.n_type = val;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
return val;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
2005-03-16 15:57:00 +01:00
|
|
|
|
S_GET_STORAGE_CLASS (symbolS *sym)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
Add support for storing local symbols in a small structure to save
memory when assembling large files.
* as.h: Don't include struc-symbol.h.
(symbolS): Add typedef.
* symbols.c: Include struc-symbol.h.
(local_hash): New static variable.
(save_symbol_name): New static function, from symbol_create.
(symbol_create): Call save_symbol_name.
(local_symbol_count): New static variable.
(local_symbol_conversion_count): Likewise.
(LOCAL_SYMBOL_CHECK): Define.
(local_symbol_make): New static function.
(local_symbol_convert): New static function.
(colon): Handle local symbols. Create local symbol for local
label name.
(symbol_table_insert): Handle local symbols.
(symbol_find_or_make): Create local symbol for local label name.
(symbol_find_base): Check for local symbol.
(symbol_append, symbol_insert): Check for local symbols.
(symbol_clear_list_pointers, symbol_remove): Likewise.
(verify_symbol_chain): Likewise.
(copy_symbol_attributes): Likewise.
(resolve_symbol_value): Handle local symbols.
(resolve_local_symbol): New static function.
(resolve_local_symbol_values): New function.
(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
(symbol_previous, symbol_next): New functions.
(symbol_get_value_expression): Likewise.
(symbol_set_value_expression): Likewise.
(symbol_set_frag, symbol_get_frag): Likewise.
(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
(symbol_mark_used_in_reloc): Likewise.
(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
(symbol_mri_common_p): Likewise.
(symbol_mark_written, symbol_clear_written): Likewise.
(symbol_written_p): Likewise.
(symbol_mark_resolved, symbol_resolved_p): Likewise.
(symbol_section_p, symbol_equated_p): Likewise.
(symbol_constant_p): Likewise.
(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
(symbol_get_obj, symbol_set_obj): Likewise.
(symbol_get_tc, symbol_set_tc): Likewise.
(symbol_begin): Initialize local_hash.
(print_symbol_value_1): Handle local symbols.
(symbol_print_statistics): Print local symbol statistics.
* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
Declare new symbols.c functions. Move many declarations here from
struc-symbol.h.
(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
(struct symbol): Move bsym to make it clearly the first field.
Remove TARGET_SYMBOL_FIELDS.
(symbolS): Don't typedef.
(struct broken_word): Remove.
(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
(symbol_clear_list_pointers): Likewise.
(symbol_insert, symbol_remove): Likewise.
(symbol_previous, symbol_append): Likewise.
(verify_symbol_chain, verify_symbol_chain_2): Likewise.
(struct local_symbol): Define.
(local_symbol_converted_p, local_symbol_mark_converted): Define.
(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
(local_symbol_get_frag, local_symbol_set_frag): Define.
(local_symbol_get_real_symbol): Define.
(local_symbol_set_real_symbol): Define.
Define.
* write.c (write_object_file): Call resolve_local_symbol_values.
* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-multi.h (struct elf_obj_sy): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
* config/tc-mcore.h: Don't include struc-symbol.h.
(TARGET_SYMBOL_FIELDS): Don't define.
(struct mcore_tc_sy): Define.
(TC_SYMFIELD_TYPE): Define.
* Many files: Use symbolS instead of struct symbol. Use new
accessor functions rather than referring to symbolS fields
directly.
* read.c (s_mri_common): Don't add in value of line_label.
* config/tc-mips.c (md_apply_fix): Correct parenthesization when
checking for SEC_LINK_ONCE.
* config/tc-sh.h (sh_fix_adjustable): Declare.
1999-06-03 02:29:48 +02:00
|
|
|
|
return coffsymbol (symbol_get_bfdsym (sym))->native->u.syment.n_sclass;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
2005-03-16 15:57:00 +01:00
|
|
|
|
S_SET_STORAGE_CLASS (symbolS *sym, int val)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
Add support for storing local symbols in a small structure to save
memory when assembling large files.
* as.h: Don't include struc-symbol.h.
(symbolS): Add typedef.
* symbols.c: Include struc-symbol.h.
(local_hash): New static variable.
(save_symbol_name): New static function, from symbol_create.
(symbol_create): Call save_symbol_name.
(local_symbol_count): New static variable.
(local_symbol_conversion_count): Likewise.
(LOCAL_SYMBOL_CHECK): Define.
(local_symbol_make): New static function.
(local_symbol_convert): New static function.
(colon): Handle local symbols. Create local symbol for local
label name.
(symbol_table_insert): Handle local symbols.
(symbol_find_or_make): Create local symbol for local label name.
(symbol_find_base): Check for local symbol.
(symbol_append, symbol_insert): Check for local symbols.
(symbol_clear_list_pointers, symbol_remove): Likewise.
(verify_symbol_chain): Likewise.
(copy_symbol_attributes): Likewise.
(resolve_symbol_value): Handle local symbols.
(resolve_local_symbol): New static function.
(resolve_local_symbol_values): New function.
(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
(symbol_previous, symbol_next): New functions.
(symbol_get_value_expression): Likewise.
(symbol_set_value_expression): Likewise.
(symbol_set_frag, symbol_get_frag): Likewise.
(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
(symbol_mark_used_in_reloc): Likewise.
(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
(symbol_mri_common_p): Likewise.
(symbol_mark_written, symbol_clear_written): Likewise.
(symbol_written_p): Likewise.
(symbol_mark_resolved, symbol_resolved_p): Likewise.
(symbol_section_p, symbol_equated_p): Likewise.
(symbol_constant_p): Likewise.
(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
(symbol_get_obj, symbol_set_obj): Likewise.
(symbol_get_tc, symbol_set_tc): Likewise.
(symbol_begin): Initialize local_hash.
(print_symbol_value_1): Handle local symbols.
(symbol_print_statistics): Print local symbol statistics.
* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
Declare new symbols.c functions. Move many declarations here from
struc-symbol.h.
(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
(struct symbol): Move bsym to make it clearly the first field.
Remove TARGET_SYMBOL_FIELDS.
(symbolS): Don't typedef.
(struct broken_word): Remove.
(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
(symbol_clear_list_pointers): Likewise.
(symbol_insert, symbol_remove): Likewise.
(symbol_previous, symbol_append): Likewise.
(verify_symbol_chain, verify_symbol_chain_2): Likewise.
(struct local_symbol): Define.
(local_symbol_converted_p, local_symbol_mark_converted): Define.
(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
(local_symbol_get_frag, local_symbol_set_frag): Define.
(local_symbol_get_real_symbol): Define.
(local_symbol_set_real_symbol): Define.
Define.
* write.c (write_object_file): Call resolve_local_symbol_values.
* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-multi.h (struct elf_obj_sy): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
* config/tc-mcore.h: Don't include struc-symbol.h.
(TARGET_SYMBOL_FIELDS): Don't define.
(struct mcore_tc_sy): Define.
(TC_SYMFIELD_TYPE): Define.
* Many files: Use symbolS instead of struct symbol. Use new
accessor functions rather than referring to symbolS fields
directly.
* read.c (s_mri_common): Don't add in value of line_label.
* config/tc-mips.c (md_apply_fix): Correct parenthesization when
checking for SEC_LINK_ONCE.
* config/tc-sh.h (sh_fix_adjustable): Declare.
1999-06-03 02:29:48 +02:00
|
|
|
|
coffsymbol (symbol_get_bfdsym (sym))->native->u.syment.n_sclass = val;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
return val;
|
|
|
|
|
}
|
|
|
|
|
|
2000-09-12 23:49:09 +02:00
|
|
|
|
/* Merge a debug symbol containing debug information into a normal symbol. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2005-03-16 15:57:00 +01:00
|
|
|
|
static void
|
|
|
|
|
c_symbol_merge (symbolS *debug, symbolS *normal)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
S_SET_DATA_TYPE (normal, S_GET_DATA_TYPE (debug));
|
|
|
|
|
S_SET_STORAGE_CLASS (normal, S_GET_STORAGE_CLASS (debug));
|
|
|
|
|
|
|
|
|
|
if (S_GET_NUMBER_AUXILIARY (debug) > S_GET_NUMBER_AUXILIARY (normal))
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* Take the most we have. */
|
|
|
|
|
S_SET_NUMBER_AUXILIARY (normal, S_GET_NUMBER_AUXILIARY (debug));
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
if (S_GET_NUMBER_AUXILIARY (debug) > 0)
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* Move all the auxiliary information. */
|
|
|
|
|
memcpy (SYM_AUXINFO (normal), SYM_AUXINFO (debug),
|
|
|
|
|
(S_GET_NUMBER_AUXILIARY (debug)
|
|
|
|
|
* sizeof (*SYM_AUXINFO (debug))));
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2000-09-12 23:49:09 +02:00
|
|
|
|
/* Move the debug flags. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
SF_SET_DEBUG_FIELD (normal, SF_GET_DEBUG_FIELD (debug));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2004-11-19 13:20:25 +01:00
|
|
|
|
c_dot_file_symbol (const char *filename, int appfile ATTRIBUTE_UNUSED)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
symbolS *symbolP;
|
|
|
|
|
|
1999-09-12 04:27:58 +02:00
|
|
|
|
/* BFD converts filename to a .file symbol with an aux entry. It
|
|
|
|
|
also handles chaining. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
symbolP = symbol_new (filename, bfd_abs_section_ptr, 0, &zero_address_frag);
|
|
|
|
|
|
|
|
|
|
S_SET_STORAGE_CLASS (symbolP, C_FILE);
|
|
|
|
|
S_SET_NUMBER_AUXILIARY (symbolP, 1);
|
|
|
|
|
|
Add support for storing local symbols in a small structure to save
memory when assembling large files.
* as.h: Don't include struc-symbol.h.
(symbolS): Add typedef.
* symbols.c: Include struc-symbol.h.
(local_hash): New static variable.
(save_symbol_name): New static function, from symbol_create.
(symbol_create): Call save_symbol_name.
(local_symbol_count): New static variable.
(local_symbol_conversion_count): Likewise.
(LOCAL_SYMBOL_CHECK): Define.
(local_symbol_make): New static function.
(local_symbol_convert): New static function.
(colon): Handle local symbols. Create local symbol for local
label name.
(symbol_table_insert): Handle local symbols.
(symbol_find_or_make): Create local symbol for local label name.
(symbol_find_base): Check for local symbol.
(symbol_append, symbol_insert): Check for local symbols.
(symbol_clear_list_pointers, symbol_remove): Likewise.
(verify_symbol_chain): Likewise.
(copy_symbol_attributes): Likewise.
(resolve_symbol_value): Handle local symbols.
(resolve_local_symbol): New static function.
(resolve_local_symbol_values): New function.
(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
(symbol_previous, symbol_next): New functions.
(symbol_get_value_expression): Likewise.
(symbol_set_value_expression): Likewise.
(symbol_set_frag, symbol_get_frag): Likewise.
(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
(symbol_mark_used_in_reloc): Likewise.
(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
(symbol_mri_common_p): Likewise.
(symbol_mark_written, symbol_clear_written): Likewise.
(symbol_written_p): Likewise.
(symbol_mark_resolved, symbol_resolved_p): Likewise.
(symbol_section_p, symbol_equated_p): Likewise.
(symbol_constant_p): Likewise.
(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
(symbol_get_obj, symbol_set_obj): Likewise.
(symbol_get_tc, symbol_set_tc): Likewise.
(symbol_begin): Initialize local_hash.
(print_symbol_value_1): Handle local symbols.
(symbol_print_statistics): Print local symbol statistics.
* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
Declare new symbols.c functions. Move many declarations here from
struc-symbol.h.
(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
(struct symbol): Move bsym to make it clearly the first field.
Remove TARGET_SYMBOL_FIELDS.
(symbolS): Don't typedef.
(struct broken_word): Remove.
(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
(symbol_clear_list_pointers): Likewise.
(symbol_insert, symbol_remove): Likewise.
(symbol_previous, symbol_append): Likewise.
(verify_symbol_chain, verify_symbol_chain_2): Likewise.
(struct local_symbol): Define.
(local_symbol_converted_p, local_symbol_mark_converted): Define.
(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
(local_symbol_get_frag, local_symbol_set_frag): Define.
(local_symbol_get_real_symbol): Define.
(local_symbol_set_real_symbol): Define.
Define.
* write.c (write_object_file): Call resolve_local_symbol_values.
* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-multi.h (struct elf_obj_sy): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
* config/tc-mcore.h: Don't include struc-symbol.h.
(TARGET_SYMBOL_FIELDS): Don't define.
(struct mcore_tc_sy): Define.
(TC_SYMFIELD_TYPE): Define.
* Many files: Use symbolS instead of struct symbol. Use new
accessor functions rather than referring to symbolS fields
directly.
* read.c (s_mri_common): Don't add in value of line_label.
* config/tc-mips.c (md_apply_fix): Correct parenthesization when
checking for SEC_LINK_ONCE.
* config/tc-sh.h (sh_fix_adjustable): Declare.
1999-06-03 02:29:48 +02:00
|
|
|
|
symbol_get_bfdsym (symbolP)->flags = BSF_DEBUGGING;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
#ifndef NO_LISTING
|
|
|
|
|
{
|
|
|
|
|
extern int listing;
|
2005-03-16 15:57:00 +01:00
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
if (listing)
|
2005-03-16 15:57:00 +01:00
|
|
|
|
listing_source_file (filename);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* Make sure that the symbol is first on the symbol chain. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
if (symbol_rootP != symbolP)
|
|
|
|
|
{
|
|
|
|
|
symbol_remove (symbolP, &symbol_rootP, &symbol_lastP);
|
|
|
|
|
symbol_insert (symbolP, symbol_rootP, &symbol_rootP, &symbol_lastP);
|
2005-03-16 15:57:00 +01:00
|
|
|
|
}
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
|
|
|
|
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* Line number handling. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2005-03-16 15:57:00 +01:00
|
|
|
|
struct line_no
|
|
|
|
|
{
|
1999-05-03 09:29:11 +02:00
|
|
|
|
struct line_no *next;
|
|
|
|
|
fragS *frag;
|
|
|
|
|
alent l;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
int coff_line_base;
|
|
|
|
|
|
|
|
|
|
/* Symbol of last function, which we should hang line#s off of. */
|
|
|
|
|
static symbolS *line_fsym;
|
|
|
|
|
|
|
|
|
|
#define in_function() (line_fsym != 0)
|
|
|
|
|
#define clear_function() (line_fsym = 0)
|
|
|
|
|
#define set_function(F) (line_fsym = (F), coff_add_linesym (F))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
coff_obj_symbol_new_hook (symbolS *symbolP)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
long sz = (OBJ_COFF_MAX_AUXENTRIES + 1) * sizeof (combined_entry_type);
|
2016-04-06 22:26:46 +02:00
|
|
|
|
char * s = XNEWVEC (char, sz);
|
2000-09-12 23:49:09 +02:00
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
memset (s, 0, sz);
|
Add support for storing local symbols in a small structure to save
memory when assembling large files.
* as.h: Don't include struc-symbol.h.
(symbolS): Add typedef.
* symbols.c: Include struc-symbol.h.
(local_hash): New static variable.
(save_symbol_name): New static function, from symbol_create.
(symbol_create): Call save_symbol_name.
(local_symbol_count): New static variable.
(local_symbol_conversion_count): Likewise.
(LOCAL_SYMBOL_CHECK): Define.
(local_symbol_make): New static function.
(local_symbol_convert): New static function.
(colon): Handle local symbols. Create local symbol for local
label name.
(symbol_table_insert): Handle local symbols.
(symbol_find_or_make): Create local symbol for local label name.
(symbol_find_base): Check for local symbol.
(symbol_append, symbol_insert): Check for local symbols.
(symbol_clear_list_pointers, symbol_remove): Likewise.
(verify_symbol_chain): Likewise.
(copy_symbol_attributes): Likewise.
(resolve_symbol_value): Handle local symbols.
(resolve_local_symbol): New static function.
(resolve_local_symbol_values): New function.
(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
(symbol_previous, symbol_next): New functions.
(symbol_get_value_expression): Likewise.
(symbol_set_value_expression): Likewise.
(symbol_set_frag, symbol_get_frag): Likewise.
(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
(symbol_mark_used_in_reloc): Likewise.
(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
(symbol_mri_common_p): Likewise.
(symbol_mark_written, symbol_clear_written): Likewise.
(symbol_written_p): Likewise.
(symbol_mark_resolved, symbol_resolved_p): Likewise.
(symbol_section_p, symbol_equated_p): Likewise.
(symbol_constant_p): Likewise.
(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
(symbol_get_obj, symbol_set_obj): Likewise.
(symbol_get_tc, symbol_set_tc): Likewise.
(symbol_begin): Initialize local_hash.
(print_symbol_value_1): Handle local symbols.
(symbol_print_statistics): Print local symbol statistics.
* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
Declare new symbols.c functions. Move many declarations here from
struc-symbol.h.
(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
(struct symbol): Move bsym to make it clearly the first field.
Remove TARGET_SYMBOL_FIELDS.
(symbolS): Don't typedef.
(struct broken_word): Remove.
(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
(symbol_clear_list_pointers): Likewise.
(symbol_insert, symbol_remove): Likewise.
(symbol_previous, symbol_append): Likewise.
(verify_symbol_chain, verify_symbol_chain_2): Likewise.
(struct local_symbol): Define.
(local_symbol_converted_p, local_symbol_mark_converted): Define.
(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
(local_symbol_get_frag, local_symbol_set_frag): Define.
(local_symbol_get_real_symbol): Define.
(local_symbol_set_real_symbol): Define.
Define.
* write.c (write_object_file): Call resolve_local_symbol_values.
* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-multi.h (struct elf_obj_sy): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
* config/tc-mcore.h: Don't include struc-symbol.h.
(TARGET_SYMBOL_FIELDS): Don't define.
(struct mcore_tc_sy): Define.
(TC_SYMFIELD_TYPE): Define.
* Many files: Use symbolS instead of struct symbol. Use new
accessor functions rather than referring to symbolS fields
directly.
* read.c (s_mri_common): Don't add in value of line_label.
* config/tc-mips.c (md_apply_fix): Correct parenthesization when
checking for SEC_LINK_ONCE.
* config/tc-sh.h (sh_fix_adjustable): Declare.
1999-06-03 02:29:48 +02:00
|
|
|
|
coffsymbol (symbol_get_bfdsym (symbolP))->native = (combined_entry_type *) s;
|
2014-11-13 18:46:11 +01:00
|
|
|
|
coffsymbol (symbol_get_bfdsym (symbolP))->native->is_sym = TRUE;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
S_SET_DATA_TYPE (symbolP, T_NULL);
|
|
|
|
|
S_SET_STORAGE_CLASS (symbolP, 0);
|
|
|
|
|
S_SET_NUMBER_AUXILIARY (symbolP, 0);
|
|
|
|
|
|
|
|
|
|
if (S_IS_STRING (symbolP))
|
|
|
|
|
SF_SET_STRING (symbolP);
|
2000-09-12 23:49:09 +02:00
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
if (S_IS_LOCAL (symbolP))
|
|
|
|
|
SF_SET_LOCAL (symbolP);
|
|
|
|
|
}
|
|
|
|
|
|
2005-10-27 09:40:07 +02:00
|
|
|
|
void
|
|
|
|
|
coff_obj_symbol_clone_hook (symbolS *newsymP, symbolS *orgsymP)
|
|
|
|
|
{
|
2016-04-06 22:26:46 +02:00
|
|
|
|
long elts = OBJ_COFF_MAX_AUXENTRIES + 1;
|
|
|
|
|
combined_entry_type * s = XNEWVEC (combined_entry_type, elts);
|
2005-10-27 09:40:07 +02:00
|
|
|
|
|
2016-04-06 22:26:46 +02:00
|
|
|
|
memcpy (s, coffsymbol (symbol_get_bfdsym (orgsymP))->native,
|
|
|
|
|
elts * sizeof (combined_entry_type));
|
2005-10-27 09:40:07 +02:00
|
|
|
|
coffsymbol (symbol_get_bfdsym (newsymP))->native = s;
|
|
|
|
|
|
|
|
|
|
SF_SET (newsymP, SF_GET (orgsymP));
|
|
|
|
|
}
|
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* Handle .ln directives. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
static symbolS *current_lineno_sym;
|
|
|
|
|
static struct line_no *line_nos;
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* FIXME: Blindly assume all .ln directives will be in the .text section. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
int coff_n_line_nos;
|
|
|
|
|
|
|
|
|
|
static void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
add_lineno (fragS * frag, addressT offset, int num)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
2016-04-06 22:26:46 +02:00
|
|
|
|
struct line_no * new_line = XNEW (struct line_no);
|
2005-03-16 15:57:00 +01:00
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
if (!current_lineno_sym)
|
2005-03-16 15:57:00 +01:00
|
|
|
|
abort ();
|
2001-05-24 23:39:09 +02:00
|
|
|
|
|
|
|
|
|
#ifndef OBJ_XCOFF
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* The native aix assembler accepts negative line number. */
|
2001-05-24 23:39:09 +02:00
|
|
|
|
|
2000-09-12 23:49:09 +02:00
|
|
|
|
if (num <= 0)
|
1999-09-12 04:34:00 +02:00
|
|
|
|
{
|
|
|
|
|
/* Zero is used as an end marker in the file. */
|
2000-02-22 08:50:13 +01:00
|
|
|
|
as_warn (_("Line numbers must be positive integers\n"));
|
|
|
|
|
num = 1;
|
1999-09-12 04:34:00 +02:00
|
|
|
|
}
|
2001-05-24 23:39:09 +02:00
|
|
|
|
#endif /* OBJ_XCOFF */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
new_line->next = line_nos;
|
|
|
|
|
new_line->frag = frag;
|
|
|
|
|
new_line->l.line_number = num;
|
|
|
|
|
new_line->l.u.offset = offset;
|
|
|
|
|
line_nos = new_line;
|
|
|
|
|
coff_n_line_nos++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
coff_add_linesym (symbolS *sym)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
if (line_nos)
|
|
|
|
|
{
|
Add support for storing local symbols in a small structure to save
memory when assembling large files.
* as.h: Don't include struc-symbol.h.
(symbolS): Add typedef.
* symbols.c: Include struc-symbol.h.
(local_hash): New static variable.
(save_symbol_name): New static function, from symbol_create.
(symbol_create): Call save_symbol_name.
(local_symbol_count): New static variable.
(local_symbol_conversion_count): Likewise.
(LOCAL_SYMBOL_CHECK): Define.
(local_symbol_make): New static function.
(local_symbol_convert): New static function.
(colon): Handle local symbols. Create local symbol for local
label name.
(symbol_table_insert): Handle local symbols.
(symbol_find_or_make): Create local symbol for local label name.
(symbol_find_base): Check for local symbol.
(symbol_append, symbol_insert): Check for local symbols.
(symbol_clear_list_pointers, symbol_remove): Likewise.
(verify_symbol_chain): Likewise.
(copy_symbol_attributes): Likewise.
(resolve_symbol_value): Handle local symbols.
(resolve_local_symbol): New static function.
(resolve_local_symbol_values): New function.
(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
(symbol_previous, symbol_next): New functions.
(symbol_get_value_expression): Likewise.
(symbol_set_value_expression): Likewise.
(symbol_set_frag, symbol_get_frag): Likewise.
(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
(symbol_mark_used_in_reloc): Likewise.
(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
(symbol_mri_common_p): Likewise.
(symbol_mark_written, symbol_clear_written): Likewise.
(symbol_written_p): Likewise.
(symbol_mark_resolved, symbol_resolved_p): Likewise.
(symbol_section_p, symbol_equated_p): Likewise.
(symbol_constant_p): Likewise.
(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
(symbol_get_obj, symbol_set_obj): Likewise.
(symbol_get_tc, symbol_set_tc): Likewise.
(symbol_begin): Initialize local_hash.
(print_symbol_value_1): Handle local symbols.
(symbol_print_statistics): Print local symbol statistics.
* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
Declare new symbols.c functions. Move many declarations here from
struc-symbol.h.
(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
(struct symbol): Move bsym to make it clearly the first field.
Remove TARGET_SYMBOL_FIELDS.
(symbolS): Don't typedef.
(struct broken_word): Remove.
(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
(symbol_clear_list_pointers): Likewise.
(symbol_insert, symbol_remove): Likewise.
(symbol_previous, symbol_append): Likewise.
(verify_symbol_chain, verify_symbol_chain_2): Likewise.
(struct local_symbol): Define.
(local_symbol_converted_p, local_symbol_mark_converted): Define.
(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
(local_symbol_get_frag, local_symbol_set_frag): Define.
(local_symbol_get_real_symbol): Define.
(local_symbol_set_real_symbol): Define.
Define.
* write.c (write_object_file): Call resolve_local_symbol_values.
* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-multi.h (struct elf_obj_sy): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
* config/tc-mcore.h: Don't include struc-symbol.h.
(TARGET_SYMBOL_FIELDS): Don't define.
(struct mcore_tc_sy): Define.
(TC_SYMFIELD_TYPE): Define.
* Many files: Use symbolS instead of struct symbol. Use new
accessor functions rather than referring to symbolS fields
directly.
* read.c (s_mri_common): Don't add in value of line_label.
* config/tc-mips.c (md_apply_fix): Correct parenthesization when
checking for SEC_LINK_ONCE.
* config/tc-sh.h (sh_fix_adjustable): Declare.
1999-06-03 02:29:48 +02:00
|
|
|
|
coffsymbol (symbol_get_bfdsym (current_lineno_sym))->lineno =
|
|
|
|
|
(alent *) line_nos;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
coff_n_line_nos++;
|
|
|
|
|
line_nos = 0;
|
|
|
|
|
}
|
|
|
|
|
current_lineno_sym = sym;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
obj_coff_ln (int appline)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
int l;
|
|
|
|
|
|
|
|
|
|
if (! appline && def_symbol_in_progress != NULL)
|
|
|
|
|
{
|
|
|
|
|
as_warn (_(".ln pseudo-op inside .def/.endef: ignored."));
|
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
l = get_absolute_expression ();
|
|
|
|
|
|
2001-06-30 12:09:40 +02:00
|
|
|
|
/* If there is no lineno symbol, treat a .ln
|
|
|
|
|
directive as if it were a .appline directive. */
|
|
|
|
|
if (appline || current_lineno_sym == NULL)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
new_logical_line ((char *) NULL, l - 1);
|
2001-06-30 12:09:40 +02:00
|
|
|
|
else
|
|
|
|
|
add_lineno (frag_now, frag_now_fix (), l);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
#ifndef NO_LISTING
|
|
|
|
|
{
|
|
|
|
|
extern int listing;
|
|
|
|
|
|
|
|
|
|
if (listing)
|
|
|
|
|
{
|
|
|
|
|
if (! appline)
|
|
|
|
|
l += coff_line_base - 1;
|
|
|
|
|
listing_source_line (l);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
}
|
|
|
|
|
|
1999-09-12 04:39:52 +02:00
|
|
|
|
/* .loc is essentially the same as .ln; parse it for assembler
|
|
|
|
|
compatibility. */
|
|
|
|
|
|
|
|
|
|
static void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
obj_coff_loc (int ignore ATTRIBUTE_UNUSED)
|
1999-09-12 04:39:52 +02:00
|
|
|
|
{
|
|
|
|
|
int lineno;
|
|
|
|
|
|
|
|
|
|
/* FIXME: Why do we need this check? We need it for ECOFF, but why
|
|
|
|
|
do we need it for COFF? */
|
|
|
|
|
if (now_seg != text_section)
|
|
|
|
|
{
|
|
|
|
|
as_warn (_(".loc outside of .text"));
|
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (def_symbol_in_progress != NULL)
|
|
|
|
|
{
|
|
|
|
|
as_warn (_(".loc pseudo-op inside .def/.endef: ignored."));
|
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Skip the file number. */
|
|
|
|
|
SKIP_WHITESPACE ();
|
|
|
|
|
get_absolute_expression ();
|
|
|
|
|
SKIP_WHITESPACE ();
|
|
|
|
|
|
|
|
|
|
lineno = get_absolute_expression ();
|
|
|
|
|
|
|
|
|
|
#ifndef NO_LISTING
|
|
|
|
|
{
|
|
|
|
|
extern int listing;
|
|
|
|
|
|
|
|
|
|
if (listing)
|
|
|
|
|
{
|
2002-05-09 15:12:57 +02:00
|
|
|
|
lineno += coff_line_base - 1;
|
1999-09-12 04:39:52 +02:00
|
|
|
|
listing_source_line (lineno);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
|
|
|
|
|
add_lineno (frag_now, frag_now_fix (), lineno);
|
|
|
|
|
}
|
|
|
|
|
|
1999-09-12 05:07:49 +02:00
|
|
|
|
/* Handle the .ident pseudo-op. */
|
|
|
|
|
|
|
|
|
|
static void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
obj_coff_ident (int ignore ATTRIBUTE_UNUSED)
|
1999-09-12 05:07:49 +02:00
|
|
|
|
{
|
|
|
|
|
segT current_seg = now_seg;
|
|
|
|
|
subsegT current_subseg = now_subseg;
|
|
|
|
|
|
|
|
|
|
#ifdef TE_PE
|
|
|
|
|
{
|
|
|
|
|
segT sec;
|
|
|
|
|
|
|
|
|
|
/* We could put it in .comment, but that creates an extra section
|
|
|
|
|
that shouldn't be loaded into memory, which requires linker
|
|
|
|
|
changes... For now, until proven otherwise, use .rdata. */
|
|
|
|
|
sec = subseg_new (".rdata$zzz", 0);
|
|
|
|
|
bfd_set_section_flags (stdoutput, sec,
|
|
|
|
|
((SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA)
|
|
|
|
|
& bfd_applicable_section_flags (stdoutput)));
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
subseg_new (".comment", 0);
|
|
|
|
|
#endif
|
|
|
|
|
|
2007-10-04 19:05:37 +02:00
|
|
|
|
stringer (8 + 1);
|
1999-09-12 05:07:49 +02:00
|
|
|
|
subseg_set (current_seg, current_subseg);
|
|
|
|
|
}
|
|
|
|
|
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* Handle .def directives.
|
|
|
|
|
|
|
|
|
|
One might ask : why can't we symbol_new if the symbol does not
|
|
|
|
|
already exist and fill it with debug information. Because of
|
|
|
|
|
the C_EFCN special symbol. It would clobber the value of the
|
|
|
|
|
function symbol before we have a chance to notice that it is
|
|
|
|
|
a C_EFCN. And a second reason is that the code is more clear this
|
|
|
|
|
way. (at least I think it is :-). */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
#define SKIP_SEMI_COLON() while (*input_line_pointer++ != ';')
|
|
|
|
|
#define SKIP_WHITESPACES() while (*input_line_pointer == ' ' || \
|
2005-03-16 15:57:00 +01:00
|
|
|
|
*input_line_pointer == '\t') \
|
|
|
|
|
input_line_pointer++;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
static void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
obj_coff_def (int what ATTRIBUTE_UNUSED)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
2005-03-16 15:57:00 +01:00
|
|
|
|
char name_end; /* Char after the end of name. */
|
|
|
|
|
char *symbol_name; /* Name of the debug symbol. */
|
|
|
|
|
char *symbol_name_copy; /* Temporary copy of the name. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
if (def_symbol_in_progress != NULL)
|
|
|
|
|
{
|
|
|
|
|
as_warn (_(".def pseudo-op used inside of .def/.endef: ignored."));
|
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
return;
|
2005-03-16 15:57:00 +01:00
|
|
|
|
}
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
SKIP_WHITESPACES ();
|
|
|
|
|
|
2015-08-21 17:42:14 +02:00
|
|
|
|
name_end = get_symbol_name (&symbol_name);
|
2016-03-28 11:49:15 +02:00
|
|
|
|
symbol_name_copy = xstrdup (symbol_name);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
#ifdef tc_canonicalize_symbol_name
|
|
|
|
|
symbol_name_copy = tc_canonicalize_symbol_name (symbol_name_copy);
|
|
|
|
|
#endif
|
|
|
|
|
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* Initialize the new symbol. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
def_symbol_in_progress = symbol_make (symbol_name_copy);
|
Add support for storing local symbols in a small structure to save
memory when assembling large files.
* as.h: Don't include struc-symbol.h.
(symbolS): Add typedef.
* symbols.c: Include struc-symbol.h.
(local_hash): New static variable.
(save_symbol_name): New static function, from symbol_create.
(symbol_create): Call save_symbol_name.
(local_symbol_count): New static variable.
(local_symbol_conversion_count): Likewise.
(LOCAL_SYMBOL_CHECK): Define.
(local_symbol_make): New static function.
(local_symbol_convert): New static function.
(colon): Handle local symbols. Create local symbol for local
label name.
(symbol_table_insert): Handle local symbols.
(symbol_find_or_make): Create local symbol for local label name.
(symbol_find_base): Check for local symbol.
(symbol_append, symbol_insert): Check for local symbols.
(symbol_clear_list_pointers, symbol_remove): Likewise.
(verify_symbol_chain): Likewise.
(copy_symbol_attributes): Likewise.
(resolve_symbol_value): Handle local symbols.
(resolve_local_symbol): New static function.
(resolve_local_symbol_values): New function.
(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
(symbol_previous, symbol_next): New functions.
(symbol_get_value_expression): Likewise.
(symbol_set_value_expression): Likewise.
(symbol_set_frag, symbol_get_frag): Likewise.
(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
(symbol_mark_used_in_reloc): Likewise.
(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
(symbol_mri_common_p): Likewise.
(symbol_mark_written, symbol_clear_written): Likewise.
(symbol_written_p): Likewise.
(symbol_mark_resolved, symbol_resolved_p): Likewise.
(symbol_section_p, symbol_equated_p): Likewise.
(symbol_constant_p): Likewise.
(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
(symbol_get_obj, symbol_set_obj): Likewise.
(symbol_get_tc, symbol_set_tc): Likewise.
(symbol_begin): Initialize local_hash.
(print_symbol_value_1): Handle local symbols.
(symbol_print_statistics): Print local symbol statistics.
* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
Declare new symbols.c functions. Move many declarations here from
struc-symbol.h.
(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
(struct symbol): Move bsym to make it clearly the first field.
Remove TARGET_SYMBOL_FIELDS.
(symbolS): Don't typedef.
(struct broken_word): Remove.
(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
(symbol_clear_list_pointers): Likewise.
(symbol_insert, symbol_remove): Likewise.
(symbol_previous, symbol_append): Likewise.
(verify_symbol_chain, verify_symbol_chain_2): Likewise.
(struct local_symbol): Define.
(local_symbol_converted_p, local_symbol_mark_converted): Define.
(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
(local_symbol_get_frag, local_symbol_set_frag): Define.
(local_symbol_get_real_symbol): Define.
(local_symbol_set_real_symbol): Define.
Define.
* write.c (write_object_file): Call resolve_local_symbol_values.
* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-multi.h (struct elf_obj_sy): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
* config/tc-mcore.h: Don't include struc-symbol.h.
(TARGET_SYMBOL_FIELDS): Don't define.
(struct mcore_tc_sy): Define.
(TC_SYMFIELD_TYPE): Define.
* Many files: Use symbolS instead of struct symbol. Use new
accessor functions rather than referring to symbolS fields
directly.
* read.c (s_mri_common): Don't add in value of line_label.
* config/tc-mips.c (md_apply_fix): Correct parenthesization when
checking for SEC_LINK_ONCE.
* config/tc-sh.h (sh_fix_adjustable): Declare.
1999-06-03 02:29:48 +02:00
|
|
|
|
symbol_set_frag (def_symbol_in_progress, &zero_address_frag);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
S_SET_VALUE (def_symbol_in_progress, 0);
|
|
|
|
|
|
|
|
|
|
if (S_IS_STRING (def_symbol_in_progress))
|
|
|
|
|
SF_SET_STRING (def_symbol_in_progress);
|
|
|
|
|
|
2015-08-21 17:42:14 +02:00
|
|
|
|
(void) restore_line_pointer (name_end);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
obj_coff_endef (int ignore ATTRIBUTE_UNUSED)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
2000-06-30 01:54:13 +02:00
|
|
|
|
symbolS *symbolP = NULL;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
if (def_symbol_in_progress == NULL)
|
|
|
|
|
{
|
|
|
|
|
as_warn (_(".endef pseudo-op used outside of .def/.endef: ignored."));
|
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
return;
|
2005-03-16 15:57:00 +01:00
|
|
|
|
}
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2000-09-12 23:49:09 +02:00
|
|
|
|
/* Set the section number according to storage class. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
switch (S_GET_STORAGE_CLASS (def_symbol_in_progress))
|
|
|
|
|
{
|
|
|
|
|
case C_STRTAG:
|
|
|
|
|
case C_ENTAG:
|
|
|
|
|
case C_UNTAG:
|
|
|
|
|
SF_SET_TAG (def_symbol_in_progress);
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* Fall through. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
case C_FILE:
|
|
|
|
|
case C_TPDEF:
|
|
|
|
|
SF_SET_DEBUG (def_symbol_in_progress);
|
|
|
|
|
S_SET_SEGMENT (def_symbol_in_progress, fetch_coff_debug_section ());
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case C_EFCN:
|
2000-09-12 23:49:09 +02:00
|
|
|
|
SF_SET_LOCAL (def_symbol_in_progress); /* Do not emit this symbol. */
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* Fall through. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
case C_BLOCK:
|
2005-03-16 15:57:00 +01:00
|
|
|
|
SF_SET_PROCESS (def_symbol_in_progress); /* Will need processing before writing. */
|
|
|
|
|
/* Fall through. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
case C_FCN:
|
|
|
|
|
{
|
2002-06-08 09:37:16 +02:00
|
|
|
|
const char *name;
|
2005-03-16 15:57:00 +01:00
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
S_SET_SEGMENT (def_symbol_in_progress, text_section);
|
|
|
|
|
|
Add support for storing local symbols in a small structure to save
memory when assembling large files.
* as.h: Don't include struc-symbol.h.
(symbolS): Add typedef.
* symbols.c: Include struc-symbol.h.
(local_hash): New static variable.
(save_symbol_name): New static function, from symbol_create.
(symbol_create): Call save_symbol_name.
(local_symbol_count): New static variable.
(local_symbol_conversion_count): Likewise.
(LOCAL_SYMBOL_CHECK): Define.
(local_symbol_make): New static function.
(local_symbol_convert): New static function.
(colon): Handle local symbols. Create local symbol for local
label name.
(symbol_table_insert): Handle local symbols.
(symbol_find_or_make): Create local symbol for local label name.
(symbol_find_base): Check for local symbol.
(symbol_append, symbol_insert): Check for local symbols.
(symbol_clear_list_pointers, symbol_remove): Likewise.
(verify_symbol_chain): Likewise.
(copy_symbol_attributes): Likewise.
(resolve_symbol_value): Handle local symbols.
(resolve_local_symbol): New static function.
(resolve_local_symbol_values): New function.
(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
(symbol_previous, symbol_next): New functions.
(symbol_get_value_expression): Likewise.
(symbol_set_value_expression): Likewise.
(symbol_set_frag, symbol_get_frag): Likewise.
(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
(symbol_mark_used_in_reloc): Likewise.
(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
(symbol_mri_common_p): Likewise.
(symbol_mark_written, symbol_clear_written): Likewise.
(symbol_written_p): Likewise.
(symbol_mark_resolved, symbol_resolved_p): Likewise.
(symbol_section_p, symbol_equated_p): Likewise.
(symbol_constant_p): Likewise.
(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
(symbol_get_obj, symbol_set_obj): Likewise.
(symbol_get_tc, symbol_set_tc): Likewise.
(symbol_begin): Initialize local_hash.
(print_symbol_value_1): Handle local symbols.
(symbol_print_statistics): Print local symbol statistics.
* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
Declare new symbols.c functions. Move many declarations here from
struc-symbol.h.
(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
(struct symbol): Move bsym to make it clearly the first field.
Remove TARGET_SYMBOL_FIELDS.
(symbolS): Don't typedef.
(struct broken_word): Remove.
(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
(symbol_clear_list_pointers): Likewise.
(symbol_insert, symbol_remove): Likewise.
(symbol_previous, symbol_append): Likewise.
(verify_symbol_chain, verify_symbol_chain_2): Likewise.
(struct local_symbol): Define.
(local_symbol_converted_p, local_symbol_mark_converted): Define.
(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
(local_symbol_get_frag, local_symbol_set_frag): Define.
(local_symbol_get_real_symbol): Define.
(local_symbol_set_real_symbol): Define.
Define.
* write.c (write_object_file): Call resolve_local_symbol_values.
* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-multi.h (struct elf_obj_sy): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
* config/tc-mcore.h: Don't include struc-symbol.h.
(TARGET_SYMBOL_FIELDS): Don't define.
(struct mcore_tc_sy): Define.
(TC_SYMFIELD_TYPE): Define.
* Many files: Use symbolS instead of struct symbol. Use new
accessor functions rather than referring to symbolS fields
directly.
* read.c (s_mri_common): Don't add in value of line_label.
* config/tc-mips.c (md_apply_fix): Correct parenthesization when
checking for SEC_LINK_ONCE.
* config/tc-sh.h (sh_fix_adjustable): Declare.
1999-06-03 02:29:48 +02:00
|
|
|
|
name = S_GET_NAME (def_symbol_in_progress);
|
1999-09-12 04:49:28 +02:00
|
|
|
|
if (name[0] == '.' && name[2] == 'f' && name[3] == '\0')
|
2002-05-09 15:12:57 +02:00
|
|
|
|
{
|
1999-09-12 04:49:28 +02:00
|
|
|
|
switch (name[1])
|
|
|
|
|
{
|
2000-09-12 23:49:09 +02:00
|
|
|
|
case 'b':
|
1999-09-12 04:49:28 +02:00
|
|
|
|
/* .bf */
|
|
|
|
|
if (! in_function ())
|
|
|
|
|
as_warn (_("`%s' symbol without preceding function"), name);
|
|
|
|
|
/* Will need relocating. */
|
|
|
|
|
SF_SET_PROCESS (def_symbol_in_progress);
|
|
|
|
|
clear_function ();
|
|
|
|
|
break;
|
|
|
|
|
#ifdef TE_PE
|
2000-09-12 23:49:09 +02:00
|
|
|
|
case 'e':
|
1999-09-12 04:49:28 +02:00
|
|
|
|
/* .ef */
|
|
|
|
|
/* The MS compilers output the actual endline, not the
|
|
|
|
|
function-relative one... we want to match without
|
|
|
|
|
changing the assembler input. */
|
2000-09-12 23:49:09 +02:00
|
|
|
|
SA_SET_SYM_LNNO (def_symbol_in_progress,
|
1999-09-12 04:49:28 +02:00
|
|
|
|
(SA_GET_SYM_LNNO (def_symbol_in_progress)
|
|
|
|
|
+ coff_line_base));
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
#ifdef C_AUTOARG
|
|
|
|
|
case C_AUTOARG:
|
|
|
|
|
#endif /* C_AUTOARG */
|
|
|
|
|
case C_AUTO:
|
|
|
|
|
case C_REG:
|
|
|
|
|
case C_ARG:
|
|
|
|
|
case C_REGPARM:
|
|
|
|
|
case C_FIELD:
|
2000-08-22 21:14:32 +02:00
|
|
|
|
|
|
|
|
|
/* According to the COFF documentation:
|
|
|
|
|
|
|
|
|
|
http://osr5doc.sco.com:1996/topics/COFF_SectNumFld.html
|
|
|
|
|
|
|
|
|
|
A special section number (-2) marks symbolic debugging symbols,
|
|
|
|
|
including structure/union/enumeration tag names, typedefs, and
|
2000-09-12 23:49:09 +02:00
|
|
|
|
the name of the file. A section number of -1 indicates that the
|
2000-08-22 21:14:32 +02:00
|
|
|
|
symbol has a value but is not relocatable. Examples of
|
2000-09-12 23:49:09 +02:00
|
|
|
|
absolute-valued symbols include automatic and register variables,
|
|
|
|
|
function arguments, and .eos symbols.
|
2000-08-22 21:14:32 +02:00
|
|
|
|
|
|
|
|
|
But from Ian Lance Taylor:
|
|
|
|
|
|
|
|
|
|
http://sources.redhat.com/ml/binutils/2000-08/msg00202.html
|
|
|
|
|
|
|
|
|
|
the actual tools all marked them as section -1. So the GNU COFF
|
|
|
|
|
assembler follows historical COFF assemblers.
|
|
|
|
|
|
|
|
|
|
However, it causes problems for djgpp
|
|
|
|
|
|
|
|
|
|
http://sources.redhat.com/ml/binutils/2000-08/msg00210.html
|
|
|
|
|
|
|
|
|
|
By defining STRICTCOFF, a COFF port can make the assembler to
|
2000-09-12 23:49:09 +02:00
|
|
|
|
follow the documented behavior. */
|
2000-08-22 21:14:32 +02:00
|
|
|
|
#ifdef STRICTCOFF
|
1999-05-03 09:29:11 +02:00
|
|
|
|
case C_MOS:
|
|
|
|
|
case C_MOE:
|
|
|
|
|
case C_MOU:
|
|
|
|
|
case C_EOS:
|
2000-08-22 21:14:32 +02:00
|
|
|
|
#endif
|
2000-08-14 21:41:40 +02:00
|
|
|
|
SF_SET_DEBUG (def_symbol_in_progress);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
S_SET_SEGMENT (def_symbol_in_progress, absolute_section);
|
|
|
|
|
break;
|
|
|
|
|
|
2000-08-22 21:14:32 +02:00
|
|
|
|
#ifndef STRICTCOFF
|
|
|
|
|
case C_MOS:
|
|
|
|
|
case C_MOE:
|
|
|
|
|
case C_MOU:
|
|
|
|
|
case C_EOS:
|
|
|
|
|
S_SET_SEGMENT (def_symbol_in_progress, absolute_section);
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
case C_EXT:
|
|
|
|
|
case C_WEAKEXT:
|
|
|
|
|
#ifdef TE_PE
|
|
|
|
|
case C_NT_WEAK:
|
|
|
|
|
#endif
|
|
|
|
|
case C_STAT:
|
|
|
|
|
case C_LABEL:
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* Valid but set somewhere else (s_comm, s_lcomm, colon). */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
case C_USTATIC:
|
|
|
|
|
case C_EXTDEF:
|
|
|
|
|
case C_ULABEL:
|
|
|
|
|
as_warn (_("unexpected storage class %d"),
|
|
|
|
|
S_GET_STORAGE_CLASS (def_symbol_in_progress));
|
|
|
|
|
break;
|
2005-03-16 15:57:00 +01:00
|
|
|
|
}
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* Now that we have built a debug symbol, try to find if we should
|
|
|
|
|
merge with an existing symbol or not. If a symbol is C_EFCN or
|
1999-09-12 04:55:58 +02:00
|
|
|
|
absolute_section or untagged SEG_DEBUG it never merges. We also
|
|
|
|
|
don't merge labels, which are in a different namespace, nor
|
|
|
|
|
symbols which have not yet been defined since they are typically
|
|
|
|
|
unique, nor do we merge tags with non-tags. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* Two cases for functions. Either debug followed by definition or
|
|
|
|
|
definition followed by debug. For definition first, we will
|
|
|
|
|
merge the debug symbol into the definition. For debug first, the
|
|
|
|
|
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
|
2000-09-12 23:49:09 +02:00
|
|
|
|
the debug symbol is a real function reference. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* FIXME-SOON If for some reason the definition label/symbol is
|
|
|
|
|
never seen, this will probably leave an undefined symbol at link
|
2000-09-12 23:49:09 +02:00
|
|
|
|
time. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
if (S_GET_STORAGE_CLASS (def_symbol_in_progress) == C_EFCN
|
1999-09-12 04:55:58 +02:00
|
|
|
|
|| S_GET_STORAGE_CLASS (def_symbol_in_progress) == C_LABEL
|
2005-03-16 15:57:00 +01:00
|
|
|
|
|| (streq (bfd_get_section_name (stdoutput,
|
|
|
|
|
S_GET_SEGMENT (def_symbol_in_progress)),
|
|
|
|
|
"*DEBUG*")
|
1999-05-03 09:29:11 +02:00
|
|
|
|
&& !SF_GET_TAG (def_symbol_in_progress))
|
|
|
|
|
|| S_GET_SEGMENT (def_symbol_in_progress) == absolute_section
|
1999-09-12 04:55:58 +02:00
|
|
|
|
|| ! symbol_constant_p (def_symbol_in_progress)
|
2005-04-19 17:05:09 +02:00
|
|
|
|
|| (symbolP = symbol_find (S_GET_NAME (def_symbol_in_progress))) == NULL
|
1999-09-12 04:55:58 +02:00
|
|
|
|
|| SF_GET_TAG (def_symbol_in_progress) != SF_GET_TAG (symbolP))
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
1999-09-12 04:55:58 +02:00
|
|
|
|
/* If it already is at the end of the symbol list, do nothing */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
if (def_symbol_in_progress != symbol_lastP)
|
2002-05-09 15:12:57 +02:00
|
|
|
|
{
|
1999-09-12 04:55:58 +02:00
|
|
|
|
symbol_remove (def_symbol_in_progress, &symbol_rootP, &symbol_lastP);
|
|
|
|
|
symbol_append (def_symbol_in_progress, symbol_lastP, &symbol_rootP,
|
|
|
|
|
&symbol_lastP);
|
2002-05-09 15:12:57 +02:00
|
|
|
|
}
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* This symbol already exists, merge the newly created symbol
|
|
|
|
|
into the old one. This is not mandatory. The linker can
|
|
|
|
|
handle duplicate symbols correctly. But I guess that it save
|
|
|
|
|
a *lot* of space if the assembly file defines a lot of
|
2005-03-16 15:57:00 +01:00
|
|
|
|
symbols. [loic] */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* The debug entry (def_symbol_in_progress) is merged into the
|
2000-09-12 23:49:09 +02:00
|
|
|
|
previous definition. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
c_symbol_merge (def_symbol_in_progress, symbolP);
|
|
|
|
|
symbol_remove (def_symbol_in_progress, &symbol_rootP, &symbol_lastP);
|
|
|
|
|
|
|
|
|
|
def_symbol_in_progress = symbolP;
|
|
|
|
|
|
|
|
|
|
if (SF_GET_FUNCTION (def_symbol_in_progress)
|
|
|
|
|
|| SF_GET_TAG (def_symbol_in_progress)
|
|
|
|
|
|| S_GET_STORAGE_CLASS (def_symbol_in_progress) == C_STAT)
|
|
|
|
|
{
|
|
|
|
|
/* For functions, and tags, and static symbols, the symbol
|
|
|
|
|
*must* be where the debug symbol appears. Move the
|
2000-09-12 23:49:09 +02:00
|
|
|
|
existing symbol to the current place. */
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* If it already is at the end of the symbol list, do nothing. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
if (def_symbol_in_progress != symbol_lastP)
|
|
|
|
|
{
|
|
|
|
|
symbol_remove (def_symbol_in_progress, &symbol_rootP, &symbol_lastP);
|
|
|
|
|
symbol_append (def_symbol_in_progress, symbol_lastP, &symbol_rootP, &symbol_lastP);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (SF_GET_TAG (def_symbol_in_progress))
|
|
|
|
|
{
|
|
|
|
|
symbolS *oldtag;
|
|
|
|
|
|
2005-04-19 17:05:09 +02:00
|
|
|
|
oldtag = symbol_find (S_GET_NAME (def_symbol_in_progress));
|
1999-05-03 09:29:11 +02:00
|
|
|
|
if (oldtag == NULL || ! SF_GET_TAG (oldtag))
|
|
|
|
|
tag_insert (S_GET_NAME (def_symbol_in_progress),
|
|
|
|
|
def_symbol_in_progress);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (SF_GET_FUNCTION (def_symbol_in_progress))
|
|
|
|
|
{
|
|
|
|
|
set_function (def_symbol_in_progress);
|
|
|
|
|
SF_SET_PROCESS (def_symbol_in_progress);
|
|
|
|
|
|
|
|
|
|
if (symbolP == NULL)
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* That is, if this is the first time we've seen the
|
|
|
|
|
function. */
|
|
|
|
|
symbol_table_insert (def_symbol_in_progress);
|
|
|
|
|
|
|
|
|
|
}
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
def_symbol_in_progress = NULL;
|
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
obj_coff_dim (int ignore ATTRIBUTE_UNUSED)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
2009-12-11 14:42:17 +01:00
|
|
|
|
int d_index;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
if (def_symbol_in_progress == NULL)
|
|
|
|
|
{
|
|
|
|
|
as_warn (_(".dim pseudo-op used outside of .def/.endef: ignored."));
|
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
return;
|
2005-03-16 15:57:00 +01:00
|
|
|
|
}
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
S_SET_NUMBER_AUXILIARY (def_symbol_in_progress, 1);
|
|
|
|
|
|
2009-12-11 14:42:17 +01:00
|
|
|
|
for (d_index = 0; d_index < DIMNUM; d_index++)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
SKIP_WHITESPACES ();
|
2009-12-11 14:42:17 +01:00
|
|
|
|
SA_SET_SYM_DIMEN (def_symbol_in_progress, d_index,
|
1999-05-03 09:29:11 +02:00
|
|
|
|
get_absolute_expression ());
|
|
|
|
|
|
|
|
|
|
switch (*input_line_pointer)
|
|
|
|
|
{
|
|
|
|
|
case ',':
|
|
|
|
|
input_line_pointer++;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
as_warn (_("badly formed .dim directive ignored"));
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* Fall through. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
case '\n':
|
|
|
|
|
case ';':
|
2009-12-11 14:42:17 +01:00
|
|
|
|
d_index = DIMNUM;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
obj_coff_line (int ignore ATTRIBUTE_UNUSED)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
int this_base;
|
|
|
|
|
|
|
|
|
|
if (def_symbol_in_progress == NULL)
|
|
|
|
|
{
|
|
|
|
|
/* Probably stabs-style line? */
|
|
|
|
|
obj_coff_ln (0);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this_base = get_absolute_expression ();
|
2005-03-16 15:57:00 +01:00
|
|
|
|
if (streq (".bf", S_GET_NAME (def_symbol_in_progress)))
|
1999-05-03 09:29:11 +02:00
|
|
|
|
coff_line_base = this_base;
|
|
|
|
|
|
|
|
|
|
S_SET_NUMBER_AUXILIARY (def_symbol_in_progress, 1);
|
1999-09-12 04:49:28 +02:00
|
|
|
|
SA_SET_SYM_LNNO (def_symbol_in_progress, this_base);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
|
|
|
|
|
#ifndef NO_LISTING
|
2005-03-16 15:57:00 +01:00
|
|
|
|
if (streq (".bf", S_GET_NAME (def_symbol_in_progress)))
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
extern int listing;
|
|
|
|
|
|
|
|
|
|
if (listing)
|
1999-09-12 04:49:28 +02:00
|
|
|
|
listing_source_line ((unsigned int) this_base);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
obj_coff_size (int ignore ATTRIBUTE_UNUSED)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
if (def_symbol_in_progress == NULL)
|
|
|
|
|
{
|
2017-01-23 16:23:07 +01:00
|
|
|
|
as_warn (_(".size pseudo-op used outside of .def/.endef: ignored."));
|
1999-05-03 09:29:11 +02:00
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
return;
|
2005-03-16 15:57:00 +01:00
|
|
|
|
}
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
S_SET_NUMBER_AUXILIARY (def_symbol_in_progress, 1);
|
|
|
|
|
SA_SET_SYM_SIZE (def_symbol_in_progress, get_absolute_expression ());
|
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
obj_coff_scl (int ignore ATTRIBUTE_UNUSED)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
if (def_symbol_in_progress == NULL)
|
|
|
|
|
{
|
2017-01-23 16:23:07 +01:00
|
|
|
|
as_warn (_(".scl pseudo-op used outside of .def/.endef: ignored."));
|
1999-05-03 09:29:11 +02:00
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
return;
|
2005-03-16 15:57:00 +01:00
|
|
|
|
}
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
S_SET_STORAGE_CLASS (def_symbol_in_progress, get_absolute_expression ());
|
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
obj_coff_tag (int ignore ATTRIBUTE_UNUSED)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
char *symbol_name;
|
|
|
|
|
char name_end;
|
|
|
|
|
|
|
|
|
|
if (def_symbol_in_progress == NULL)
|
|
|
|
|
{
|
2017-01-23 16:23:07 +01:00
|
|
|
|
as_warn (_(".tag pseudo-op used outside of .def/.endef: ignored."));
|
1999-05-03 09:29:11 +02:00
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
S_SET_NUMBER_AUXILIARY (def_symbol_in_progress, 1);
|
2015-08-21 17:42:14 +02:00
|
|
|
|
name_end = get_symbol_name (&symbol_name);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
#ifdef tc_canonicalize_symbol_name
|
|
|
|
|
symbol_name = tc_canonicalize_symbol_name (symbol_name);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Assume that the symbol referred to by .tag is always defined.
|
2000-09-12 23:49:09 +02:00
|
|
|
|
This was a bad assumption. I've added find_or_make. xoxorich. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
SA_SET_SYM_TAGNDX (def_symbol_in_progress,
|
|
|
|
|
tag_find_or_make (symbol_name));
|
|
|
|
|
if (SA_GET_SYM_TAGNDX (def_symbol_in_progress) == 0L)
|
2005-03-16 15:57:00 +01:00
|
|
|
|
as_warn (_("tag not found for .tag %s"), symbol_name);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
SF_SET_TAGGED (def_symbol_in_progress);
|
|
|
|
|
|
2015-08-21 17:42:14 +02:00
|
|
|
|
(void) restore_line_pointer (name_end);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
obj_coff_type (int ignore ATTRIBUTE_UNUSED)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
if (def_symbol_in_progress == NULL)
|
|
|
|
|
{
|
2017-01-23 16:23:07 +01:00
|
|
|
|
as_warn (_(".type pseudo-op used outside of .def/.endef: ignored."));
|
1999-05-03 09:29:11 +02:00
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
return;
|
2005-03-16 15:57:00 +01:00
|
|
|
|
}
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
S_SET_DATA_TYPE (def_symbol_in_progress, get_absolute_expression ());
|
|
|
|
|
|
|
|
|
|
if (ISFCN (S_GET_DATA_TYPE (def_symbol_in_progress)) &&
|
|
|
|
|
S_GET_STORAGE_CLASS (def_symbol_in_progress) != C_TPDEF)
|
2005-03-16 15:57:00 +01:00
|
|
|
|
SF_SET_FUNCTION (def_symbol_in_progress);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
obj_coff_val (int ignore ATTRIBUTE_UNUSED)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
if (def_symbol_in_progress == NULL)
|
|
|
|
|
{
|
2017-01-23 16:23:07 +01:00
|
|
|
|
as_warn (_(".val pseudo-op used outside of .def/.endef: ignored."));
|
1999-05-03 09:29:11 +02:00
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
return;
|
2005-03-16 15:57:00 +01:00
|
|
|
|
}
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
if (is_name_beginner (*input_line_pointer))
|
|
|
|
|
{
|
2015-08-21 17:42:14 +02:00
|
|
|
|
char *symbol_name;
|
|
|
|
|
char name_end = get_symbol_name (&symbol_name);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
#ifdef tc_canonicalize_symbol_name
|
2015-08-21 17:42:14 +02:00
|
|
|
|
symbol_name = tc_canonicalize_symbol_name (symbol_name);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
#endif
|
2005-03-16 15:57:00 +01:00
|
|
|
|
if (streq (symbol_name, "."))
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* If the .val is != from the .def (e.g. statics). */
|
Add support for storing local symbols in a small structure to save
memory when assembling large files.
* as.h: Don't include struc-symbol.h.
(symbolS): Add typedef.
* symbols.c: Include struc-symbol.h.
(local_hash): New static variable.
(save_symbol_name): New static function, from symbol_create.
(symbol_create): Call save_symbol_name.
(local_symbol_count): New static variable.
(local_symbol_conversion_count): Likewise.
(LOCAL_SYMBOL_CHECK): Define.
(local_symbol_make): New static function.
(local_symbol_convert): New static function.
(colon): Handle local symbols. Create local symbol for local
label name.
(symbol_table_insert): Handle local symbols.
(symbol_find_or_make): Create local symbol for local label name.
(symbol_find_base): Check for local symbol.
(symbol_append, symbol_insert): Check for local symbols.
(symbol_clear_list_pointers, symbol_remove): Likewise.
(verify_symbol_chain): Likewise.
(copy_symbol_attributes): Likewise.
(resolve_symbol_value): Handle local symbols.
(resolve_local_symbol): New static function.
(resolve_local_symbol_values): New function.
(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
(symbol_previous, symbol_next): New functions.
(symbol_get_value_expression): Likewise.
(symbol_set_value_expression): Likewise.
(symbol_set_frag, symbol_get_frag): Likewise.
(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
(symbol_mark_used_in_reloc): Likewise.
(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
(symbol_mri_common_p): Likewise.
(symbol_mark_written, symbol_clear_written): Likewise.
(symbol_written_p): Likewise.
(symbol_mark_resolved, symbol_resolved_p): Likewise.
(symbol_section_p, symbol_equated_p): Likewise.
(symbol_constant_p): Likewise.
(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
(symbol_get_obj, symbol_set_obj): Likewise.
(symbol_get_tc, symbol_set_tc): Likewise.
(symbol_begin): Initialize local_hash.
(print_symbol_value_1): Handle local symbols.
(symbol_print_statistics): Print local symbol statistics.
* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
Declare new symbols.c functions. Move many declarations here from
struc-symbol.h.
(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
(struct symbol): Move bsym to make it clearly the first field.
Remove TARGET_SYMBOL_FIELDS.
(symbolS): Don't typedef.
(struct broken_word): Remove.
(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
(symbol_clear_list_pointers): Likewise.
(symbol_insert, symbol_remove): Likewise.
(symbol_previous, symbol_append): Likewise.
(verify_symbol_chain, verify_symbol_chain_2): Likewise.
(struct local_symbol): Define.
(local_symbol_converted_p, local_symbol_mark_converted): Define.
(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
(local_symbol_get_frag, local_symbol_set_frag): Define.
(local_symbol_get_real_symbol): Define.
(local_symbol_set_real_symbol): Define.
Define.
* write.c (write_object_file): Call resolve_local_symbol_values.
* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-multi.h (struct elf_obj_sy): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
* config/tc-mcore.h: Don't include struc-symbol.h.
(TARGET_SYMBOL_FIELDS): Don't define.
(struct mcore_tc_sy): Define.
(TC_SYMFIELD_TYPE): Define.
* Many files: Use symbolS instead of struct symbol. Use new
accessor functions rather than referring to symbolS fields
directly.
* read.c (s_mri_common): Don't add in value of line_label.
* config/tc-mips.c (md_apply_fix): Correct parenthesization when
checking for SEC_LINK_ONCE.
* config/tc-sh.h (sh_fix_adjustable): Declare.
1999-06-03 02:29:48 +02:00
|
|
|
|
symbol_set_frag (def_symbol_in_progress, frag_now);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
S_SET_VALUE (def_symbol_in_progress, (valueT) frag_now_fix ());
|
|
|
|
|
}
|
2005-03-16 15:57:00 +01:00
|
|
|
|
else if (! streq (S_GET_NAME (def_symbol_in_progress), symbol_name))
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
Add support for storing local symbols in a small structure to save
memory when assembling large files.
* as.h: Don't include struc-symbol.h.
(symbolS): Add typedef.
* symbols.c: Include struc-symbol.h.
(local_hash): New static variable.
(save_symbol_name): New static function, from symbol_create.
(symbol_create): Call save_symbol_name.
(local_symbol_count): New static variable.
(local_symbol_conversion_count): Likewise.
(LOCAL_SYMBOL_CHECK): Define.
(local_symbol_make): New static function.
(local_symbol_convert): New static function.
(colon): Handle local symbols. Create local symbol for local
label name.
(symbol_table_insert): Handle local symbols.
(symbol_find_or_make): Create local symbol for local label name.
(symbol_find_base): Check for local symbol.
(symbol_append, symbol_insert): Check for local symbols.
(symbol_clear_list_pointers, symbol_remove): Likewise.
(verify_symbol_chain): Likewise.
(copy_symbol_attributes): Likewise.
(resolve_symbol_value): Handle local symbols.
(resolve_local_symbol): New static function.
(resolve_local_symbol_values): New function.
(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
(symbol_previous, symbol_next): New functions.
(symbol_get_value_expression): Likewise.
(symbol_set_value_expression): Likewise.
(symbol_set_frag, symbol_get_frag): Likewise.
(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
(symbol_mark_used_in_reloc): Likewise.
(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
(symbol_mri_common_p): Likewise.
(symbol_mark_written, symbol_clear_written): Likewise.
(symbol_written_p): Likewise.
(symbol_mark_resolved, symbol_resolved_p): Likewise.
(symbol_section_p, symbol_equated_p): Likewise.
(symbol_constant_p): Likewise.
(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
(symbol_get_obj, symbol_set_obj): Likewise.
(symbol_get_tc, symbol_set_tc): Likewise.
(symbol_begin): Initialize local_hash.
(print_symbol_value_1): Handle local symbols.
(symbol_print_statistics): Print local symbol statistics.
* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
Declare new symbols.c functions. Move many declarations here from
struc-symbol.h.
(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
(struct symbol): Move bsym to make it clearly the first field.
Remove TARGET_SYMBOL_FIELDS.
(symbolS): Don't typedef.
(struct broken_word): Remove.
(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
(symbol_clear_list_pointers): Likewise.
(symbol_insert, symbol_remove): Likewise.
(symbol_previous, symbol_append): Likewise.
(verify_symbol_chain, verify_symbol_chain_2): Likewise.
(struct local_symbol): Define.
(local_symbol_converted_p, local_symbol_mark_converted): Define.
(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
(local_symbol_get_frag, local_symbol_set_frag): Define.
(local_symbol_get_real_symbol): Define.
(local_symbol_set_real_symbol): Define.
Define.
* write.c (write_object_file): Call resolve_local_symbol_values.
* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-multi.h (struct elf_obj_sy): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
* config/tc-mcore.h: Don't include struc-symbol.h.
(TARGET_SYMBOL_FIELDS): Don't define.
(struct mcore_tc_sy): Define.
(TC_SYMFIELD_TYPE): Define.
* Many files: Use symbolS instead of struct symbol. Use new
accessor functions rather than referring to symbolS fields
directly.
* read.c (s_mri_common): Don't add in value of line_label.
* config/tc-mips.c (md_apply_fix): Correct parenthesization when
checking for SEC_LINK_ONCE.
* config/tc-sh.h (sh_fix_adjustable): Declare.
1999-06-03 02:29:48 +02:00
|
|
|
|
expressionS exp;
|
|
|
|
|
|
|
|
|
|
exp.X_op = O_symbol;
|
|
|
|
|
exp.X_add_symbol = symbol_find_or_make (symbol_name);
|
|
|
|
|
exp.X_op_symbol = NULL;
|
|
|
|
|
exp.X_add_number = 0;
|
|
|
|
|
symbol_set_value_expression (def_symbol_in_progress, &exp);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* If the segment is undefined when the forward reference is
|
|
|
|
|
resolved, then copy the segment id from the forward
|
|
|
|
|
symbol. */
|
|
|
|
|
SF_SET_GET_SEGMENT (def_symbol_in_progress);
|
1999-09-12 04:27:58 +02:00
|
|
|
|
|
|
|
|
|
/* FIXME: gcc can generate address expressions here in
|
|
|
|
|
unusual cases (search for "obscure" in sdbout.c). We
|
|
|
|
|
just ignore the offset here, thus generating incorrect
|
|
|
|
|
debugging information. We ignore the rest of the line
|
|
|
|
|
just below. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
1999-09-12 04:27:58 +02:00
|
|
|
|
/* Otherwise, it is the name of a non debug symbol and its value
|
2000-09-12 23:49:09 +02:00
|
|
|
|
will be calculated later. */
|
2015-08-21 17:42:14 +02:00
|
|
|
|
(void) restore_line_pointer (name_end);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
S_SET_VALUE (def_symbol_in_progress, get_absolute_expression ());
|
2005-03-16 15:57:00 +01:00
|
|
|
|
}
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
}
|
|
|
|
|
|
2004-11-08 09:12:53 +01:00
|
|
|
|
#ifdef TE_PE
|
|
|
|
|
|
|
|
|
|
/* Return nonzero if name begins with weak alternate symbol prefix. */
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
weak_is_altname (const char * name)
|
|
|
|
|
{
|
2005-03-16 15:57:00 +01:00
|
|
|
|
return strneq (name, weak_altprefix, sizeof (weak_altprefix) - 1);
|
2004-11-08 09:12:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return the name of the alternate symbol
|
|
|
|
|
name corresponding to a weak symbol's name. */
|
|
|
|
|
|
|
|
|
|
static const char *
|
|
|
|
|
weak_name2altname (const char * name)
|
|
|
|
|
{
|
2016-03-28 11:49:15 +02:00
|
|
|
|
return concat (weak_altprefix, name, (char *) NULL);
|
2004-11-08 09:12:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* Return the name of the weak symbol corresponding to an
|
* config/obj-coff.c, config/tc-arm.c, config/tc-bfin.c,
config/tc-cris.c, config/tc-crx.c, config/tc-i386.c,
config/tc-ia64.c, config/tc-maxq.c, config/tc-maxq.h,
config/tc-mips.c, config/tc-msp430.c, config/tc-sh.c,
config/tc-tic4x.c, config/tc-xtensa.c: Fix comment typos.
2006-04-24 00:12:43 +02:00
|
|
|
|
alternate symbol. */
|
2004-11-08 09:12:53 +01:00
|
|
|
|
|
|
|
|
|
static const char *
|
|
|
|
|
weak_altname2name (const char * name)
|
|
|
|
|
{
|
* gas/app, gas/as.c, gas/as.h, gas/atof-generic.c, gas/cgen.c,
gas/config/atof-ieee.c, gas/config/obj-aout.c,
gas/config/obj-coff.c, gas/config/obj-ecoff.c,
gas/config/obj-elf.c, gas/config/obj-som.c, gas/config/tc-alpha.c,
gas/config/tc-arc.c, gas/config/tc-arm.c, gas/config/tc-cr16.c,
gas/config/tc-cris.c, gas/config/tc-crx.c, gas/config/tc-d30v.c,
gas/config/tc-dlx.c, gas/config/tc-hppa.c, gas/config/tc-i370.c,
gas/config/tc-i386-intel.c, gas/config/tc-i386.c,
gas/config/tc-i860.c, gas/config/tc-i960.c, gas/config/tc-ia64.c,
gas/config/tc-iq2000.c, gas/config/tc-m32c.c,
gas/config/tc-m32r.c, gas/config/tc-m68hc11.c,
gas/config/tc-m68k.c, gas/config/tc-maxq.c, gas/config/tc-mcore.c,
gas/config/tc-mep.c, gas/config/tc-mips.c, gas/config/tc-mmix.c,
gas/config/tc-mn10300.c, gas/config/tc-moxie.c,
gas/config/tc-ns32k.c, gas/config/tc-pj.c, gas/config/tc-ppc.c,
gas/config/tc-s390.c, gas/config/tc-score.c,
gas/config/tc-score7.c, gas/config/tc-sh.c, gas/config/tc-sparc.c,
gas/config/tc-spu.c, gas/config/tc-tic30.c, gas/config/tc-vax.c,
gas/config/tc-xtensa.c, gas/config/xtensa-relax.c,
gas/dw2gencfi.c, gas/dwarf2dbg.c, gas/ehopt.c, gas/expr.c,
gas/frags.c, gas/input-file.c, gas/read.c, gas/sb.c,
gas/subsegs.c, gas/symbols.c, gas/write.c: Change the name of the
gas macro `assert' to `gas_assert'.
2009-06-22 19:56:02 +02:00
|
|
|
|
gas_assert (weak_is_altname (name));
|
2010-11-05 05:58:24 +01:00
|
|
|
|
return xstrdup (name + 6);
|
2004-11-08 09:12:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Make a weak symbol name unique by
|
|
|
|
|
appending the name of an external symbol. */
|
|
|
|
|
|
|
|
|
|
static const char *
|
|
|
|
|
weak_uniquify (const char * name)
|
|
|
|
|
{
|
|
|
|
|
const char * unique = "";
|
|
|
|
|
|
2009-09-09 15:19:51 +02:00
|
|
|
|
#ifdef TE_PE
|
2004-11-08 09:12:53 +01:00
|
|
|
|
if (an_external_name != NULL)
|
|
|
|
|
unique = an_external_name;
|
|
|
|
|
#endif
|
* gas/app, gas/as.c, gas/as.h, gas/atof-generic.c, gas/cgen.c,
gas/config/atof-ieee.c, gas/config/obj-aout.c,
gas/config/obj-coff.c, gas/config/obj-ecoff.c,
gas/config/obj-elf.c, gas/config/obj-som.c, gas/config/tc-alpha.c,
gas/config/tc-arc.c, gas/config/tc-arm.c, gas/config/tc-cr16.c,
gas/config/tc-cris.c, gas/config/tc-crx.c, gas/config/tc-d30v.c,
gas/config/tc-dlx.c, gas/config/tc-hppa.c, gas/config/tc-i370.c,
gas/config/tc-i386-intel.c, gas/config/tc-i386.c,
gas/config/tc-i860.c, gas/config/tc-i960.c, gas/config/tc-ia64.c,
gas/config/tc-iq2000.c, gas/config/tc-m32c.c,
gas/config/tc-m32r.c, gas/config/tc-m68hc11.c,
gas/config/tc-m68k.c, gas/config/tc-maxq.c, gas/config/tc-mcore.c,
gas/config/tc-mep.c, gas/config/tc-mips.c, gas/config/tc-mmix.c,
gas/config/tc-mn10300.c, gas/config/tc-moxie.c,
gas/config/tc-ns32k.c, gas/config/tc-pj.c, gas/config/tc-ppc.c,
gas/config/tc-s390.c, gas/config/tc-score.c,
gas/config/tc-score7.c, gas/config/tc-sh.c, gas/config/tc-sparc.c,
gas/config/tc-spu.c, gas/config/tc-tic30.c, gas/config/tc-vax.c,
gas/config/tc-xtensa.c, gas/config/xtensa-relax.c,
gas/dw2gencfi.c, gas/dwarf2dbg.c, gas/ehopt.c, gas/expr.c,
gas/frags.c, gas/input-file.c, gas/read.c, gas/sb.c,
gas/subsegs.c, gas/symbols.c, gas/write.c: Change the name of the
gas macro `assert' to `gas_assert'.
2009-06-22 19:56:02 +02:00
|
|
|
|
gas_assert (weak_is_altname (name));
|
2004-11-08 09:12:53 +01:00
|
|
|
|
|
2016-03-28 11:49:15 +02:00
|
|
|
|
return concat (name, ".", unique, (char *) NULL);
|
2004-11-08 09:12:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
gas/ChangeLog:
* read.c (potable): Add weakref.
(s_weakref): New.
* read.h (s_weakref): Declare.
* struc-symbol.h (struct symbol): Add sy_weakrefr and sy_weakrefd.
* symbols.c (colon): Clear weakrefr.
(symbol_find_exact): Rename to, and reimplement in terms of...
(symbol_find_exact_noref): ... new function.
(symbol_find): Likewise...
(symbol_find_noref): ... ditto.
(resolve_symbol_value): Resolve weakrefr without setting their
values.
(S_SET_WEAK): Call hook.
(S_GET_VALUE): Follow weakref link.
(S_SET_VALUE): Clear weakrefr.
(S_IS_WEAK): Follow weakref link.
(S_IS_WEAKREFR, S_SET_WEAKREFR, S_CLEAR_WEAKREFR): New.
(S_IS_WEAKREFD, S_SET_WEAKREFD, S_CLEAR_WEAKREFD): New.
(symbol_set_value_expression, symbol_set_frag): Clear weakrefr.
(symbol_mark_used): Follow weakref link.
(print_symbol_value_1): Print weak, weakrefr and weakrefd.
* symbols.h (symbol_find_noref, symbol_find_exact_noref): Declare.
(S_IS_WEAKREFR, S_SET_WEAKREFR, S_CLEAR_WEAKREFR): Declare.
(S_IS_WEAKREFD, S_SET_WEAKREFD, S_CLEAR_WEAKREFD): Declare.
* write.c (adust_reloc_syms): Follow weakref link. Do not
complain if target is undefined.
(write_object_file): Likewise. Remove weakrefr symbols. Drop
unreferenced weakrefd symbols.
* config/obj-coff.c (obj_frob_symbol): Do not force WEAKREFD
symbols EXTERNAL.
(pecoff_obj_set_weak_hook, pecoff_obj_clear_weak_hook): New.
* config/obj-coff.h (obj_set_weak_hook, obj_clear_weak_hook): Define.
* doc/as.texinfo: Document weakref.
* doc/internals.texi: Document new struct members, internal
functions and hooks.
gas/testsuite/ChangeLog:
* gas/all/weakref1.s, gas/all/weakref1.d: New test.
* gas/all/weakref1g.d, gas/all/weakref1l.d: New tests.
* gas/all/weakref1u.d, gas/all/weakref1w.d: New tests.
* gas/all/weakref2.s, gas/all/weakref3.s: New tests.
* gas/all/gas.exp: Run new tests.
2005-10-24 19:51:42 +02:00
|
|
|
|
void
|
|
|
|
|
pecoff_obj_set_weak_hook (symbolS *symbolP)
|
|
|
|
|
{
|
|
|
|
|
symbolS *alternateP;
|
|
|
|
|
|
|
|
|
|
/* See _Microsoft Portable Executable and Common Object
|
|
|
|
|
File Format Specification_, section 5.5.3.
|
|
|
|
|
Create a symbol representing the alternate value.
|
|
|
|
|
coff_frob_symbol will set the value of this symbol from
|
|
|
|
|
the value of the weak symbol itself. */
|
|
|
|
|
S_SET_STORAGE_CLASS (symbolP, C_NT_WEAK);
|
|
|
|
|
S_SET_NUMBER_AUXILIARY (symbolP, 1);
|
|
|
|
|
SA_SET_SYM_FSIZE (symbolP, IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY);
|
|
|
|
|
|
|
|
|
|
alternateP = symbol_find_or_make (weak_name2altname (S_GET_NAME (symbolP)));
|
|
|
|
|
S_SET_EXTERNAL (alternateP);
|
|
|
|
|
S_SET_STORAGE_CLASS (alternateP, C_NT_WEAK);
|
|
|
|
|
|
|
|
|
|
SA_SET_SYM_TAGNDX (symbolP, alternateP);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
pecoff_obj_clear_weak_hook (symbolS *symbolP)
|
|
|
|
|
{
|
|
|
|
|
symbolS *alternateP;
|
|
|
|
|
|
|
|
|
|
S_SET_STORAGE_CLASS (symbolP, 0);
|
|
|
|
|
SA_SET_SYM_FSIZE (symbolP, 0);
|
|
|
|
|
|
|
|
|
|
alternateP = symbol_find (weak_name2altname (S_GET_NAME (symbolP)));
|
|
|
|
|
S_CLEAR_EXTERNAL (alternateP);
|
|
|
|
|
}
|
|
|
|
|
|
2004-11-08 09:12:53 +01:00
|
|
|
|
#endif /* TE_PE */
|
|
|
|
|
|
2004-07-03 18:07:51 +02:00
|
|
|
|
/* Handle .weak. This is a GNU extension in formats other than PE. */
|
2004-11-08 09:12:53 +01:00
|
|
|
|
|
2004-07-03 18:07:51 +02:00
|
|
|
|
static void
|
2004-11-08 09:12:53 +01:00
|
|
|
|
obj_coff_weak (int ignore ATTRIBUTE_UNUSED)
|
2004-07-03 18:07:51 +02:00
|
|
|
|
{
|
|
|
|
|
char *name;
|
|
|
|
|
int c;
|
|
|
|
|
symbolS *symbolP;
|
|
|
|
|
|
|
|
|
|
do
|
|
|
|
|
{
|
2015-08-21 17:42:14 +02:00
|
|
|
|
c = get_symbol_name (&name);
|
2004-07-03 18:07:51 +02:00
|
|
|
|
if (*name == 0)
|
|
|
|
|
{
|
|
|
|
|
as_warn (_("badly formed .weak directive ignored"));
|
|
|
|
|
ignore_rest_of_line ();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2004-11-08 09:12:53 +01:00
|
|
|
|
c = 0;
|
2004-07-03 18:07:51 +02:00
|
|
|
|
symbolP = symbol_find_or_make (name);
|
|
|
|
|
*input_line_pointer = c;
|
2015-08-21 17:42:14 +02:00
|
|
|
|
SKIP_WHITESPACE_AFTER_NAME ();
|
2004-07-03 18:07:51 +02:00
|
|
|
|
S_SET_WEAK (symbolP);
|
|
|
|
|
|
|
|
|
|
if (c == ',')
|
|
|
|
|
{
|
|
|
|
|
input_line_pointer++;
|
|
|
|
|
SKIP_WHITESPACE ();
|
|
|
|
|
if (*input_line_pointer == '\n')
|
|
|
|
|
c = '\n';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
while (c == ',');
|
|
|
|
|
|
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
}
|
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
coff_obj_read_begin_hook (void)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
2000-09-12 23:49:09 +02:00
|
|
|
|
/* These had better be the same. Usually 18 bytes. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
know (sizeof (SYMENT) == sizeof (AUXENT));
|
|
|
|
|
know (SYMESZ == AUXESZ);
|
|
|
|
|
tag_init ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
symbolS *coff_last_function;
|
2002-12-12 23:46:47 +01:00
|
|
|
|
#ifndef OBJ_XCOFF
|
1999-05-03 09:29:11 +02:00
|
|
|
|
static symbolS *coff_last_bf;
|
2002-12-12 23:46:47 +01:00
|
|
|
|
#endif
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
coff_frob_symbol (symbolS *symp, int *punt)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
static symbolS *last_tagP;
|
|
|
|
|
static stack *block_stack;
|
|
|
|
|
static symbolS *set_end;
|
|
|
|
|
symbolS *next_set_end = NULL;
|
|
|
|
|
|
|
|
|
|
if (symp == &abs_symbol)
|
|
|
|
|
{
|
|
|
|
|
*punt = 1;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (current_lineno_sym)
|
2005-03-16 15:57:00 +01:00
|
|
|
|
coff_add_linesym (NULL);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
if (!block_stack)
|
|
|
|
|
block_stack = stack_init (512, sizeof (symbolS*));
|
|
|
|
|
|
|
|
|
|
#ifdef TE_PE
|
2004-11-08 09:12:53 +01:00
|
|
|
|
if (S_GET_STORAGE_CLASS (symp) == C_NT_WEAK
|
|
|
|
|
&& ! S_IS_WEAK (symp)
|
|
|
|
|
&& weak_is_altname (S_GET_NAME (symp)))
|
|
|
|
|
{
|
|
|
|
|
/* This is a weak alternate symbol. All processing of
|
|
|
|
|
PECOFFweak symbols is done here, through the alternate. */
|
gas/ChangeLog:
* read.c (potable): Add weakref.
(s_weakref): New.
* read.h (s_weakref): Declare.
* struc-symbol.h (struct symbol): Add sy_weakrefr and sy_weakrefd.
* symbols.c (colon): Clear weakrefr.
(symbol_find_exact): Rename to, and reimplement in terms of...
(symbol_find_exact_noref): ... new function.
(symbol_find): Likewise...
(symbol_find_noref): ... ditto.
(resolve_symbol_value): Resolve weakrefr without setting their
values.
(S_SET_WEAK): Call hook.
(S_GET_VALUE): Follow weakref link.
(S_SET_VALUE): Clear weakrefr.
(S_IS_WEAK): Follow weakref link.
(S_IS_WEAKREFR, S_SET_WEAKREFR, S_CLEAR_WEAKREFR): New.
(S_IS_WEAKREFD, S_SET_WEAKREFD, S_CLEAR_WEAKREFD): New.
(symbol_set_value_expression, symbol_set_frag): Clear weakrefr.
(symbol_mark_used): Follow weakref link.
(print_symbol_value_1): Print weak, weakrefr and weakrefd.
* symbols.h (symbol_find_noref, symbol_find_exact_noref): Declare.
(S_IS_WEAKREFR, S_SET_WEAKREFR, S_CLEAR_WEAKREFR): Declare.
(S_IS_WEAKREFD, S_SET_WEAKREFD, S_CLEAR_WEAKREFD): Declare.
* write.c (adust_reloc_syms): Follow weakref link. Do not
complain if target is undefined.
(write_object_file): Likewise. Remove weakrefr symbols. Drop
unreferenced weakrefd symbols.
* config/obj-coff.c (obj_frob_symbol): Do not force WEAKREFD
symbols EXTERNAL.
(pecoff_obj_set_weak_hook, pecoff_obj_clear_weak_hook): New.
* config/obj-coff.h (obj_set_weak_hook, obj_clear_weak_hook): Define.
* doc/as.texinfo: Document weakref.
* doc/internals.texi: Document new struct members, internal
functions and hooks.
gas/testsuite/ChangeLog:
* gas/all/weakref1.s, gas/all/weakref1.d: New test.
* gas/all/weakref1g.d, gas/all/weakref1l.d: New tests.
* gas/all/weakref1u.d, gas/all/weakref1w.d: New tests.
* gas/all/weakref2.s, gas/all/weakref3.s: New tests.
* gas/all/gas.exp: Run new tests.
2005-10-24 19:51:42 +02:00
|
|
|
|
symbolS *weakp = symbol_find_noref (weak_altname2name
|
|
|
|
|
(S_GET_NAME (symp)), 1);
|
2004-11-08 09:12:53 +01:00
|
|
|
|
|
* gas/app, gas/as.c, gas/as.h, gas/atof-generic.c, gas/cgen.c,
gas/config/atof-ieee.c, gas/config/obj-aout.c,
gas/config/obj-coff.c, gas/config/obj-ecoff.c,
gas/config/obj-elf.c, gas/config/obj-som.c, gas/config/tc-alpha.c,
gas/config/tc-arc.c, gas/config/tc-arm.c, gas/config/tc-cr16.c,
gas/config/tc-cris.c, gas/config/tc-crx.c, gas/config/tc-d30v.c,
gas/config/tc-dlx.c, gas/config/tc-hppa.c, gas/config/tc-i370.c,
gas/config/tc-i386-intel.c, gas/config/tc-i386.c,
gas/config/tc-i860.c, gas/config/tc-i960.c, gas/config/tc-ia64.c,
gas/config/tc-iq2000.c, gas/config/tc-m32c.c,
gas/config/tc-m32r.c, gas/config/tc-m68hc11.c,
gas/config/tc-m68k.c, gas/config/tc-maxq.c, gas/config/tc-mcore.c,
gas/config/tc-mep.c, gas/config/tc-mips.c, gas/config/tc-mmix.c,
gas/config/tc-mn10300.c, gas/config/tc-moxie.c,
gas/config/tc-ns32k.c, gas/config/tc-pj.c, gas/config/tc-ppc.c,
gas/config/tc-s390.c, gas/config/tc-score.c,
gas/config/tc-score7.c, gas/config/tc-sh.c, gas/config/tc-sparc.c,
gas/config/tc-spu.c, gas/config/tc-tic30.c, gas/config/tc-vax.c,
gas/config/tc-xtensa.c, gas/config/xtensa-relax.c,
gas/dw2gencfi.c, gas/dwarf2dbg.c, gas/ehopt.c, gas/expr.c,
gas/frags.c, gas/input-file.c, gas/read.c, gas/sb.c,
gas/subsegs.c, gas/symbols.c, gas/write.c: Change the name of the
gas macro `assert' to `gas_assert'.
2009-06-22 19:56:02 +02:00
|
|
|
|
gas_assert (weakp);
|
|
|
|
|
gas_assert (S_GET_NUMBER_AUXILIARY (weakp) == 1);
|
2004-11-08 09:12:53 +01:00
|
|
|
|
|
gas/ChangeLog:
* read.c (potable): Add weakref.
(s_weakref): New.
* read.h (s_weakref): Declare.
* struc-symbol.h (struct symbol): Add sy_weakrefr and sy_weakrefd.
* symbols.c (colon): Clear weakrefr.
(symbol_find_exact): Rename to, and reimplement in terms of...
(symbol_find_exact_noref): ... new function.
(symbol_find): Likewise...
(symbol_find_noref): ... ditto.
(resolve_symbol_value): Resolve weakrefr without setting their
values.
(S_SET_WEAK): Call hook.
(S_GET_VALUE): Follow weakref link.
(S_SET_VALUE): Clear weakrefr.
(S_IS_WEAK): Follow weakref link.
(S_IS_WEAKREFR, S_SET_WEAKREFR, S_CLEAR_WEAKREFR): New.
(S_IS_WEAKREFD, S_SET_WEAKREFD, S_CLEAR_WEAKREFD): New.
(symbol_set_value_expression, symbol_set_frag): Clear weakrefr.
(symbol_mark_used): Follow weakref link.
(print_symbol_value_1): Print weak, weakrefr and weakrefd.
* symbols.h (symbol_find_noref, symbol_find_exact_noref): Declare.
(S_IS_WEAKREFR, S_SET_WEAKREFR, S_CLEAR_WEAKREFR): Declare.
(S_IS_WEAKREFD, S_SET_WEAKREFD, S_CLEAR_WEAKREFD): Declare.
* write.c (adust_reloc_syms): Follow weakref link. Do not
complain if target is undefined.
(write_object_file): Likewise. Remove weakrefr symbols. Drop
unreferenced weakrefd symbols.
* config/obj-coff.c (obj_frob_symbol): Do not force WEAKREFD
symbols EXTERNAL.
(pecoff_obj_set_weak_hook, pecoff_obj_clear_weak_hook): New.
* config/obj-coff.h (obj_set_weak_hook, obj_clear_weak_hook): Define.
* doc/as.texinfo: Document weakref.
* doc/internals.texi: Document new struct members, internal
functions and hooks.
gas/testsuite/ChangeLog:
* gas/all/weakref1.s, gas/all/weakref1.d: New test.
* gas/all/weakref1g.d, gas/all/weakref1l.d: New tests.
* gas/all/weakref1u.d, gas/all/weakref1w.d: New tests.
* gas/all/weakref2.s, gas/all/weakref3.s: New tests.
* gas/all/gas.exp: Run new tests.
2005-10-24 19:51:42 +02:00
|
|
|
|
if (! S_IS_WEAK (weakp))
|
|
|
|
|
{
|
|
|
|
|
/* The symbol was turned from weak to strong. Discard altname. */
|
|
|
|
|
*punt = 1;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else if (symbol_equated_p (weakp))
|
2004-11-08 09:12:53 +01:00
|
|
|
|
{
|
|
|
|
|
/* The weak symbol has an alternate specified; symp is unneeded. */
|
|
|
|
|
S_SET_STORAGE_CLASS (weakp, C_NT_WEAK);
|
|
|
|
|
SA_SET_SYM_TAGNDX (weakp,
|
|
|
|
|
symbol_get_value_expression (weakp)->X_add_symbol);
|
|
|
|
|
|
|
|
|
|
S_CLEAR_EXTERNAL (symp);
|
|
|
|
|
*punt = 1;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* The weak symbol has been assigned an alternate value.
|
|
|
|
|
Copy this value to symp, and set symp as weakp's alternate. */
|
|
|
|
|
if (S_GET_STORAGE_CLASS (weakp) != C_NT_WEAK)
|
|
|
|
|
{
|
|
|
|
|
S_SET_STORAGE_CLASS (symp, S_GET_STORAGE_CLASS (weakp));
|
|
|
|
|
S_SET_STORAGE_CLASS (weakp, C_NT_WEAK);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (S_IS_DEFINED (weakp))
|
|
|
|
|
{
|
|
|
|
|
/* This is a defined weak symbol. Copy value information
|
|
|
|
|
from the weak symbol itself to the alternate symbol. */
|
|
|
|
|
symbol_set_value_expression (symp,
|
|
|
|
|
symbol_get_value_expression (weakp));
|
|
|
|
|
symbol_set_frag (symp, symbol_get_frag (weakp));
|
|
|
|
|
S_SET_SEGMENT (symp, S_GET_SEGMENT (weakp));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* This is an undefined weak symbol.
|
|
|
|
|
Define the alternate symbol to zero. */
|
|
|
|
|
S_SET_VALUE (symp, 0);
|
|
|
|
|
S_SET_SEGMENT (symp, absolute_section);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
S_SET_NAME (symp, weak_uniquify (S_GET_NAME (symp)));
|
|
|
|
|
S_SET_STORAGE_CLASS (symp, C_EXT);
|
|
|
|
|
|
|
|
|
|
S_SET_VALUE (weakp, 0);
|
|
|
|
|
S_SET_SEGMENT (weakp, undefined_section);
|
|
|
|
|
}
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
2004-11-08 09:12:53 +01:00
|
|
|
|
#else /* TE_PE */
|
|
|
|
|
if (S_IS_WEAK (symp))
|
|
|
|
|
S_SET_STORAGE_CLASS (symp, C_WEAKEXT);
|
|
|
|
|
#endif /* TE_PE */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
if (!S_IS_DEFINED (symp)
|
|
|
|
|
&& !S_IS_WEAK (symp)
|
|
|
|
|
&& S_GET_STORAGE_CLASS (symp) != C_STAT)
|
|
|
|
|
S_SET_STORAGE_CLASS (symp, C_EXT);
|
|
|
|
|
|
|
|
|
|
if (!SF_GET_DEBUG (symp))
|
|
|
|
|
{
|
2001-07-11 11:26:27 +02:00
|
|
|
|
symbolS * real;
|
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
if (!SF_GET_LOCAL (symp)
|
|
|
|
|
&& !SF_GET_STATICS (symp)
|
2000-07-24 19:50:35 +02:00
|
|
|
|
&& S_GET_STORAGE_CLASS (symp) != C_LABEL
|
2005-03-16 15:57:00 +01:00
|
|
|
|
&& symbol_constant_p (symp)
|
gas/ChangeLog:
* read.c (potable): Add weakref.
(s_weakref): New.
* read.h (s_weakref): Declare.
* struc-symbol.h (struct symbol): Add sy_weakrefr and sy_weakrefd.
* symbols.c (colon): Clear weakrefr.
(symbol_find_exact): Rename to, and reimplement in terms of...
(symbol_find_exact_noref): ... new function.
(symbol_find): Likewise...
(symbol_find_noref): ... ditto.
(resolve_symbol_value): Resolve weakrefr without setting their
values.
(S_SET_WEAK): Call hook.
(S_GET_VALUE): Follow weakref link.
(S_SET_VALUE): Clear weakrefr.
(S_IS_WEAK): Follow weakref link.
(S_IS_WEAKREFR, S_SET_WEAKREFR, S_CLEAR_WEAKREFR): New.
(S_IS_WEAKREFD, S_SET_WEAKREFD, S_CLEAR_WEAKREFD): New.
(symbol_set_value_expression, symbol_set_frag): Clear weakrefr.
(symbol_mark_used): Follow weakref link.
(print_symbol_value_1): Print weak, weakrefr and weakrefd.
* symbols.h (symbol_find_noref, symbol_find_exact_noref): Declare.
(S_IS_WEAKREFR, S_SET_WEAKREFR, S_CLEAR_WEAKREFR): Declare.
(S_IS_WEAKREFD, S_SET_WEAKREFD, S_CLEAR_WEAKREFD): Declare.
* write.c (adust_reloc_syms): Follow weakref link. Do not
complain if target is undefined.
(write_object_file): Likewise. Remove weakrefr symbols. Drop
unreferenced weakrefd symbols.
* config/obj-coff.c (obj_frob_symbol): Do not force WEAKREFD
symbols EXTERNAL.
(pecoff_obj_set_weak_hook, pecoff_obj_clear_weak_hook): New.
* config/obj-coff.h (obj_set_weak_hook, obj_clear_weak_hook): Define.
* doc/as.texinfo: Document weakref.
* doc/internals.texi: Document new struct members, internal
functions and hooks.
gas/testsuite/ChangeLog:
* gas/all/weakref1.s, gas/all/weakref1.d: New test.
* gas/all/weakref1g.d, gas/all/weakref1l.d: New tests.
* gas/all/weakref1u.d, gas/all/weakref1w.d: New tests.
* gas/all/weakref2.s, gas/all/weakref3.s: New tests.
* gas/all/gas.exp: Run new tests.
2005-10-24 19:51:42 +02:00
|
|
|
|
&& (real = symbol_find_noref (S_GET_NAME (symp), 1))
|
2001-07-11 11:26:27 +02:00
|
|
|
|
&& S_GET_STORAGE_CLASS (real) == C_NULL
|
1999-05-03 09:29:11 +02:00
|
|
|
|
&& real != symp)
|
|
|
|
|
{
|
|
|
|
|
c_symbol_merge (symp, real);
|
|
|
|
|
*punt = 1;
|
2000-07-24 19:50:35 +02:00
|
|
|
|
return;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
2001-07-11 11:26:27 +02:00
|
|
|
|
|
2000-07-21 01:38:05 +02:00
|
|
|
|
if (!S_IS_DEFINED (symp) && !SF_GET_LOCAL (symp))
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
* gas/app, gas/as.c, gas/as.h, gas/atof-generic.c, gas/cgen.c,
gas/config/atof-ieee.c, gas/config/obj-aout.c,
gas/config/obj-coff.c, gas/config/obj-ecoff.c,
gas/config/obj-elf.c, gas/config/obj-som.c, gas/config/tc-alpha.c,
gas/config/tc-arc.c, gas/config/tc-arm.c, gas/config/tc-cr16.c,
gas/config/tc-cris.c, gas/config/tc-crx.c, gas/config/tc-d30v.c,
gas/config/tc-dlx.c, gas/config/tc-hppa.c, gas/config/tc-i370.c,
gas/config/tc-i386-intel.c, gas/config/tc-i386.c,
gas/config/tc-i860.c, gas/config/tc-i960.c, gas/config/tc-ia64.c,
gas/config/tc-iq2000.c, gas/config/tc-m32c.c,
gas/config/tc-m32r.c, gas/config/tc-m68hc11.c,
gas/config/tc-m68k.c, gas/config/tc-maxq.c, gas/config/tc-mcore.c,
gas/config/tc-mep.c, gas/config/tc-mips.c, gas/config/tc-mmix.c,
gas/config/tc-mn10300.c, gas/config/tc-moxie.c,
gas/config/tc-ns32k.c, gas/config/tc-pj.c, gas/config/tc-ppc.c,
gas/config/tc-s390.c, gas/config/tc-score.c,
gas/config/tc-score7.c, gas/config/tc-sh.c, gas/config/tc-sparc.c,
gas/config/tc-spu.c, gas/config/tc-tic30.c, gas/config/tc-vax.c,
gas/config/tc-xtensa.c, gas/config/xtensa-relax.c,
gas/dw2gencfi.c, gas/dwarf2dbg.c, gas/ehopt.c, gas/expr.c,
gas/frags.c, gas/input-file.c, gas/read.c, gas/sb.c,
gas/subsegs.c, gas/symbols.c, gas/write.c: Change the name of the
gas macro `assert' to `gas_assert'.
2009-06-22 19:56:02 +02:00
|
|
|
|
gas_assert (S_GET_VALUE (symp) == 0);
|
gas/ChangeLog:
* read.c (potable): Add weakref.
(s_weakref): New.
* read.h (s_weakref): Declare.
* struc-symbol.h (struct symbol): Add sy_weakrefr and sy_weakrefd.
* symbols.c (colon): Clear weakrefr.
(symbol_find_exact): Rename to, and reimplement in terms of...
(symbol_find_exact_noref): ... new function.
(symbol_find): Likewise...
(symbol_find_noref): ... ditto.
(resolve_symbol_value): Resolve weakrefr without setting their
values.
(S_SET_WEAK): Call hook.
(S_GET_VALUE): Follow weakref link.
(S_SET_VALUE): Clear weakrefr.
(S_IS_WEAK): Follow weakref link.
(S_IS_WEAKREFR, S_SET_WEAKREFR, S_CLEAR_WEAKREFR): New.
(S_IS_WEAKREFD, S_SET_WEAKREFD, S_CLEAR_WEAKREFD): New.
(symbol_set_value_expression, symbol_set_frag): Clear weakrefr.
(symbol_mark_used): Follow weakref link.
(print_symbol_value_1): Print weak, weakrefr and weakrefd.
* symbols.h (symbol_find_noref, symbol_find_exact_noref): Declare.
(S_IS_WEAKREFR, S_SET_WEAKREFR, S_CLEAR_WEAKREFR): Declare.
(S_IS_WEAKREFD, S_SET_WEAKREFD, S_CLEAR_WEAKREFD): Declare.
* write.c (adust_reloc_syms): Follow weakref link. Do not
complain if target is undefined.
(write_object_file): Likewise. Remove weakrefr symbols. Drop
unreferenced weakrefd symbols.
* config/obj-coff.c (obj_frob_symbol): Do not force WEAKREFD
symbols EXTERNAL.
(pecoff_obj_set_weak_hook, pecoff_obj_clear_weak_hook): New.
* config/obj-coff.h (obj_set_weak_hook, obj_clear_weak_hook): Define.
* doc/as.texinfo: Document weakref.
* doc/internals.texi: Document new struct members, internal
functions and hooks.
gas/testsuite/ChangeLog:
* gas/all/weakref1.s, gas/all/weakref1.d: New test.
* gas/all/weakref1g.d, gas/all/weakref1l.d: New tests.
* gas/all/weakref1u.d, gas/all/weakref1w.d: New tests.
* gas/all/weakref2.s, gas/all/weakref3.s: New tests.
* gas/all/gas.exp: Run new tests.
2005-10-24 19:51:42 +02:00
|
|
|
|
if (S_IS_WEAKREFD (symp))
|
|
|
|
|
*punt = 1;
|
|
|
|
|
else
|
|
|
|
|
S_SET_EXTERNAL (symp);
|
2000-07-21 01:38:05 +02:00
|
|
|
|
}
|
|
|
|
|
else if (S_GET_STORAGE_CLASS (symp) == C_NULL)
|
|
|
|
|
{
|
|
|
|
|
if (S_GET_SEGMENT (symp) == text_section
|
|
|
|
|
&& symp != seg_info (text_section)->sym)
|
|
|
|
|
S_SET_STORAGE_CLASS (symp, C_LABEL);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
else
|
2000-07-21 01:38:05 +02:00
|
|
|
|
S_SET_STORAGE_CLASS (symp, C_STAT);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
2001-07-11 11:26:27 +02:00
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
if (SF_GET_PROCESS (symp))
|
|
|
|
|
{
|
|
|
|
|
if (S_GET_STORAGE_CLASS (symp) == C_BLOCK)
|
|
|
|
|
{
|
2005-03-16 15:57:00 +01:00
|
|
|
|
if (streq (S_GET_NAME (symp), ".bb"))
|
1999-05-03 09:29:11 +02:00
|
|
|
|
stack_push (block_stack, (char *) &symp);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
symbolS *begin;
|
2001-07-11 11:26:27 +02:00
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
begin = *(symbolS **) stack_pop (block_stack);
|
|
|
|
|
if (begin == 0)
|
|
|
|
|
as_warn (_("mismatched .eb"));
|
|
|
|
|
else
|
|
|
|
|
next_set_end = begin;
|
|
|
|
|
}
|
|
|
|
|
}
|
2001-07-11 11:26:27 +02:00
|
|
|
|
|
2012-10-18 19:00:56 +02:00
|
|
|
|
if (coff_last_function == 0 && SF_GET_FUNCTION (symp)
|
|
|
|
|
&& S_IS_DEFINED (symp))
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
union internal_auxent *auxp;
|
2001-07-11 11:26:27 +02:00
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
coff_last_function = symp;
|
|
|
|
|
if (S_GET_NUMBER_AUXILIARY (symp) < 1)
|
|
|
|
|
S_SET_NUMBER_AUXILIARY (symp, 1);
|
1999-09-12 04:27:58 +02:00
|
|
|
|
auxp = SYM_AUXENT (symp);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
memset (auxp->x_sym.x_fcnary.x_ary.x_dimen, 0,
|
|
|
|
|
sizeof (auxp->x_sym.x_fcnary.x_ary.x_dimen));
|
|
|
|
|
}
|
2001-07-11 11:26:27 +02:00
|
|
|
|
|
2012-10-18 19:00:56 +02:00
|
|
|
|
if (S_GET_STORAGE_CLASS (symp) == C_EFCN
|
|
|
|
|
&& S_IS_DEFINED (symp))
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
if (coff_last_function == 0)
|
2005-03-27 19:53:20 +02:00
|
|
|
|
as_fatal (_("C_EFCN symbol for %s out of scope"),
|
|
|
|
|
S_GET_NAME (symp));
|
1999-05-03 09:29:11 +02:00
|
|
|
|
SA_SET_SYM_FSIZE (coff_last_function,
|
|
|
|
|
(long) (S_GET_VALUE (symp)
|
|
|
|
|
- S_GET_VALUE (coff_last_function)));
|
|
|
|
|
next_set_end = coff_last_function;
|
|
|
|
|
coff_last_function = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
2001-07-11 11:26:27 +02:00
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
if (S_IS_EXTERNAL (symp))
|
|
|
|
|
S_SET_STORAGE_CLASS (symp, C_EXT);
|
|
|
|
|
else if (SF_GET_LOCAL (symp))
|
|
|
|
|
*punt = 1;
|
|
|
|
|
|
|
|
|
|
if (SF_GET_FUNCTION (symp))
|
Add support for storing local symbols in a small structure to save
memory when assembling large files.
* as.h: Don't include struc-symbol.h.
(symbolS): Add typedef.
* symbols.c: Include struc-symbol.h.
(local_hash): New static variable.
(save_symbol_name): New static function, from symbol_create.
(symbol_create): Call save_symbol_name.
(local_symbol_count): New static variable.
(local_symbol_conversion_count): Likewise.
(LOCAL_SYMBOL_CHECK): Define.
(local_symbol_make): New static function.
(local_symbol_convert): New static function.
(colon): Handle local symbols. Create local symbol for local
label name.
(symbol_table_insert): Handle local symbols.
(symbol_find_or_make): Create local symbol for local label name.
(symbol_find_base): Check for local symbol.
(symbol_append, symbol_insert): Check for local symbols.
(symbol_clear_list_pointers, symbol_remove): Likewise.
(verify_symbol_chain): Likewise.
(copy_symbol_attributes): Likewise.
(resolve_symbol_value): Handle local symbols.
(resolve_local_symbol): New static function.
(resolve_local_symbol_values): New function.
(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
(symbol_previous, symbol_next): New functions.
(symbol_get_value_expression): Likewise.
(symbol_set_value_expression): Likewise.
(symbol_set_frag, symbol_get_frag): Likewise.
(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
(symbol_mark_used_in_reloc): Likewise.
(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
(symbol_mri_common_p): Likewise.
(symbol_mark_written, symbol_clear_written): Likewise.
(symbol_written_p): Likewise.
(symbol_mark_resolved, symbol_resolved_p): Likewise.
(symbol_section_p, symbol_equated_p): Likewise.
(symbol_constant_p): Likewise.
(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
(symbol_get_obj, symbol_set_obj): Likewise.
(symbol_get_tc, symbol_set_tc): Likewise.
(symbol_begin): Initialize local_hash.
(print_symbol_value_1): Handle local symbols.
(symbol_print_statistics): Print local symbol statistics.
* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
Declare new symbols.c functions. Move many declarations here from
struc-symbol.h.
(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
(struct symbol): Move bsym to make it clearly the first field.
Remove TARGET_SYMBOL_FIELDS.
(symbolS): Don't typedef.
(struct broken_word): Remove.
(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
(symbol_clear_list_pointers): Likewise.
(symbol_insert, symbol_remove): Likewise.
(symbol_previous, symbol_append): Likewise.
(verify_symbol_chain, verify_symbol_chain_2): Likewise.
(struct local_symbol): Define.
(local_symbol_converted_p, local_symbol_mark_converted): Define.
(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
(local_symbol_get_frag, local_symbol_set_frag): Define.
(local_symbol_get_real_symbol): Define.
(local_symbol_set_real_symbol): Define.
Define.
* write.c (write_object_file): Call resolve_local_symbol_values.
* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-multi.h (struct elf_obj_sy): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
* config/tc-mcore.h: Don't include struc-symbol.h.
(TARGET_SYMBOL_FIELDS): Don't define.
(struct mcore_tc_sy): Define.
(TC_SYMFIELD_TYPE): Define.
* Many files: Use symbolS instead of struct symbol. Use new
accessor functions rather than referring to symbolS fields
directly.
* read.c (s_mri_common): Don't add in value of line_label.
* config/tc-mips.c (md_apply_fix): Correct parenthesization when
checking for SEC_LINK_ONCE.
* config/tc-sh.h (sh_fix_adjustable): Declare.
1999-06-03 02:29:48 +02:00
|
|
|
|
symbol_get_bfdsym (symp)->flags |= BSF_FUNCTION;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
|
|
|
|
|
1999-09-12 04:59:54 +02:00
|
|
|
|
/* Double check weak symbols. */
|
|
|
|
|
if (S_IS_WEAK (symp) && S_IS_COMMON (symp))
|
|
|
|
|
as_bad (_("Symbol `%s' can not be both weak and common"),
|
|
|
|
|
S_GET_NAME (symp));
|
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
if (SF_GET_TAG (symp))
|
|
|
|
|
last_tagP = symp;
|
|
|
|
|
else if (S_GET_STORAGE_CLASS (symp) == C_EOS)
|
|
|
|
|
next_set_end = last_tagP;
|
|
|
|
|
|
|
|
|
|
#ifdef OBJ_XCOFF
|
|
|
|
|
/* This is pretty horrible, but we have to set *punt correctly in
|
|
|
|
|
order to call SA_SET_SYM_ENDNDX correctly. */
|
1999-06-19 16:04:45 +02:00
|
|
|
|
if (! symbol_used_in_reloc_p (symp)
|
Add support for storing local symbols in a small structure to save
memory when assembling large files.
* as.h: Don't include struc-symbol.h.
(symbolS): Add typedef.
* symbols.c: Include struc-symbol.h.
(local_hash): New static variable.
(save_symbol_name): New static function, from symbol_create.
(symbol_create): Call save_symbol_name.
(local_symbol_count): New static variable.
(local_symbol_conversion_count): Likewise.
(LOCAL_SYMBOL_CHECK): Define.
(local_symbol_make): New static function.
(local_symbol_convert): New static function.
(colon): Handle local symbols. Create local symbol for local
label name.
(symbol_table_insert): Handle local symbols.
(symbol_find_or_make): Create local symbol for local label name.
(symbol_find_base): Check for local symbol.
(symbol_append, symbol_insert): Check for local symbols.
(symbol_clear_list_pointers, symbol_remove): Likewise.
(verify_symbol_chain): Likewise.
(copy_symbol_attributes): Likewise.
(resolve_symbol_value): Handle local symbols.
(resolve_local_symbol): New static function.
(resolve_local_symbol_values): New function.
(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
(symbol_previous, symbol_next): New functions.
(symbol_get_value_expression): Likewise.
(symbol_set_value_expression): Likewise.
(symbol_set_frag, symbol_get_frag): Likewise.
(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
(symbol_mark_used_in_reloc): Likewise.
(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
(symbol_mri_common_p): Likewise.
(symbol_mark_written, symbol_clear_written): Likewise.
(symbol_written_p): Likewise.
(symbol_mark_resolved, symbol_resolved_p): Likewise.
(symbol_section_p, symbol_equated_p): Likewise.
(symbol_constant_p): Likewise.
(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
(symbol_get_obj, symbol_set_obj): Likewise.
(symbol_get_tc, symbol_set_tc): Likewise.
(symbol_begin): Initialize local_hash.
(print_symbol_value_1): Handle local symbols.
(symbol_print_statistics): Print local symbol statistics.
* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
Declare new symbols.c functions. Move many declarations here from
struc-symbol.h.
(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
(struct symbol): Move bsym to make it clearly the first field.
Remove TARGET_SYMBOL_FIELDS.
(symbolS): Don't typedef.
(struct broken_word): Remove.
(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
(symbol_clear_list_pointers): Likewise.
(symbol_insert, symbol_remove): Likewise.
(symbol_previous, symbol_append): Likewise.
(verify_symbol_chain, verify_symbol_chain_2): Likewise.
(struct local_symbol): Define.
(local_symbol_converted_p, local_symbol_mark_converted): Define.
(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
(local_symbol_get_frag, local_symbol_set_frag): Define.
(local_symbol_get_real_symbol): Define.
(local_symbol_set_real_symbol): Define.
Define.
* write.c (write_object_file): Call resolve_local_symbol_values.
* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-multi.h (struct elf_obj_sy): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
* config/tc-mcore.h: Don't include struc-symbol.h.
(TARGET_SYMBOL_FIELDS): Don't define.
(struct mcore_tc_sy): Define.
(TC_SYMFIELD_TYPE): Define.
* Many files: Use symbolS instead of struct symbol. Use new
accessor functions rather than referring to symbolS fields
directly.
* read.c (s_mri_common): Don't add in value of line_label.
* config/tc-mips.c (md_apply_fix): Correct parenthesization when
checking for SEC_LINK_ONCE.
* config/tc-sh.h (sh_fix_adjustable): Declare.
1999-06-03 02:29:48 +02:00
|
|
|
|
&& ((symbol_get_bfdsym (symp)->flags & BSF_SECTION_SYM) != 0
|
2004-07-27 13:37:12 +02:00
|
|
|
|
|| (! (S_IS_EXTERNAL (symp) || S_IS_WEAK (symp))
|
1999-06-19 16:04:45 +02:00
|
|
|
|
&& ! symbol_get_tc (symp)->output
|
1999-05-03 09:29:11 +02:00
|
|
|
|
&& S_GET_STORAGE_CLASS (symp) != C_FILE)))
|
|
|
|
|
*punt = 1;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if (set_end != (symbolS *) NULL
|
|
|
|
|
&& ! *punt
|
Add support for storing local symbols in a small structure to save
memory when assembling large files.
* as.h: Don't include struc-symbol.h.
(symbolS): Add typedef.
* symbols.c: Include struc-symbol.h.
(local_hash): New static variable.
(save_symbol_name): New static function, from symbol_create.
(symbol_create): Call save_symbol_name.
(local_symbol_count): New static variable.
(local_symbol_conversion_count): Likewise.
(LOCAL_SYMBOL_CHECK): Define.
(local_symbol_make): New static function.
(local_symbol_convert): New static function.
(colon): Handle local symbols. Create local symbol for local
label name.
(symbol_table_insert): Handle local symbols.
(symbol_find_or_make): Create local symbol for local label name.
(symbol_find_base): Check for local symbol.
(symbol_append, symbol_insert): Check for local symbols.
(symbol_clear_list_pointers, symbol_remove): Likewise.
(verify_symbol_chain): Likewise.
(copy_symbol_attributes): Likewise.
(resolve_symbol_value): Handle local symbols.
(resolve_local_symbol): New static function.
(resolve_local_symbol_values): New function.
(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
(symbol_previous, symbol_next): New functions.
(symbol_get_value_expression): Likewise.
(symbol_set_value_expression): Likewise.
(symbol_set_frag, symbol_get_frag): Likewise.
(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
(symbol_mark_used_in_reloc): Likewise.
(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
(symbol_mri_common_p): Likewise.
(symbol_mark_written, symbol_clear_written): Likewise.
(symbol_written_p): Likewise.
(symbol_mark_resolved, symbol_resolved_p): Likewise.
(symbol_section_p, symbol_equated_p): Likewise.
(symbol_constant_p): Likewise.
(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
(symbol_get_obj, symbol_set_obj): Likewise.
(symbol_get_tc, symbol_set_tc): Likewise.
(symbol_begin): Initialize local_hash.
(print_symbol_value_1): Handle local symbols.
(symbol_print_statistics): Print local symbol statistics.
* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
Declare new symbols.c functions. Move many declarations here from
struc-symbol.h.
(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
(struct symbol): Move bsym to make it clearly the first field.
Remove TARGET_SYMBOL_FIELDS.
(symbolS): Don't typedef.
(struct broken_word): Remove.
(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
(symbol_clear_list_pointers): Likewise.
(symbol_insert, symbol_remove): Likewise.
(symbol_previous, symbol_append): Likewise.
(verify_symbol_chain, verify_symbol_chain_2): Likewise.
(struct local_symbol): Define.
(local_symbol_converted_p, local_symbol_mark_converted): Define.
(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
(local_symbol_get_frag, local_symbol_set_frag): Define.
(local_symbol_get_real_symbol): Define.
(local_symbol_set_real_symbol): Define.
Define.
* write.c (write_object_file): Call resolve_local_symbol_values.
* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-multi.h (struct elf_obj_sy): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
* config/tc-mcore.h: Don't include struc-symbol.h.
(TARGET_SYMBOL_FIELDS): Don't define.
(struct mcore_tc_sy): Define.
(TC_SYMFIELD_TYPE): Define.
* Many files: Use symbolS instead of struct symbol. Use new
accessor functions rather than referring to symbolS fields
directly.
* read.c (s_mri_common): Don't add in value of line_label.
* config/tc-mips.c (md_apply_fix): Correct parenthesization when
checking for SEC_LINK_ONCE.
* config/tc-sh.h (sh_fix_adjustable): Declare.
1999-06-03 02:29:48 +02:00
|
|
|
|
&& ((symbol_get_bfdsym (symp)->flags & BSF_NOT_AT_END) != 0
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|| (S_IS_DEFINED (symp)
|
|
|
|
|
&& ! S_IS_COMMON (symp)
|
|
|
|
|
&& (! S_IS_EXTERNAL (symp) || SF_GET_FUNCTION (symp)))))
|
|
|
|
|
{
|
|
|
|
|
SA_SET_SYM_ENDNDX (set_end, symp);
|
|
|
|
|
set_end = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
1999-08-03 17:29:04 +02:00
|
|
|
|
if (next_set_end != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (set_end != NULL)
|
2009-07-24 13:45:01 +02:00
|
|
|
|
as_warn (_("Warning: internal error: forgetting to set endndx of %s"),
|
1999-08-03 17:29:04 +02:00
|
|
|
|
S_GET_NAME (set_end));
|
|
|
|
|
set_end = next_set_end;
|
|
|
|
|
}
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2001-10-08 20:14:43 +02:00
|
|
|
|
#ifndef OBJ_XCOFF
|
1999-05-03 09:29:11 +02:00
|
|
|
|
if (! *punt
|
|
|
|
|
&& S_GET_STORAGE_CLASS (symp) == C_FCN
|
2005-03-16 15:57:00 +01:00
|
|
|
|
&& streq (S_GET_NAME (symp), ".bf"))
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
if (coff_last_bf != NULL)
|
|
|
|
|
SA_SET_SYM_ENDNDX (coff_last_bf, symp);
|
|
|
|
|
coff_last_bf = symp;
|
|
|
|
|
}
|
2001-10-08 20:14:43 +02:00
|
|
|
|
#endif
|
Add support for storing local symbols in a small structure to save
memory when assembling large files.
* as.h: Don't include struc-symbol.h.
(symbolS): Add typedef.
* symbols.c: Include struc-symbol.h.
(local_hash): New static variable.
(save_symbol_name): New static function, from symbol_create.
(symbol_create): Call save_symbol_name.
(local_symbol_count): New static variable.
(local_symbol_conversion_count): Likewise.
(LOCAL_SYMBOL_CHECK): Define.
(local_symbol_make): New static function.
(local_symbol_convert): New static function.
(colon): Handle local symbols. Create local symbol for local
label name.
(symbol_table_insert): Handle local symbols.
(symbol_find_or_make): Create local symbol for local label name.
(symbol_find_base): Check for local symbol.
(symbol_append, symbol_insert): Check for local symbols.
(symbol_clear_list_pointers, symbol_remove): Likewise.
(verify_symbol_chain): Likewise.
(copy_symbol_attributes): Likewise.
(resolve_symbol_value): Handle local symbols.
(resolve_local_symbol): New static function.
(resolve_local_symbol_values): New function.
(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
(symbol_previous, symbol_next): New functions.
(symbol_get_value_expression): Likewise.
(symbol_set_value_expression): Likewise.
(symbol_set_frag, symbol_get_frag): Likewise.
(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
(symbol_mark_used_in_reloc): Likewise.
(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
(symbol_mri_common_p): Likewise.
(symbol_mark_written, symbol_clear_written): Likewise.
(symbol_written_p): Likewise.
(symbol_mark_resolved, symbol_resolved_p): Likewise.
(symbol_section_p, symbol_equated_p): Likewise.
(symbol_constant_p): Likewise.
(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
(symbol_get_obj, symbol_set_obj): Likewise.
(symbol_get_tc, symbol_set_tc): Likewise.
(symbol_begin): Initialize local_hash.
(print_symbol_value_1): Handle local symbols.
(symbol_print_statistics): Print local symbol statistics.
* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
Declare new symbols.c functions. Move many declarations here from
struc-symbol.h.
(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
(struct symbol): Move bsym to make it clearly the first field.
Remove TARGET_SYMBOL_FIELDS.
(symbolS): Don't typedef.
(struct broken_word): Remove.
(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
(symbol_clear_list_pointers): Likewise.
(symbol_insert, symbol_remove): Likewise.
(symbol_previous, symbol_append): Likewise.
(verify_symbol_chain, verify_symbol_chain_2): Likewise.
(struct local_symbol): Define.
(local_symbol_converted_p, local_symbol_mark_converted): Define.
(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
(local_symbol_get_frag, local_symbol_set_frag): Define.
(local_symbol_get_real_symbol): Define.
(local_symbol_set_real_symbol): Define.
Define.
* write.c (write_object_file): Call resolve_local_symbol_values.
* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-multi.h (struct elf_obj_sy): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
* config/tc-mcore.h: Don't include struc-symbol.h.
(TARGET_SYMBOL_FIELDS): Don't define.
(struct mcore_tc_sy): Define.
(TC_SYMFIELD_TYPE): Define.
* Many files: Use symbolS instead of struct symbol. Use new
accessor functions rather than referring to symbolS fields
directly.
* read.c (s_mri_common): Don't add in value of line_label.
* config/tc-mips.c (md_apply_fix): Correct parenthesization when
checking for SEC_LINK_ONCE.
* config/tc-sh.h (sh_fix_adjustable): Declare.
1999-06-03 02:29:48 +02:00
|
|
|
|
if (coffsymbol (symbol_get_bfdsym (symp))->lineno)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
struct line_no *lptr;
|
|
|
|
|
alent *l;
|
|
|
|
|
|
Add support for storing local symbols in a small structure to save
memory when assembling large files.
* as.h: Don't include struc-symbol.h.
(symbolS): Add typedef.
* symbols.c: Include struc-symbol.h.
(local_hash): New static variable.
(save_symbol_name): New static function, from symbol_create.
(symbol_create): Call save_symbol_name.
(local_symbol_count): New static variable.
(local_symbol_conversion_count): Likewise.
(LOCAL_SYMBOL_CHECK): Define.
(local_symbol_make): New static function.
(local_symbol_convert): New static function.
(colon): Handle local symbols. Create local symbol for local
label name.
(symbol_table_insert): Handle local symbols.
(symbol_find_or_make): Create local symbol for local label name.
(symbol_find_base): Check for local symbol.
(symbol_append, symbol_insert): Check for local symbols.
(symbol_clear_list_pointers, symbol_remove): Likewise.
(verify_symbol_chain): Likewise.
(copy_symbol_attributes): Likewise.
(resolve_symbol_value): Handle local symbols.
(resolve_local_symbol): New static function.
(resolve_local_symbol_values): New function.
(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
(symbol_previous, symbol_next): New functions.
(symbol_get_value_expression): Likewise.
(symbol_set_value_expression): Likewise.
(symbol_set_frag, symbol_get_frag): Likewise.
(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
(symbol_mark_used_in_reloc): Likewise.
(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
(symbol_mri_common_p): Likewise.
(symbol_mark_written, symbol_clear_written): Likewise.
(symbol_written_p): Likewise.
(symbol_mark_resolved, symbol_resolved_p): Likewise.
(symbol_section_p, symbol_equated_p): Likewise.
(symbol_constant_p): Likewise.
(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
(symbol_get_obj, symbol_set_obj): Likewise.
(symbol_get_tc, symbol_set_tc): Likewise.
(symbol_begin): Initialize local_hash.
(print_symbol_value_1): Handle local symbols.
(symbol_print_statistics): Print local symbol statistics.
* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
Declare new symbols.c functions. Move many declarations here from
struc-symbol.h.
(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
(struct symbol): Move bsym to make it clearly the first field.
Remove TARGET_SYMBOL_FIELDS.
(symbolS): Don't typedef.
(struct broken_word): Remove.
(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
(symbol_clear_list_pointers): Likewise.
(symbol_insert, symbol_remove): Likewise.
(symbol_previous, symbol_append): Likewise.
(verify_symbol_chain, verify_symbol_chain_2): Likewise.
(struct local_symbol): Define.
(local_symbol_converted_p, local_symbol_mark_converted): Define.
(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
(local_symbol_get_frag, local_symbol_set_frag): Define.
(local_symbol_get_real_symbol): Define.
(local_symbol_set_real_symbol): Define.
Define.
* write.c (write_object_file): Call resolve_local_symbol_values.
* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-multi.h (struct elf_obj_sy): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
* config/tc-mcore.h: Don't include struc-symbol.h.
(TARGET_SYMBOL_FIELDS): Don't define.
(struct mcore_tc_sy): Define.
(TC_SYMFIELD_TYPE): Define.
* Many files: Use symbolS instead of struct symbol. Use new
accessor functions rather than referring to symbolS fields
directly.
* read.c (s_mri_common): Don't add in value of line_label.
* config/tc-mips.c (md_apply_fix): Correct parenthesization when
checking for SEC_LINK_ONCE.
* config/tc-sh.h (sh_fix_adjustable): Declare.
1999-06-03 02:29:48 +02:00
|
|
|
|
lptr = (struct line_no *) coffsymbol (symbol_get_bfdsym (symp))->lineno;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
for (i = 0; lptr; lptr = lptr->next)
|
|
|
|
|
i++;
|
Add support for storing local symbols in a small structure to save
memory when assembling large files.
* as.h: Don't include struc-symbol.h.
(symbolS): Add typedef.
* symbols.c: Include struc-symbol.h.
(local_hash): New static variable.
(save_symbol_name): New static function, from symbol_create.
(symbol_create): Call save_symbol_name.
(local_symbol_count): New static variable.
(local_symbol_conversion_count): Likewise.
(LOCAL_SYMBOL_CHECK): Define.
(local_symbol_make): New static function.
(local_symbol_convert): New static function.
(colon): Handle local symbols. Create local symbol for local
label name.
(symbol_table_insert): Handle local symbols.
(symbol_find_or_make): Create local symbol for local label name.
(symbol_find_base): Check for local symbol.
(symbol_append, symbol_insert): Check for local symbols.
(symbol_clear_list_pointers, symbol_remove): Likewise.
(verify_symbol_chain): Likewise.
(copy_symbol_attributes): Likewise.
(resolve_symbol_value): Handle local symbols.
(resolve_local_symbol): New static function.
(resolve_local_symbol_values): New function.
(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
(symbol_previous, symbol_next): New functions.
(symbol_get_value_expression): Likewise.
(symbol_set_value_expression): Likewise.
(symbol_set_frag, symbol_get_frag): Likewise.
(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
(symbol_mark_used_in_reloc): Likewise.
(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
(symbol_mri_common_p): Likewise.
(symbol_mark_written, symbol_clear_written): Likewise.
(symbol_written_p): Likewise.
(symbol_mark_resolved, symbol_resolved_p): Likewise.
(symbol_section_p, symbol_equated_p): Likewise.
(symbol_constant_p): Likewise.
(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
(symbol_get_obj, symbol_set_obj): Likewise.
(symbol_get_tc, symbol_set_tc): Likewise.
(symbol_begin): Initialize local_hash.
(print_symbol_value_1): Handle local symbols.
(symbol_print_statistics): Print local symbol statistics.
* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
Declare new symbols.c functions. Move many declarations here from
struc-symbol.h.
(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
(struct symbol): Move bsym to make it clearly the first field.
Remove TARGET_SYMBOL_FIELDS.
(symbolS): Don't typedef.
(struct broken_word): Remove.
(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
(symbol_clear_list_pointers): Likewise.
(symbol_insert, symbol_remove): Likewise.
(symbol_previous, symbol_append): Likewise.
(verify_symbol_chain, verify_symbol_chain_2): Likewise.
(struct local_symbol): Define.
(local_symbol_converted_p, local_symbol_mark_converted): Define.
(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
(local_symbol_get_frag, local_symbol_set_frag): Define.
(local_symbol_get_real_symbol): Define.
(local_symbol_set_real_symbol): Define.
Define.
* write.c (write_object_file): Call resolve_local_symbol_values.
* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-multi.h (struct elf_obj_sy): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
* config/tc-mcore.h: Don't include struc-symbol.h.
(TARGET_SYMBOL_FIELDS): Don't define.
(struct mcore_tc_sy): Define.
(TC_SYMFIELD_TYPE): Define.
* Many files: Use symbolS instead of struct symbol. Use new
accessor functions rather than referring to symbolS fields
directly.
* read.c (s_mri_common): Don't add in value of line_label.
* config/tc-mips.c (md_apply_fix): Correct parenthesization when
checking for SEC_LINK_ONCE.
* config/tc-sh.h (sh_fix_adjustable): Declare.
1999-06-03 02:29:48 +02:00
|
|
|
|
lptr = (struct line_no *) coffsymbol (symbol_get_bfdsym (symp))->lineno;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* We need i entries for line numbers, plus 1 for the first
|
|
|
|
|
entry which BFD will override, plus 1 for the last zero
|
|
|
|
|
entry (a marker for BFD). */
|
2016-04-06 22:26:46 +02:00
|
|
|
|
l = XNEWVEC (alent, (i + 2));
|
Add support for storing local symbols in a small structure to save
memory when assembling large files.
* as.h: Don't include struc-symbol.h.
(symbolS): Add typedef.
* symbols.c: Include struc-symbol.h.
(local_hash): New static variable.
(save_symbol_name): New static function, from symbol_create.
(symbol_create): Call save_symbol_name.
(local_symbol_count): New static variable.
(local_symbol_conversion_count): Likewise.
(LOCAL_SYMBOL_CHECK): Define.
(local_symbol_make): New static function.
(local_symbol_convert): New static function.
(colon): Handle local symbols. Create local symbol for local
label name.
(symbol_table_insert): Handle local symbols.
(symbol_find_or_make): Create local symbol for local label name.
(symbol_find_base): Check for local symbol.
(symbol_append, symbol_insert): Check for local symbols.
(symbol_clear_list_pointers, symbol_remove): Likewise.
(verify_symbol_chain): Likewise.
(copy_symbol_attributes): Likewise.
(resolve_symbol_value): Handle local symbols.
(resolve_local_symbol): New static function.
(resolve_local_symbol_values): New function.
(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
(symbol_previous, symbol_next): New functions.
(symbol_get_value_expression): Likewise.
(symbol_set_value_expression): Likewise.
(symbol_set_frag, symbol_get_frag): Likewise.
(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
(symbol_mark_used_in_reloc): Likewise.
(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
(symbol_mri_common_p): Likewise.
(symbol_mark_written, symbol_clear_written): Likewise.
(symbol_written_p): Likewise.
(symbol_mark_resolved, symbol_resolved_p): Likewise.
(symbol_section_p, symbol_equated_p): Likewise.
(symbol_constant_p): Likewise.
(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
(symbol_get_obj, symbol_set_obj): Likewise.
(symbol_get_tc, symbol_set_tc): Likewise.
(symbol_begin): Initialize local_hash.
(print_symbol_value_1): Handle local symbols.
(symbol_print_statistics): Print local symbol statistics.
* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
Declare new symbols.c functions. Move many declarations here from
struc-symbol.h.
(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
(struct symbol): Move bsym to make it clearly the first field.
Remove TARGET_SYMBOL_FIELDS.
(symbolS): Don't typedef.
(struct broken_word): Remove.
(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
(symbol_clear_list_pointers): Likewise.
(symbol_insert, symbol_remove): Likewise.
(symbol_previous, symbol_append): Likewise.
(verify_symbol_chain, verify_symbol_chain_2): Likewise.
(struct local_symbol): Define.
(local_symbol_converted_p, local_symbol_mark_converted): Define.
(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
(local_symbol_get_frag, local_symbol_set_frag): Define.
(local_symbol_get_real_symbol): Define.
(local_symbol_set_real_symbol): Define.
Define.
* write.c (write_object_file): Call resolve_local_symbol_values.
* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
* config/obj-multi.h (struct elf_obj_sy): Add local field. If
ECOFF_DEBUGGING, add ECOFF fields.
(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
* config/tc-mcore.h: Don't include struc-symbol.h.
(TARGET_SYMBOL_FIELDS): Don't define.
(struct mcore_tc_sy): Define.
(TC_SYMFIELD_TYPE): Define.
* Many files: Use symbolS instead of struct symbol. Use new
accessor functions rather than referring to symbolS fields
directly.
* read.c (s_mri_common): Don't add in value of line_label.
* config/tc-mips.c (md_apply_fix): Correct parenthesization when
checking for SEC_LINK_ONCE.
* config/tc-sh.h (sh_fix_adjustable): Declare.
1999-06-03 02:29:48 +02:00
|
|
|
|
coffsymbol (symbol_get_bfdsym (symp))->lineno = l;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
l[i + 1].line_number = 0;
|
|
|
|
|
l[i + 1].u.sym = NULL;
|
|
|
|
|
for (; i > 0; i--)
|
|
|
|
|
{
|
|
|
|
|
if (lptr->frag)
|
2000-02-03 19:20:23 +01:00
|
|
|
|
lptr->l.u.offset += lptr->frag->fr_address / OCTETS_PER_BYTE;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
l[i] = lptr->l;
|
|
|
|
|
lptr = lptr->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
coff_adjust_section_syms (bfd *abfd ATTRIBUTE_UNUSED,
|
|
|
|
|
asection *sec,
|
|
|
|
|
void * x ATTRIBUTE_UNUSED)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
symbolS *secsym;
|
|
|
|
|
segment_info_type *seginfo = seg_info (sec);
|
|
|
|
|
int nlnno, nrelocs = 0;
|
|
|
|
|
|
|
|
|
|
/* RS/6000 gas creates a .debug section manually in ppc_frob_file in
|
|
|
|
|
tc-ppc.c. Do not get confused by it. */
|
|
|
|
|
if (seginfo == NULL)
|
|
|
|
|
return;
|
|
|
|
|
|
2005-03-16 15:57:00 +01:00
|
|
|
|
if (streq (sec->name, ".text"))
|
1999-05-03 09:29:11 +02:00
|
|
|
|
nlnno = coff_n_line_nos;
|
|
|
|
|
else
|
|
|
|
|
nlnno = 0;
|
|
|
|
|
{
|
|
|
|
|
/* @@ Hope that none of the fixups expand to more than one reloc
|
|
|
|
|
entry... */
|
|
|
|
|
fixS *fixp = seginfo->fix_root;
|
|
|
|
|
while (fixp)
|
|
|
|
|
{
|
|
|
|
|
if (! fixp->fx_done)
|
|
|
|
|
nrelocs++;
|
|
|
|
|
fixp = fixp->fx_next;
|
|
|
|
|
}
|
|
|
|
|
}
|
2004-06-15 03:16:35 +02:00
|
|
|
|
if (bfd_get_section_size (sec) == 0
|
1999-05-03 09:29:11 +02:00
|
|
|
|
&& nrelocs == 0
|
|
|
|
|
&& nlnno == 0
|
|
|
|
|
&& sec != text_section
|
|
|
|
|
&& sec != data_section
|
|
|
|
|
&& sec != bss_section)
|
|
|
|
|
return;
|
2005-03-16 15:57:00 +01:00
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
secsym = section_symbol (sec);
|
1999-09-12 05:44:42 +02:00
|
|
|
|
/* This is an estimate; we'll plug in the real value using
|
|
|
|
|
SET_SECTION_RELOCS later */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
SA_SET_SCN_NRELOC (secsym, nrelocs);
|
|
|
|
|
SA_SET_SCN_NLINNO (secsym, nlnno);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
coff_frob_file_after_relocs (void)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
2005-03-16 15:57:00 +01:00
|
|
|
|
bfd_map_over_sections (stdoutput, coff_adjust_section_syms, NULL);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
|
|
|
|
|
2002-05-23 12:45:14 +02:00
|
|
|
|
/* Implement the .section pseudo op:
|
|
|
|
|
.section name {, "flags"}
|
|
|
|
|
^ ^
|
|
|
|
|
| +--- optional flags: 'b' for bss
|
|
|
|
|
| 'i' for info
|
|
|
|
|
+-- section name 'l' for lib
|
|
|
|
|
'n' for noload
|
|
|
|
|
'o' for over
|
|
|
|
|
'w' for data
|
|
|
|
|
'd' (apparently m88k for data)
|
2011-09-27 20:57:22 +02:00
|
|
|
|
'e' for exclude
|
2002-05-23 12:45:14 +02:00
|
|
|
|
'x' for text
|
|
|
|
|
'r' for read-only data
|
|
|
|
|
's' for shared data (PE)
|
2009-05-17 22:09:02 +02:00
|
|
|
|
'y' for noread
|
2010-01-27 23:01:38 +01:00
|
|
|
|
'0' - '9' for power-of-two alignment (GNU extension).
|
2002-05-23 12:45:14 +02:00
|
|
|
|
But if the argument is not a quoted string, treat it as a
|
|
|
|
|
subsegment number.
|
|
|
|
|
|
|
|
|
|
Note the 'a' flag is silently ignored. This allows the same
|
|
|
|
|
.section directive to be parsed in both ELF and COFF formats. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
obj_coff_section (int ignore ATTRIBUTE_UNUSED)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* Strip out the section name. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
char *section_name;
|
|
|
|
|
char c;
|
2010-01-27 23:01:38 +01:00
|
|
|
|
int alignment = -1;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
char *name;
|
|
|
|
|
unsigned int exp;
|
2000-06-30 01:54:13 +02:00
|
|
|
|
flagword flags, oldflags;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
asection *sec;
|
|
|
|
|
|
|
|
|
|
if (flag_mri)
|
|
|
|
|
{
|
|
|
|
|
char type;
|
|
|
|
|
|
|
|
|
|
s_mri_sect (&type);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2015-08-21 17:42:14 +02:00
|
|
|
|
c = get_symbol_name (§ion_name);
|
2016-03-28 11:49:15 +02:00
|
|
|
|
name = xmemdup0 (section_name, input_line_pointer - section_name);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
*input_line_pointer = c;
|
2015-08-21 17:42:14 +02:00
|
|
|
|
SKIP_WHITESPACE_AFTER_NAME ();
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
exp = 0;
|
2000-06-30 01:54:13 +02:00
|
|
|
|
flags = SEC_NO_FLAGS;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
if (*input_line_pointer == ',')
|
|
|
|
|
{
|
|
|
|
|
++input_line_pointer;
|
|
|
|
|
SKIP_WHITESPACE ();
|
|
|
|
|
if (*input_line_pointer != '"')
|
|
|
|
|
exp = get_absolute_expression ();
|
|
|
|
|
else
|
|
|
|
|
{
|
2005-11-07 18:57:00 +01:00
|
|
|
|
unsigned char attr;
|
|
|
|
|
int readonly_removed = 0;
|
|
|
|
|
int load_removed = 0;
|
|
|
|
|
|
|
|
|
|
while (attr = *++input_line_pointer,
|
|
|
|
|
attr != '"'
|
|
|
|
|
&& ! is_end_of_line[attr])
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
2010-01-27 23:01:38 +01:00
|
|
|
|
if (ISDIGIT (attr))
|
|
|
|
|
{
|
|
|
|
|
alignment = attr - '0';
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2005-11-07 18:57:00 +01:00
|
|
|
|
switch (attr)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
2011-09-27 20:57:22 +02:00
|
|
|
|
case 'e':
|
|
|
|
|
/* Exclude section from linking. */
|
|
|
|
|
flags |= SEC_EXCLUDE;
|
|
|
|
|
break;
|
|
|
|
|
|
2005-11-07 18:57:00 +01:00
|
|
|
|
case 'b':
|
|
|
|
|
/* Uninitialised data section. */
|
|
|
|
|
flags |= SEC_ALLOC;
|
|
|
|
|
flags &=~ SEC_LOAD;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'n':
|
|
|
|
|
/* Section not loaded. */
|
|
|
|
|
flags &=~ SEC_LOAD;
|
|
|
|
|
flags |= SEC_NEVER_LOAD;
|
|
|
|
|
load_removed = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 's':
|
|
|
|
|
/* Shared section. */
|
|
|
|
|
flags |= SEC_COFF_SHARED;
|
|
|
|
|
/* Fall through. */
|
|
|
|
|
case 'd':
|
|
|
|
|
/* Data section. */
|
|
|
|
|
flags |= SEC_DATA;
|
|
|
|
|
if (! load_removed)
|
|
|
|
|
flags |= SEC_LOAD;
|
|
|
|
|
flags &=~ SEC_READONLY;
|
|
|
|
|
break;
|
2002-11-04 17:10:56 +01:00
|
|
|
|
|
2005-11-07 18:57:00 +01:00
|
|
|
|
case 'w':
|
|
|
|
|
/* Writable section. */
|
|
|
|
|
flags &=~ SEC_READONLY;
|
|
|
|
|
readonly_removed = 1;
|
|
|
|
|
break;
|
2002-11-04 17:10:56 +01:00
|
|
|
|
|
2005-11-07 18:57:00 +01:00
|
|
|
|
case 'a':
|
|
|
|
|
/* Ignore. Here for compatibility with ELF. */
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'r': /* Read-only section. Implies a data section. */
|
|
|
|
|
readonly_removed = 0;
|
|
|
|
|
/* Fall through. */
|
|
|
|
|
case 'x': /* Executable section. */
|
|
|
|
|
/* If we are setting the 'x' attribute or if the 'r'
|
|
|
|
|
attribute is being used to restore the readonly status
|
|
|
|
|
of a code section (eg "wxr") then set the SEC_CODE flag,
|
|
|
|
|
otherwise set the SEC_DATA flag. */
|
|
|
|
|
flags |= (attr == 'x' || (flags & SEC_CODE) ? SEC_CODE : SEC_DATA);
|
|
|
|
|
if (! load_removed)
|
|
|
|
|
flags |= SEC_LOAD;
|
|
|
|
|
/* Note - the READONLY flag is set here, even for the 'x'
|
* config/obj-coff.c, config/tc-arm.c, config/tc-bfin.c,
config/tc-cris.c, config/tc-crx.c, config/tc-i386.c,
config/tc-ia64.c, config/tc-maxq.c, config/tc-maxq.h,
config/tc-mips.c, config/tc-msp430.c, config/tc-sh.c,
config/tc-tic4x.c, config/tc-xtensa.c: Fix comment typos.
2006-04-24 00:12:43 +02:00
|
|
|
|
attribute in order to be compatible with the MSVC
|
2005-11-07 18:57:00 +01:00
|
|
|
|
linker. */
|
|
|
|
|
if (! readonly_removed)
|
|
|
|
|
flags |= SEC_READONLY;
|
|
|
|
|
break;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2009-05-17 22:09:02 +02:00
|
|
|
|
case 'y':
|
|
|
|
|
flags |= SEC_COFF_NOREAD | SEC_READONLY;
|
|
|
|
|
break;
|
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
case 'i': /* STYP_INFO */
|
|
|
|
|
case 'l': /* STYP_LIB */
|
|
|
|
|
case 'o': /* STYP_OVER */
|
2005-11-07 18:57:00 +01:00
|
|
|
|
as_warn (_("unsupported section attribute '%c'"), attr);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
2005-11-07 18:57:00 +01:00
|
|
|
|
as_warn (_("unknown section attribute '%c'"), attr);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-11-07 18:57:00 +01:00
|
|
|
|
if (attr == '"')
|
1999-05-03 09:29:11 +02:00
|
|
|
|
++input_line_pointer;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sec = subseg_new (name, (subsegT) exp);
|
2012-10-18 19:00:56 +02:00
|
|
|
|
|
2010-01-27 23:01:38 +01:00
|
|
|
|
if (alignment >= 0)
|
|
|
|
|
sec->alignment_power = alignment;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2000-06-30 01:54:13 +02:00
|
|
|
|
oldflags = bfd_get_section_flags (stdoutput, sec);
|
|
|
|
|
if (oldflags == SEC_NO_FLAGS)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
2000-06-30 01:54:13 +02:00
|
|
|
|
/* Set section flags for a new section just created by subseg_new.
|
|
|
|
|
Provide a default if no flags were parsed. */
|
|
|
|
|
if (flags == SEC_NO_FLAGS)
|
2000-07-06 19:21:00 +02:00
|
|
|
|
flags = TC_COFF_SECTION_DEFAULT_ATTRIBUTES;
|
2000-09-12 23:49:09 +02:00
|
|
|
|
|
2000-06-30 01:54:13 +02:00
|
|
|
|
#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
|
|
|
|
|
relocs which refer to non-local symbols in these sections. */
|
2005-03-16 15:57:00 +01:00
|
|
|
|
if (strneq (name, ".gnu.linkonce", sizeof (".gnu.linkonce") - 1))
|
2002-05-09 15:12:57 +02:00
|
|
|
|
flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD;
|
2000-06-30 01:54:13 +02:00
|
|
|
|
#endif
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
if (! bfd_set_section_flags (stdoutput, sec, flags))
|
2002-05-09 15:12:57 +02:00
|
|
|
|
as_warn (_("error setting flags for \"%s\": %s"),
|
|
|
|
|
bfd_section_name (stdoutput, sec),
|
|
|
|
|
bfd_errmsg (bfd_get_error ()));
|
2000-06-30 01:54:13 +02:00
|
|
|
|
}
|
|
|
|
|
else if (flags != SEC_NO_FLAGS)
|
|
|
|
|
{
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* This section's attributes have already been set. Warn if the
|
2000-06-30 01:54:13 +02:00
|
|
|
|
attributes don't match. */
|
2001-06-10 16:07:12 +02:00
|
|
|
|
flagword matchflags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE
|
2009-05-17 22:09:02 +02:00
|
|
|
|
| SEC_DATA | SEC_COFF_SHARED | SEC_NEVER_LOAD
|
|
|
|
|
| SEC_COFF_NOREAD);
|
2000-06-30 01:54:13 +02:00
|
|
|
|
if ((flags ^ oldflags) & matchflags)
|
|
|
|
|
as_warn (_("Ignoring changed section attributes for %s"), name);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
demand_empty_rest_of_line ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
coff_adjust_symtab (void)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
if (symbol_rootP == NULL
|
|
|
|
|
|| S_GET_STORAGE_CLASS (symbol_rootP) != C_FILE)
|
2004-11-19 13:20:25 +01:00
|
|
|
|
c_dot_file_symbol ("fake", 0);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
coff_frob_section (segT sec)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
segT strsec;
|
|
|
|
|
char *p;
|
|
|
|
|
fragS *fragp;
|
* config/obj-evax.h (S_SET_OTHER, S_SET_TYPE, S_SET_DESC): Don't define.
* config/tc-crx.c (gettrap): Constify arg.
(handle_LoadStor, get_cinv_parameters): Likewise.
(getreg_image): Fix enum warning
(md_assemble): Restore input line char.
* config/tc-hppa.c (tc_gen_reloc): Fix enum warning.
* config/tc-i960.c (mem_fmt): Rename var to fix shadow warning.
* config/tc-sh.c (sh_fdpic): Only define when OBJ_ELF.
(build_Mytes): Fix build failure for non-elf targets.
* config/tc-tic4x.c (tic4x_eval): Restore terminator char.
* config/tc-xtensa.c (xtensa_end_directive): Fix switch enum warning.
* cgen.c (gas_cgen_md_apply_fix): Avoid set but unused warning.
* ecoff.c (add_ecoff_symbol): Likewise.
* itbl-ops.c (append_insns_as_macros): Likewise.
* listing.c (debugging_pseudo): Likewise.
* read.c (s_mri_common, stringer): Likewise.
* config/obj-coff.c (coff_frob_section): Likewise.
* config/tc-alpha.c (emit_ldgp, s_alpha_proc): Likewise.
* config/tc-arm.c (my_get_expression): Likewise.
* config/tc-hppa.c (process_exit, pa_type_args): Likewise.
* config/tc-m32c.c (md_assemble): Likewise.
* config/tc-microblaze.c (md_convert_frag): Likewise.
* config/tc-mips.c (s_change_section): Likewise.
* config/tc-mt.c (mt_fix_adjustable): Likewise.
* config/tc-xtensa.c (xtensa_literal_pseudo): Likewise.
* config/obj-aout.c (obj_aout_frob_symbol): Delete set but otherwise
unused vars.
* config/tc-alpha.c (load_expression): Likewise.
(s_alpha_rdata, s_alpha_section, s_alpha_prologue): Likewise.
* config/tc-arm.c (parse_neon_el_struct_list): Likewise.
* config/tc-avr.c (extract_word): Likewise.
* config/tc-cris.c (cris_get_expression): Likewise.
* config/tc-d30v.c (build_insn, find_format): Likewise.
* config/tc-dlx.c (machine_ip): Likewise.
* config/tc-hppa.c (pa_get_absolute_expression): Likewise.
* config/tc-i370.c (md_assemble): Likewise.
* config/tc-i960.c (brtab_emit): Likewise.
* config/tc-iq2000.c (s_iq2000_ent): Likewise.
* config/tc-m32c.c (md_convert_frag): Likewise.
* config/tc-m68hc11.c (fixup24, build_jump_insn): Likewise.
(md_estimate_size_before_relax, md_apply_fix): Likewise.
* config/tc-m68k.c (md_show_usage): Likewise.
* config/tc-microblaze.c (microblaze_s_lcomm): Likewise.
* config/tc-mips.c (s_mips_end): Likewise.
* config/tc-mmix.c (mmix_byte, mmix_cons): Likewise.
* config/tc-mn10300.c (md_assemble): Likewise.
* config/tc-msp430.c (extract_word): Likewise.
* config/tc-mt.c (md_assemble): Likewise.
* config/tc-or32.c (machine_ip): Likewise.
* config/tc-pj.c (md_apply_fix): Likewise.
* config/tc-s390.c (md_gather_operands): Likewise.
* config/tc-sh.c (sh_cons_align): Likewise.
* config/tc-sparc.c (sparc_cons_align): Likewise.
* config/tc-tic4x.c (tic4x_sect): Likewise.
* config/tc-tic54x.c (tic54x_stringer): Likewise.
* config/tc-vax.c (vip_op): Likewise.
* config/tc-xstormy16.c (xstormy16_cons_fix_new): Likewise.
* config/tc-xtensa.c (md_assemble): Likewise.
(xtensa_fix_short_loop_frags, convert_frag_immed): Likewise.
(xtensa_move_literals): Likewise.
2010-06-28 16:06:57 +02:00
|
|
|
|
bfd_vma n_entries;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* The COFF back end in BFD requires that all section sizes be
|
2000-02-03 19:20:23 +01:00
|
|
|
|
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
|
2000-09-12 23:49:09 +02:00
|
|
|
|
section alignment, then skip this step, as TICOFF does. */
|
* config/obj-evax.h (S_SET_OTHER, S_SET_TYPE, S_SET_DESC): Don't define.
* config/tc-crx.c (gettrap): Constify arg.
(handle_LoadStor, get_cinv_parameters): Likewise.
(getreg_image): Fix enum warning
(md_assemble): Restore input line char.
* config/tc-hppa.c (tc_gen_reloc): Fix enum warning.
* config/tc-i960.c (mem_fmt): Rename var to fix shadow warning.
* config/tc-sh.c (sh_fdpic): Only define when OBJ_ELF.
(build_Mytes): Fix build failure for non-elf targets.
* config/tc-tic4x.c (tic4x_eval): Restore terminator char.
* config/tc-xtensa.c (xtensa_end_directive): Fix switch enum warning.
* cgen.c (gas_cgen_md_apply_fix): Avoid set but unused warning.
* ecoff.c (add_ecoff_symbol): Likewise.
* itbl-ops.c (append_insns_as_macros): Likewise.
* listing.c (debugging_pseudo): Likewise.
* read.c (s_mri_common, stringer): Likewise.
* config/obj-coff.c (coff_frob_section): Likewise.
* config/tc-alpha.c (emit_ldgp, s_alpha_proc): Likewise.
* config/tc-arm.c (my_get_expression): Likewise.
* config/tc-hppa.c (process_exit, pa_type_args): Likewise.
* config/tc-m32c.c (md_assemble): Likewise.
* config/tc-microblaze.c (md_convert_frag): Likewise.
* config/tc-mips.c (s_change_section): Likewise.
* config/tc-mt.c (mt_fix_adjustable): Likewise.
* config/tc-xtensa.c (xtensa_literal_pseudo): Likewise.
* config/obj-aout.c (obj_aout_frob_symbol): Delete set but otherwise
unused vars.
* config/tc-alpha.c (load_expression): Likewise.
(s_alpha_rdata, s_alpha_section, s_alpha_prologue): Likewise.
* config/tc-arm.c (parse_neon_el_struct_list): Likewise.
* config/tc-avr.c (extract_word): Likewise.
* config/tc-cris.c (cris_get_expression): Likewise.
* config/tc-d30v.c (build_insn, find_format): Likewise.
* config/tc-dlx.c (machine_ip): Likewise.
* config/tc-hppa.c (pa_get_absolute_expression): Likewise.
* config/tc-i370.c (md_assemble): Likewise.
* config/tc-i960.c (brtab_emit): Likewise.
* config/tc-iq2000.c (s_iq2000_ent): Likewise.
* config/tc-m32c.c (md_convert_frag): Likewise.
* config/tc-m68hc11.c (fixup24, build_jump_insn): Likewise.
(md_estimate_size_before_relax, md_apply_fix): Likewise.
* config/tc-m68k.c (md_show_usage): Likewise.
* config/tc-microblaze.c (microblaze_s_lcomm): Likewise.
* config/tc-mips.c (s_mips_end): Likewise.
* config/tc-mmix.c (mmix_byte, mmix_cons): Likewise.
* config/tc-mn10300.c (md_assemble): Likewise.
* config/tc-msp430.c (extract_word): Likewise.
* config/tc-mt.c (md_assemble): Likewise.
* config/tc-or32.c (machine_ip): Likewise.
* config/tc-pj.c (md_apply_fix): Likewise.
* config/tc-s390.c (md_gather_operands): Likewise.
* config/tc-sh.c (sh_cons_align): Likewise.
* config/tc-sparc.c (sparc_cons_align): Likewise.
* config/tc-tic4x.c (tic4x_sect): Likewise.
* config/tc-tic54x.c (tic54x_stringer): Likewise.
* config/tc-vax.c (vip_op): Likewise.
* config/tc-xstormy16.c (xstormy16_cons_fix_new): Likewise.
* config/tc-xtensa.c (md_assemble): Likewise.
(xtensa_fix_short_loop_frags, convert_frag_immed): Likewise.
(xtensa_move_literals): Likewise.
2010-06-28 16:06:57 +02:00
|
|
|
|
bfd_vma size = bfd_get_section_size (sec);
|
2000-02-03 19:20:23 +01:00
|
|
|
|
#if !defined(TICOFF)
|
* config/obj-evax.h (S_SET_OTHER, S_SET_TYPE, S_SET_DESC): Don't define.
* config/tc-crx.c (gettrap): Constify arg.
(handle_LoadStor, get_cinv_parameters): Likewise.
(getreg_image): Fix enum warning
(md_assemble): Restore input line char.
* config/tc-hppa.c (tc_gen_reloc): Fix enum warning.
* config/tc-i960.c (mem_fmt): Rename var to fix shadow warning.
* config/tc-sh.c (sh_fdpic): Only define when OBJ_ELF.
(build_Mytes): Fix build failure for non-elf targets.
* config/tc-tic4x.c (tic4x_eval): Restore terminator char.
* config/tc-xtensa.c (xtensa_end_directive): Fix switch enum warning.
* cgen.c (gas_cgen_md_apply_fix): Avoid set but unused warning.
* ecoff.c (add_ecoff_symbol): Likewise.
* itbl-ops.c (append_insns_as_macros): Likewise.
* listing.c (debugging_pseudo): Likewise.
* read.c (s_mri_common, stringer): Likewise.
* config/obj-coff.c (coff_frob_section): Likewise.
* config/tc-alpha.c (emit_ldgp, s_alpha_proc): Likewise.
* config/tc-arm.c (my_get_expression): Likewise.
* config/tc-hppa.c (process_exit, pa_type_args): Likewise.
* config/tc-m32c.c (md_assemble): Likewise.
* config/tc-microblaze.c (md_convert_frag): Likewise.
* config/tc-mips.c (s_change_section): Likewise.
* config/tc-mt.c (mt_fix_adjustable): Likewise.
* config/tc-xtensa.c (xtensa_literal_pseudo): Likewise.
* config/obj-aout.c (obj_aout_frob_symbol): Delete set but otherwise
unused vars.
* config/tc-alpha.c (load_expression): Likewise.
(s_alpha_rdata, s_alpha_section, s_alpha_prologue): Likewise.
* config/tc-arm.c (parse_neon_el_struct_list): Likewise.
* config/tc-avr.c (extract_word): Likewise.
* config/tc-cris.c (cris_get_expression): Likewise.
* config/tc-d30v.c (build_insn, find_format): Likewise.
* config/tc-dlx.c (machine_ip): Likewise.
* config/tc-hppa.c (pa_get_absolute_expression): Likewise.
* config/tc-i370.c (md_assemble): Likewise.
* config/tc-i960.c (brtab_emit): Likewise.
* config/tc-iq2000.c (s_iq2000_ent): Likewise.
* config/tc-m32c.c (md_convert_frag): Likewise.
* config/tc-m68hc11.c (fixup24, build_jump_insn): Likewise.
(md_estimate_size_before_relax, md_apply_fix): Likewise.
* config/tc-m68k.c (md_show_usage): Likewise.
* config/tc-microblaze.c (microblaze_s_lcomm): Likewise.
* config/tc-mips.c (s_mips_end): Likewise.
* config/tc-mmix.c (mmix_byte, mmix_cons): Likewise.
* config/tc-mn10300.c (md_assemble): Likewise.
* config/tc-msp430.c (extract_word): Likewise.
* config/tc-mt.c (md_assemble): Likewise.
* config/tc-or32.c (machine_ip): Likewise.
* config/tc-pj.c (md_apply_fix): Likewise.
* config/tc-s390.c (md_gather_operands): Likewise.
* config/tc-sh.c (sh_cons_align): Likewise.
* config/tc-sparc.c (sparc_cons_align): Likewise.
* config/tc-tic4x.c (tic4x_sect): Likewise.
* config/tc-tic54x.c (tic54x_stringer): Likewise.
* config/tc-vax.c (vip_op): Likewise.
* config/tc-xstormy16.c (xstormy16_cons_fix_new): Likewise.
* config/tc-xtensa.c (md_assemble): Likewise.
(xtensa_fix_short_loop_frags, convert_frag_immed): Likewise.
(xtensa_move_literals): Likewise.
2010-06-28 16:06:57 +02:00
|
|
|
|
bfd_vma align_power = (bfd_vma) sec->alignment_power + OCTETS_PER_BYTE_POWER;
|
|
|
|
|
bfd_vma mask = ((bfd_vma) 1 << align_power) - 1;
|
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
if (size & mask)
|
|
|
|
|
{
|
2000-07-12 18:45:46 +02:00
|
|
|
|
bfd_vma new_size;
|
|
|
|
|
fragS *last;
|
2000-09-12 23:49:09 +02:00
|
|
|
|
|
2000-07-12 18:45:46 +02:00
|
|
|
|
new_size = (size + mask) & ~mask;
|
|
|
|
|
bfd_set_section_size (stdoutput, sec, new_size);
|
|
|
|
|
|
|
|
|
|
/* If the size had to be rounded up, add some padding in
|
|
|
|
|
the last non-empty frag. */
|
|
|
|
|
fragp = seg_info (sec)->frchainP->frch_root;
|
|
|
|
|
last = seg_info (sec)->frchainP->frch_last;
|
|
|
|
|
while (fragp->fr_next != last)
|
2002-05-09 15:12:57 +02:00
|
|
|
|
fragp = fragp->fr_next;
|
2000-07-12 18:45:46 +02:00
|
|
|
|
last->fr_address = size;
|
|
|
|
|
fragp->fr_offset += new_size - size;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
2000-02-03 19:20:23 +01:00
|
|
|
|
#endif
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* If the section size is non-zero, the section symbol needs an aux
|
|
|
|
|
entry associated with it, indicating the size. We don't know
|
|
|
|
|
all the values yet; coff_frob_symbol will fill them in later. */
|
2000-02-03 19:20:23 +01:00
|
|
|
|
#ifndef TICOFF
|
1999-05-03 09:29:11 +02:00
|
|
|
|
if (size != 0
|
|
|
|
|
|| sec == text_section
|
|
|
|
|
|| sec == data_section
|
|
|
|
|
|| sec == bss_section)
|
2000-02-03 19:20:23 +01:00
|
|
|
|
#endif
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
symbolS *secsym = section_symbol (sec);
|
2011-05-18 09:58:36 +02:00
|
|
|
|
unsigned char sclass = C_STAT;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2011-05-18 09:58:36 +02:00
|
|
|
|
#ifdef OBJ_XCOFF
|
|
|
|
|
if (bfd_get_section_flags (stdoutput, sec) & SEC_DEBUGGING)
|
|
|
|
|
sclass = C_DWARF;
|
|
|
|
|
#endif
|
|
|
|
|
S_SET_STORAGE_CLASS (secsym, sclass);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
S_SET_NUMBER_AUXILIARY (secsym, 1);
|
|
|
|
|
SF_SET_STATICS (secsym);
|
|
|
|
|
SA_SET_SCN_SCNLEN (secsym, size);
|
|
|
|
|
}
|
2005-03-16 15:57:00 +01:00
|
|
|
|
/* FIXME: These should be in a "stabs.h" file, or maybe as.h. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
#ifndef STAB_SECTION_NAME
|
|
|
|
|
#define STAB_SECTION_NAME ".stab"
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef STAB_STRING_SECTION_NAME
|
|
|
|
|
#define STAB_STRING_SECTION_NAME ".stabstr"
|
|
|
|
|
#endif
|
2005-03-16 15:57:00 +01:00
|
|
|
|
if (! streq (STAB_STRING_SECTION_NAME, sec->name))
|
1999-05-03 09:29:11 +02:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
strsec = sec;
|
|
|
|
|
sec = subseg_get (STAB_SECTION_NAME, 0);
|
|
|
|
|
/* size is already rounded up, since other section will be listed first */
|
2004-06-15 03:16:35 +02:00
|
|
|
|
size = bfd_get_section_size (strsec);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
2004-06-15 03:16:35 +02:00
|
|
|
|
n_entries = bfd_get_section_size (sec) / 12 - 1;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* Find first non-empty frag. It should be large enough. */
|
|
|
|
|
fragp = seg_info (sec)->frchainP->frch_root;
|
|
|
|
|
while (fragp && fragp->fr_fix == 0)
|
|
|
|
|
fragp = fragp->fr_next;
|
* gas/app, gas/as.c, gas/as.h, gas/atof-generic.c, gas/cgen.c,
gas/config/atof-ieee.c, gas/config/obj-aout.c,
gas/config/obj-coff.c, gas/config/obj-ecoff.c,
gas/config/obj-elf.c, gas/config/obj-som.c, gas/config/tc-alpha.c,
gas/config/tc-arc.c, gas/config/tc-arm.c, gas/config/tc-cr16.c,
gas/config/tc-cris.c, gas/config/tc-crx.c, gas/config/tc-d30v.c,
gas/config/tc-dlx.c, gas/config/tc-hppa.c, gas/config/tc-i370.c,
gas/config/tc-i386-intel.c, gas/config/tc-i386.c,
gas/config/tc-i860.c, gas/config/tc-i960.c, gas/config/tc-ia64.c,
gas/config/tc-iq2000.c, gas/config/tc-m32c.c,
gas/config/tc-m32r.c, gas/config/tc-m68hc11.c,
gas/config/tc-m68k.c, gas/config/tc-maxq.c, gas/config/tc-mcore.c,
gas/config/tc-mep.c, gas/config/tc-mips.c, gas/config/tc-mmix.c,
gas/config/tc-mn10300.c, gas/config/tc-moxie.c,
gas/config/tc-ns32k.c, gas/config/tc-pj.c, gas/config/tc-ppc.c,
gas/config/tc-s390.c, gas/config/tc-score.c,
gas/config/tc-score7.c, gas/config/tc-sh.c, gas/config/tc-sparc.c,
gas/config/tc-spu.c, gas/config/tc-tic30.c, gas/config/tc-vax.c,
gas/config/tc-xtensa.c, gas/config/xtensa-relax.c,
gas/dw2gencfi.c, gas/dwarf2dbg.c, gas/ehopt.c, gas/expr.c,
gas/frags.c, gas/input-file.c, gas/read.c, gas/sb.c,
gas/subsegs.c, gas/symbols.c, gas/write.c: Change the name of the
gas macro `assert' to `gas_assert'.
2009-06-22 19:56:02 +02:00
|
|
|
|
gas_assert (fragp != 0 && fragp->fr_fix >= 12);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
/* Store the values. */
|
|
|
|
|
p = fragp->fr_literal;
|
|
|
|
|
bfd_h_put_16 (stdoutput, n_entries, (bfd_byte *) p + 6);
|
|
|
|
|
bfd_h_put_32 (stdoutput, size, (bfd_byte *) p + 8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
obj_coff_init_stab_section (segT seg)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
2016-02-22 15:11:27 +01:00
|
|
|
|
const char *file;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
char *p;
|
|
|
|
|
char *stabstr_name;
|
|
|
|
|
unsigned int stroff;
|
|
|
|
|
|
2000-09-12 23:49:09 +02:00
|
|
|
|
/* Make space for this first symbol. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
p = frag_more (12);
|
2000-09-12 23:49:09 +02:00
|
|
|
|
/* Zero it out. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
memset (p, 0, 12);
|
2016-02-22 15:11:27 +01:00
|
|
|
|
file = as_where ((unsigned int *) NULL);
|
2016-03-28 11:49:15 +02:00
|
|
|
|
stabstr_name = concat (seg->name, "str", (char *) NULL);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
stroff = get_stab_string_offset (file, stabstr_name);
|
|
|
|
|
know (stroff == 1);
|
|
|
|
|
md_number_to_chars (p, stroff, 4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
2010-10-08 16:00:50 +02:00
|
|
|
|
const char * s_get_name (symbolS *);
|
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
const char *
|
2005-03-16 15:57:00 +01:00
|
|
|
|
s_get_name (symbolS *s)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
return ((s == NULL) ? "(NULL)" : S_GET_NAME (s));
|
|
|
|
|
}
|
|
|
|
|
|
2010-10-08 16:00:50 +02:00
|
|
|
|
void symbol_dump (void);
|
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
void
|
2005-03-16 15:57:00 +01:00
|
|
|
|
symbol_dump (void)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
symbolS *symbolP;
|
|
|
|
|
|
|
|
|
|
for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next (symbolP))
|
2005-03-16 15:57:00 +01:00
|
|
|
|
printf (_("0x%lx: \"%s\" type = %ld, class = %d, segment = %d\n"),
|
|
|
|
|
(unsigned long) symbolP,
|
|
|
|
|
S_GET_NAME (symbolP),
|
|
|
|
|
(long) S_GET_DATA_TYPE (symbolP),
|
|
|
|
|
S_GET_STORAGE_CLASS (symbolP),
|
|
|
|
|
(int) S_GET_SEGMENT (symbolP));
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif /* DEBUG */
|
|
|
|
|
|
* README-vms: Delete.
* config-gas.com: Delete.
* makefile.vms: Delete.
* vmsconf.sh: Delete.
* config/atof-tahoe.c: Delete.
* config/m88k-opcode.h: Delete.
* config/obj-bout.c: Delete.
* config/obj-bout.h: Delete.
* config/obj-hp300.c: Delete.
* config/obj-hp300.h: Delete.
* config/tc-a29k.c: Delete.
* config/tc-a29k.h: Delete.
* config/tc-h8500.c: Delete.
* config/tc-h8500.h: Delete.
* config/tc-m88k.c: Delete.
* config/tc-m88k.h: Delete.
* config/tc-tahoe.c: Delete.
* config/tc-tahoe.h: Delete.
* config/tc-tic80.c: Delete.
* config/tc-tic80.h: Delete.
* config/tc-w65.c: Delete.
* config/tc-w65.h: Delete.
* config/te-aux.h: Delete.
* config/te-delt88.h: Delete.
* config/te-delta.h: Delete.
* config/te-dpx2.h: Delete.
* config/te-hp300.h: Delete.
* config/te-ic960.h: Delete.
* config/vms-a-conf.h: Delete.
* doc/c-a29k.texi: Delete.
* doc/c-h8500.texi: Delete.
* doc/c-m88k.texi: Delete.
* README: Remove obsolete examples, and list of supported targets.
* Makefile.am: Remove a29k, h8500, m88k, tahoe, tic80, w65,
bout and hp300 support.
(DEP_FLAGS): Don't define BFD_ASSEMBLER.
* configure.in: Remove --enable-bfd-assembler, need_bfd,
primary_bfd_gas.
* configure.tgt: Remove a29k, h8300-coff, h8500-*, i960 non-elf,
m68k non bfd, m88k, or32-coff, tic80-*, vax non-bfd, w65k-*, *-nindy.
* as.c: Remove all non-BFD_ASSEMBLER code, support for above targets.
* as.h: Likewise.
* dw2gencfi.c: Likewise.
* dwarf2dbg.c: Likewise.
* ehopt.c: Likewise.
* input-file.c: Likewise.
* listing.c: Likewise.
* literal.c: Likewise.
* messages.c: Likewise.
* obj.h: Likewise.
* output-file.c: Likewise.
* read.c: Likewise.
* stabs.c: Likewise.
* struc-symbol.h: Likewise.
* subsegs.c: Likewise.
* subsegs.h: Likewise.
* symbols.c: Likewise.
* symbols.h: Likewise.
* tc.h: Likewise.
* write.c: Likewise.
* write.h: Likewise.
* config/aout_gnu.h: Likewise.
* config/obj-aout.c: Likewise.
* config/obj-aout.h: Likewise.
* config/obj-coff.c: Likewise.
* config/obj-coff.h: Likewise.
* config/obj-evax.h: Likewise.
* config/obj-ieee.h: Likewise.
* config/tc-arm.c: Likewise.
* config/tc-arm.h: Likewise.
* config/tc-avr.c: Likewise.
* config/tc-avr.h: Likewise.
* config/tc-crx.h: Likewise.
* config/tc-d10v.h: Likewise.
* config/tc-d30v.h: Likewise.
* config/tc-dlx.h: Likewise.
* config/tc-fr30.h: Likewise.
* config/tc-frv.h: Likewise.
* config/tc-h8300.c: Likewise.
* config/tc-h8300.h: Likewise.
* config/tc-hppa.h: Likewise.
* config/tc-i370.h: Likewise.
* config/tc-i386.c: Likewise.
* config/tc-i386.h: Likewise.
* config/tc-i860.h: Likewise.
* config/tc-i960.c: Likewise.
* config/tc-i960.h: Likewise.
* config/tc-ip2k.h: Likewise.
* config/tc-iq2000.h: Likewise.
* config/tc-m32c.h: Likewise.
* config/tc-m32r.h: Likewise.
* config/tc-m68hc11.h: Likewise.
* config/tc-m68k.c: Likewise.
* config/tc-m68k.h: Likewise.
* config/tc-maxq.c: Likewise.
* config/tc-maxq.h: Likewise.
* config/tc-mcore.c: Likewise.
* config/tc-mcore.h: Likewise.
* config/tc-mn10200.h: Likewise.
* config/tc-mn10300.c: Likewise.
* config/tc-mn10300.h: Likewise.
* config/tc-ms1.h: Likewise.
* config/tc-msp430.c: Likewise.
* config/tc-msp430.h: Likewise.
* config/tc-ns32k.c: Likewise.
* config/tc-ns32k.h: Likewise.
* config/tc-openrisc.h: Likewise.
* config/tc-or32.c: Likewise.
* config/tc-or32.h: Likewise.
* config/tc-ppc.c: Likewise.
* config/tc-ppc.h: Likewise.
* config/tc-s390.h: Likewise.
* config/tc-sh.c: Likewise.
* config/tc-sh.h: Likewise.
* config/tc-sparc.c: Likewise.
* config/tc-tic30.c: Likewise.
* config/tc-tic30.h: Likewise.
* config/tc-tic4x.c: Likewise.
* config/tc-tic4x.h: Likewise.
* config/tc-tic54x.c: Likewise.
* config/tc-tic54x.h: Likewise.
* config/tc-v850.h: Likewise.
* config/tc-vax.c: Likewise.
* config/tc-vax.h: Likewise.
* config/tc-xstormy16.h: Likewise.
* config/tc-xtensa.h: Likewise.
* config/tc-z8k.c: Likewise.
* config/tc-z8k.h: Likewise.
* config/vms-a-conf.h
* doc/Makefile.am: Likewise.
* doc/all.texi: Likewise.
* doc/as.texinfo: Likewise.
* doc/Makefile.in: Regenerate.
* Makefile.in: Regenerate.
* configure: Regenerate.
* config.in: Regenerate.
* po/POTFILES.in: Regenerate.
2005-08-11 03:25:29 +02:00
|
|
|
|
const pseudo_typeS coff_pseudo_table[] =
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
* README-vms: Delete.
* config-gas.com: Delete.
* makefile.vms: Delete.
* vmsconf.sh: Delete.
* config/atof-tahoe.c: Delete.
* config/m88k-opcode.h: Delete.
* config/obj-bout.c: Delete.
* config/obj-bout.h: Delete.
* config/obj-hp300.c: Delete.
* config/obj-hp300.h: Delete.
* config/tc-a29k.c: Delete.
* config/tc-a29k.h: Delete.
* config/tc-h8500.c: Delete.
* config/tc-h8500.h: Delete.
* config/tc-m88k.c: Delete.
* config/tc-m88k.h: Delete.
* config/tc-tahoe.c: Delete.
* config/tc-tahoe.h: Delete.
* config/tc-tic80.c: Delete.
* config/tc-tic80.h: Delete.
* config/tc-w65.c: Delete.
* config/tc-w65.h: Delete.
* config/te-aux.h: Delete.
* config/te-delt88.h: Delete.
* config/te-delta.h: Delete.
* config/te-dpx2.h: Delete.
* config/te-hp300.h: Delete.
* config/te-ic960.h: Delete.
* config/vms-a-conf.h: Delete.
* doc/c-a29k.texi: Delete.
* doc/c-h8500.texi: Delete.
* doc/c-m88k.texi: Delete.
* README: Remove obsolete examples, and list of supported targets.
* Makefile.am: Remove a29k, h8500, m88k, tahoe, tic80, w65,
bout and hp300 support.
(DEP_FLAGS): Don't define BFD_ASSEMBLER.
* configure.in: Remove --enable-bfd-assembler, need_bfd,
primary_bfd_gas.
* configure.tgt: Remove a29k, h8300-coff, h8500-*, i960 non-elf,
m68k non bfd, m88k, or32-coff, tic80-*, vax non-bfd, w65k-*, *-nindy.
* as.c: Remove all non-BFD_ASSEMBLER code, support for above targets.
* as.h: Likewise.
* dw2gencfi.c: Likewise.
* dwarf2dbg.c: Likewise.
* ehopt.c: Likewise.
* input-file.c: Likewise.
* listing.c: Likewise.
* literal.c: Likewise.
* messages.c: Likewise.
* obj.h: Likewise.
* output-file.c: Likewise.
* read.c: Likewise.
* stabs.c: Likewise.
* struc-symbol.h: Likewise.
* subsegs.c: Likewise.
* subsegs.h: Likewise.
* symbols.c: Likewise.
* symbols.h: Likewise.
* tc.h: Likewise.
* write.c: Likewise.
* write.h: Likewise.
* config/aout_gnu.h: Likewise.
* config/obj-aout.c: Likewise.
* config/obj-aout.h: Likewise.
* config/obj-coff.c: Likewise.
* config/obj-coff.h: Likewise.
* config/obj-evax.h: Likewise.
* config/obj-ieee.h: Likewise.
* config/tc-arm.c: Likewise.
* config/tc-arm.h: Likewise.
* config/tc-avr.c: Likewise.
* config/tc-avr.h: Likewise.
* config/tc-crx.h: Likewise.
* config/tc-d10v.h: Likewise.
* config/tc-d30v.h: Likewise.
* config/tc-dlx.h: Likewise.
* config/tc-fr30.h: Likewise.
* config/tc-frv.h: Likewise.
* config/tc-h8300.c: Likewise.
* config/tc-h8300.h: Likewise.
* config/tc-hppa.h: Likewise.
* config/tc-i370.h: Likewise.
* config/tc-i386.c: Likewise.
* config/tc-i386.h: Likewise.
* config/tc-i860.h: Likewise.
* config/tc-i960.c: Likewise.
* config/tc-i960.h: Likewise.
* config/tc-ip2k.h: Likewise.
* config/tc-iq2000.h: Likewise.
* config/tc-m32c.h: Likewise.
* config/tc-m32r.h: Likewise.
* config/tc-m68hc11.h: Likewise.
* config/tc-m68k.c: Likewise.
* config/tc-m68k.h: Likewise.
* config/tc-maxq.c: Likewise.
* config/tc-maxq.h: Likewise.
* config/tc-mcore.c: Likewise.
* config/tc-mcore.h: Likewise.
* config/tc-mn10200.h: Likewise.
* config/tc-mn10300.c: Likewise.
* config/tc-mn10300.h: Likewise.
* config/tc-ms1.h: Likewise.
* config/tc-msp430.c: Likewise.
* config/tc-msp430.h: Likewise.
* config/tc-ns32k.c: Likewise.
* config/tc-ns32k.h: Likewise.
* config/tc-openrisc.h: Likewise.
* config/tc-or32.c: Likewise.
* config/tc-or32.h: Likewise.
* config/tc-ppc.c: Likewise.
* config/tc-ppc.h: Likewise.
* config/tc-s390.h: Likewise.
* config/tc-sh.c: Likewise.
* config/tc-sh.h: Likewise.
* config/tc-sparc.c: Likewise.
* config/tc-tic30.c: Likewise.
* config/tc-tic30.h: Likewise.
* config/tc-tic4x.c: Likewise.
* config/tc-tic4x.h: Likewise.
* config/tc-tic54x.c: Likewise.
* config/tc-tic54x.h: Likewise.
* config/tc-v850.h: Likewise.
* config/tc-vax.c: Likewise.
* config/tc-vax.h: Likewise.
* config/tc-xstormy16.h: Likewise.
* config/tc-xtensa.h: Likewise.
* config/tc-z8k.c: Likewise.
* config/tc-z8k.h: Likewise.
* config/vms-a-conf.h
* doc/Makefile.am: Likewise.
* doc/all.texi: Likewise.
* doc/as.texinfo: Likewise.
* doc/Makefile.in: Regenerate.
* Makefile.in: Regenerate.
* configure: Regenerate.
* config.in: Regenerate.
* po/POTFILES.in: Regenerate.
2005-08-11 03:25:29 +02:00
|
|
|
|
{"ABORT", s_abort, 0},
|
|
|
|
|
{"appline", obj_coff_ln, 1},
|
|
|
|
|
/* We accept the .bss directive for backward compatibility with
|
|
|
|
|
earlier versions of gas. */
|
|
|
|
|
{"bss", obj_coff_bss, 0},
|
2009-05-19 18:08:08 +02:00
|
|
|
|
#ifdef TE_PE
|
|
|
|
|
/* PE provides an enhanced version of .comm with alignment. */
|
|
|
|
|
{"comm", obj_coff_comm, 0},
|
|
|
|
|
#endif /* TE_PE */
|
* README-vms: Delete.
* config-gas.com: Delete.
* makefile.vms: Delete.
* vmsconf.sh: Delete.
* config/atof-tahoe.c: Delete.
* config/m88k-opcode.h: Delete.
* config/obj-bout.c: Delete.
* config/obj-bout.h: Delete.
* config/obj-hp300.c: Delete.
* config/obj-hp300.h: Delete.
* config/tc-a29k.c: Delete.
* config/tc-a29k.h: Delete.
* config/tc-h8500.c: Delete.
* config/tc-h8500.h: Delete.
* config/tc-m88k.c: Delete.
* config/tc-m88k.h: Delete.
* config/tc-tahoe.c: Delete.
* config/tc-tahoe.h: Delete.
* config/tc-tic80.c: Delete.
* config/tc-tic80.h: Delete.
* config/tc-w65.c: Delete.
* config/tc-w65.h: Delete.
* config/te-aux.h: Delete.
* config/te-delt88.h: Delete.
* config/te-delta.h: Delete.
* config/te-dpx2.h: Delete.
* config/te-hp300.h: Delete.
* config/te-ic960.h: Delete.
* config/vms-a-conf.h: Delete.
* doc/c-a29k.texi: Delete.
* doc/c-h8500.texi: Delete.
* doc/c-m88k.texi: Delete.
* README: Remove obsolete examples, and list of supported targets.
* Makefile.am: Remove a29k, h8500, m88k, tahoe, tic80, w65,
bout and hp300 support.
(DEP_FLAGS): Don't define BFD_ASSEMBLER.
* configure.in: Remove --enable-bfd-assembler, need_bfd,
primary_bfd_gas.
* configure.tgt: Remove a29k, h8300-coff, h8500-*, i960 non-elf,
m68k non bfd, m88k, or32-coff, tic80-*, vax non-bfd, w65k-*, *-nindy.
* as.c: Remove all non-BFD_ASSEMBLER code, support for above targets.
* as.h: Likewise.
* dw2gencfi.c: Likewise.
* dwarf2dbg.c: Likewise.
* ehopt.c: Likewise.
* input-file.c: Likewise.
* listing.c: Likewise.
* literal.c: Likewise.
* messages.c: Likewise.
* obj.h: Likewise.
* output-file.c: Likewise.
* read.c: Likewise.
* stabs.c: Likewise.
* struc-symbol.h: Likewise.
* subsegs.c: Likewise.
* subsegs.h: Likewise.
* symbols.c: Likewise.
* symbols.h: Likewise.
* tc.h: Likewise.
* write.c: Likewise.
* write.h: Likewise.
* config/aout_gnu.h: Likewise.
* config/obj-aout.c: Likewise.
* config/obj-aout.h: Likewise.
* config/obj-coff.c: Likewise.
* config/obj-coff.h: Likewise.
* config/obj-evax.h: Likewise.
* config/obj-ieee.h: Likewise.
* config/tc-arm.c: Likewise.
* config/tc-arm.h: Likewise.
* config/tc-avr.c: Likewise.
* config/tc-avr.h: Likewise.
* config/tc-crx.h: Likewise.
* config/tc-d10v.h: Likewise.
* config/tc-d30v.h: Likewise.
* config/tc-dlx.h: Likewise.
* config/tc-fr30.h: Likewise.
* config/tc-frv.h: Likewise.
* config/tc-h8300.c: Likewise.
* config/tc-h8300.h: Likewise.
* config/tc-hppa.h: Likewise.
* config/tc-i370.h: Likewise.
* config/tc-i386.c: Likewise.
* config/tc-i386.h: Likewise.
* config/tc-i860.h: Likewise.
* config/tc-i960.c: Likewise.
* config/tc-i960.h: Likewise.
* config/tc-ip2k.h: Likewise.
* config/tc-iq2000.h: Likewise.
* config/tc-m32c.h: Likewise.
* config/tc-m32r.h: Likewise.
* config/tc-m68hc11.h: Likewise.
* config/tc-m68k.c: Likewise.
* config/tc-m68k.h: Likewise.
* config/tc-maxq.c: Likewise.
* config/tc-maxq.h: Likewise.
* config/tc-mcore.c: Likewise.
* config/tc-mcore.h: Likewise.
* config/tc-mn10200.h: Likewise.
* config/tc-mn10300.c: Likewise.
* config/tc-mn10300.h: Likewise.
* config/tc-ms1.h: Likewise.
* config/tc-msp430.c: Likewise.
* config/tc-msp430.h: Likewise.
* config/tc-ns32k.c: Likewise.
* config/tc-ns32k.h: Likewise.
* config/tc-openrisc.h: Likewise.
* config/tc-or32.c: Likewise.
* config/tc-or32.h: Likewise.
* config/tc-ppc.c: Likewise.
* config/tc-ppc.h: Likewise.
* config/tc-s390.h: Likewise.
* config/tc-sh.c: Likewise.
* config/tc-sh.h: Likewise.
* config/tc-sparc.c: Likewise.
* config/tc-tic30.c: Likewise.
* config/tc-tic30.h: Likewise.
* config/tc-tic4x.c: Likewise.
* config/tc-tic4x.h: Likewise.
* config/tc-tic54x.c: Likewise.
* config/tc-tic54x.h: Likewise.
* config/tc-v850.h: Likewise.
* config/tc-vax.c: Likewise.
* config/tc-vax.h: Likewise.
* config/tc-xstormy16.h: Likewise.
* config/tc-xtensa.h: Likewise.
* config/tc-z8k.c: Likewise.
* config/tc-z8k.h: Likewise.
* config/vms-a-conf.h
* doc/Makefile.am: Likewise.
* doc/all.texi: Likewise.
* doc/as.texinfo: Likewise.
* doc/Makefile.in: Regenerate.
* Makefile.in: Regenerate.
* configure: Regenerate.
* config.in: Regenerate.
* po/POTFILES.in: Regenerate.
2005-08-11 03:25:29 +02:00
|
|
|
|
{"def", obj_coff_def, 0},
|
|
|
|
|
{"dim", obj_coff_dim, 0},
|
|
|
|
|
{"endef", obj_coff_endef, 0},
|
|
|
|
|
{"ident", obj_coff_ident, 0},
|
|
|
|
|
{"line", obj_coff_line, 0},
|
|
|
|
|
{"ln", obj_coff_ln, 0},
|
|
|
|
|
{"scl", obj_coff_scl, 0},
|
|
|
|
|
{"sect", obj_coff_section, 0},
|
|
|
|
|
{"sect.s", obj_coff_section, 0},
|
|
|
|
|
{"section", obj_coff_section, 0},
|
|
|
|
|
{"section.s", obj_coff_section, 0},
|
|
|
|
|
/* FIXME: We ignore the MRI short attribute. */
|
|
|
|
|
{"size", obj_coff_size, 0},
|
|
|
|
|
{"tag", obj_coff_tag, 0},
|
|
|
|
|
{"type", obj_coff_type, 0},
|
|
|
|
|
{"val", obj_coff_val, 0},
|
|
|
|
|
{"version", s_ignore, 0},
|
|
|
|
|
{"loc", obj_coff_loc, 0},
|
|
|
|
|
{"optim", s_ignore, 0}, /* For sun386i cc (?) */
|
|
|
|
|
{"weak", obj_coff_weak, 0},
|
|
|
|
|
#if defined TC_TIC4X
|
|
|
|
|
/* The tic4x uses sdef instead of def. */
|
|
|
|
|
{"sdef", obj_coff_def, 0},
|
2009-08-17 13:45:23 +02:00
|
|
|
|
#endif
|
|
|
|
|
#if defined(SEH_CMDS)
|
|
|
|
|
SEH_CMDS
|
1999-05-03 09:29:11 +02:00
|
|
|
|
#endif
|
* README-vms: Delete.
* config-gas.com: Delete.
* makefile.vms: Delete.
* vmsconf.sh: Delete.
* config/atof-tahoe.c: Delete.
* config/m88k-opcode.h: Delete.
* config/obj-bout.c: Delete.
* config/obj-bout.h: Delete.
* config/obj-hp300.c: Delete.
* config/obj-hp300.h: Delete.
* config/tc-a29k.c: Delete.
* config/tc-a29k.h: Delete.
* config/tc-h8500.c: Delete.
* config/tc-h8500.h: Delete.
* config/tc-m88k.c: Delete.
* config/tc-m88k.h: Delete.
* config/tc-tahoe.c: Delete.
* config/tc-tahoe.h: Delete.
* config/tc-tic80.c: Delete.
* config/tc-tic80.h: Delete.
* config/tc-w65.c: Delete.
* config/tc-w65.h: Delete.
* config/te-aux.h: Delete.
* config/te-delt88.h: Delete.
* config/te-delta.h: Delete.
* config/te-dpx2.h: Delete.
* config/te-hp300.h: Delete.
* config/te-ic960.h: Delete.
* config/vms-a-conf.h: Delete.
* doc/c-a29k.texi: Delete.
* doc/c-h8500.texi: Delete.
* doc/c-m88k.texi: Delete.
* README: Remove obsolete examples, and list of supported targets.
* Makefile.am: Remove a29k, h8500, m88k, tahoe, tic80, w65,
bout and hp300 support.
(DEP_FLAGS): Don't define BFD_ASSEMBLER.
* configure.in: Remove --enable-bfd-assembler, need_bfd,
primary_bfd_gas.
* configure.tgt: Remove a29k, h8300-coff, h8500-*, i960 non-elf,
m68k non bfd, m88k, or32-coff, tic80-*, vax non-bfd, w65k-*, *-nindy.
* as.c: Remove all non-BFD_ASSEMBLER code, support for above targets.
* as.h: Likewise.
* dw2gencfi.c: Likewise.
* dwarf2dbg.c: Likewise.
* ehopt.c: Likewise.
* input-file.c: Likewise.
* listing.c: Likewise.
* literal.c: Likewise.
* messages.c: Likewise.
* obj.h: Likewise.
* output-file.c: Likewise.
* read.c: Likewise.
* stabs.c: Likewise.
* struc-symbol.h: Likewise.
* subsegs.c: Likewise.
* subsegs.h: Likewise.
* symbols.c: Likewise.
* symbols.h: Likewise.
* tc.h: Likewise.
* write.c: Likewise.
* write.h: Likewise.
* config/aout_gnu.h: Likewise.
* config/obj-aout.c: Likewise.
* config/obj-aout.h: Likewise.
* config/obj-coff.c: Likewise.
* config/obj-coff.h: Likewise.
* config/obj-evax.h: Likewise.
* config/obj-ieee.h: Likewise.
* config/tc-arm.c: Likewise.
* config/tc-arm.h: Likewise.
* config/tc-avr.c: Likewise.
* config/tc-avr.h: Likewise.
* config/tc-crx.h: Likewise.
* config/tc-d10v.h: Likewise.
* config/tc-d30v.h: Likewise.
* config/tc-dlx.h: Likewise.
* config/tc-fr30.h: Likewise.
* config/tc-frv.h: Likewise.
* config/tc-h8300.c: Likewise.
* config/tc-h8300.h: Likewise.
* config/tc-hppa.h: Likewise.
* config/tc-i370.h: Likewise.
* config/tc-i386.c: Likewise.
* config/tc-i386.h: Likewise.
* config/tc-i860.h: Likewise.
* config/tc-i960.c: Likewise.
* config/tc-i960.h: Likewise.
* config/tc-ip2k.h: Likewise.
* config/tc-iq2000.h: Likewise.
* config/tc-m32c.h: Likewise.
* config/tc-m32r.h: Likewise.
* config/tc-m68hc11.h: Likewise.
* config/tc-m68k.c: Likewise.
* config/tc-m68k.h: Likewise.
* config/tc-maxq.c: Likewise.
* config/tc-maxq.h: Likewise.
* config/tc-mcore.c: Likewise.
* config/tc-mcore.h: Likewise.
* config/tc-mn10200.h: Likewise.
* config/tc-mn10300.c: Likewise.
* config/tc-mn10300.h: Likewise.
* config/tc-ms1.h: Likewise.
* config/tc-msp430.c: Likewise.
* config/tc-msp430.h: Likewise.
* config/tc-ns32k.c: Likewise.
* config/tc-ns32k.h: Likewise.
* config/tc-openrisc.h: Likewise.
* config/tc-or32.c: Likewise.
* config/tc-or32.h: Likewise.
* config/tc-ppc.c: Likewise.
* config/tc-ppc.h: Likewise.
* config/tc-s390.h: Likewise.
* config/tc-sh.c: Likewise.
* config/tc-sh.h: Likewise.
* config/tc-sparc.c: Likewise.
* config/tc-tic30.c: Likewise.
* config/tc-tic30.h: Likewise.
* config/tc-tic4x.c: Likewise.
* config/tc-tic4x.h: Likewise.
* config/tc-tic54x.c: Likewise.
* config/tc-tic54x.h: Likewise.
* config/tc-v850.h: Likewise.
* config/tc-vax.c: Likewise.
* config/tc-vax.h: Likewise.
* config/tc-xstormy16.h: Likewise.
* config/tc-xtensa.h: Likewise.
* config/tc-z8k.c: Likewise.
* config/tc-z8k.h: Likewise.
* config/vms-a-conf.h
* doc/Makefile.am: Likewise.
* doc/all.texi: Likewise.
* doc/as.texinfo: Likewise.
* doc/Makefile.in: Regenerate.
* Makefile.in: Regenerate.
* configure: Regenerate.
* config.in: Regenerate.
* po/POTFILES.in: Regenerate.
2005-08-11 03:25:29 +02:00
|
|
|
|
{NULL, NULL, 0}
|
|
|
|
|
};
|
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
* README-vms: Delete.
* config-gas.com: Delete.
* makefile.vms: Delete.
* vmsconf.sh: Delete.
* config/atof-tahoe.c: Delete.
* config/m88k-opcode.h: Delete.
* config/obj-bout.c: Delete.
* config/obj-bout.h: Delete.
* config/obj-hp300.c: Delete.
* config/obj-hp300.h: Delete.
* config/tc-a29k.c: Delete.
* config/tc-a29k.h: Delete.
* config/tc-h8500.c: Delete.
* config/tc-h8500.h: Delete.
* config/tc-m88k.c: Delete.
* config/tc-m88k.h: Delete.
* config/tc-tahoe.c: Delete.
* config/tc-tahoe.h: Delete.
* config/tc-tic80.c: Delete.
* config/tc-tic80.h: Delete.
* config/tc-w65.c: Delete.
* config/tc-w65.h: Delete.
* config/te-aux.h: Delete.
* config/te-delt88.h: Delete.
* config/te-delta.h: Delete.
* config/te-dpx2.h: Delete.
* config/te-hp300.h: Delete.
* config/te-ic960.h: Delete.
* config/vms-a-conf.h: Delete.
* doc/c-a29k.texi: Delete.
* doc/c-h8500.texi: Delete.
* doc/c-m88k.texi: Delete.
* README: Remove obsolete examples, and list of supported targets.
* Makefile.am: Remove a29k, h8500, m88k, tahoe, tic80, w65,
bout and hp300 support.
(DEP_FLAGS): Don't define BFD_ASSEMBLER.
* configure.in: Remove --enable-bfd-assembler, need_bfd,
primary_bfd_gas.
* configure.tgt: Remove a29k, h8300-coff, h8500-*, i960 non-elf,
m68k non bfd, m88k, or32-coff, tic80-*, vax non-bfd, w65k-*, *-nindy.
* as.c: Remove all non-BFD_ASSEMBLER code, support for above targets.
* as.h: Likewise.
* dw2gencfi.c: Likewise.
* dwarf2dbg.c: Likewise.
* ehopt.c: Likewise.
* input-file.c: Likewise.
* listing.c: Likewise.
* literal.c: Likewise.
* messages.c: Likewise.
* obj.h: Likewise.
* output-file.c: Likewise.
* read.c: Likewise.
* stabs.c: Likewise.
* struc-symbol.h: Likewise.
* subsegs.c: Likewise.
* subsegs.h: Likewise.
* symbols.c: Likewise.
* symbols.h: Likewise.
* tc.h: Likewise.
* write.c: Likewise.
* write.h: Likewise.
* config/aout_gnu.h: Likewise.
* config/obj-aout.c: Likewise.
* config/obj-aout.h: Likewise.
* config/obj-coff.c: Likewise.
* config/obj-coff.h: Likewise.
* config/obj-evax.h: Likewise.
* config/obj-ieee.h: Likewise.
* config/tc-arm.c: Likewise.
* config/tc-arm.h: Likewise.
* config/tc-avr.c: Likewise.
* config/tc-avr.h: Likewise.
* config/tc-crx.h: Likewise.
* config/tc-d10v.h: Likewise.
* config/tc-d30v.h: Likewise.
* config/tc-dlx.h: Likewise.
* config/tc-fr30.h: Likewise.
* config/tc-frv.h: Likewise.
* config/tc-h8300.c: Likewise.
* config/tc-h8300.h: Likewise.
* config/tc-hppa.h: Likewise.
* config/tc-i370.h: Likewise.
* config/tc-i386.c: Likewise.
* config/tc-i386.h: Likewise.
* config/tc-i860.h: Likewise.
* config/tc-i960.c: Likewise.
* config/tc-i960.h: Likewise.
* config/tc-ip2k.h: Likewise.
* config/tc-iq2000.h: Likewise.
* config/tc-m32c.h: Likewise.
* config/tc-m32r.h: Likewise.
* config/tc-m68hc11.h: Likewise.
* config/tc-m68k.c: Likewise.
* config/tc-m68k.h: Likewise.
* config/tc-maxq.c: Likewise.
* config/tc-maxq.h: Likewise.
* config/tc-mcore.c: Likewise.
* config/tc-mcore.h: Likewise.
* config/tc-mn10200.h: Likewise.
* config/tc-mn10300.c: Likewise.
* config/tc-mn10300.h: Likewise.
* config/tc-ms1.h: Likewise.
* config/tc-msp430.c: Likewise.
* config/tc-msp430.h: Likewise.
* config/tc-ns32k.c: Likewise.
* config/tc-ns32k.h: Likewise.
* config/tc-openrisc.h: Likewise.
* config/tc-or32.c: Likewise.
* config/tc-or32.h: Likewise.
* config/tc-ppc.c: Likewise.
* config/tc-ppc.h: Likewise.
* config/tc-s390.h: Likewise.
* config/tc-sh.c: Likewise.
* config/tc-sh.h: Likewise.
* config/tc-sparc.c: Likewise.
* config/tc-tic30.c: Likewise.
* config/tc-tic30.h: Likewise.
* config/tc-tic4x.c: Likewise.
* config/tc-tic4x.h: Likewise.
* config/tc-tic54x.c: Likewise.
* config/tc-tic54x.h: Likewise.
* config/tc-v850.h: Likewise.
* config/tc-vax.c: Likewise.
* config/tc-vax.h: Likewise.
* config/tc-xstormy16.h: Likewise.
* config/tc-xtensa.h: Likewise.
* config/tc-z8k.c: Likewise.
* config/tc-z8k.h: Likewise.
* config/vms-a-conf.h
* doc/Makefile.am: Likewise.
* doc/all.texi: Likewise.
* doc/as.texinfo: Likewise.
* doc/Makefile.in: Regenerate.
* Makefile.in: Regenerate.
* configure: Regenerate.
* config.in: Regenerate.
* po/POTFILES.in: Regenerate.
2005-08-11 03:25:29 +02:00
|
|
|
|
/* Support for a COFF emulation. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
static void
|
* README-vms: Delete.
* config-gas.com: Delete.
* makefile.vms: Delete.
* vmsconf.sh: Delete.
* config/atof-tahoe.c: Delete.
* config/m88k-opcode.h: Delete.
* config/obj-bout.c: Delete.
* config/obj-bout.h: Delete.
* config/obj-hp300.c: Delete.
* config/obj-hp300.h: Delete.
* config/tc-a29k.c: Delete.
* config/tc-a29k.h: Delete.
* config/tc-h8500.c: Delete.
* config/tc-h8500.h: Delete.
* config/tc-m88k.c: Delete.
* config/tc-m88k.h: Delete.
* config/tc-tahoe.c: Delete.
* config/tc-tahoe.h: Delete.
* config/tc-tic80.c: Delete.
* config/tc-tic80.h: Delete.
* config/tc-w65.c: Delete.
* config/tc-w65.h: Delete.
* config/te-aux.h: Delete.
* config/te-delt88.h: Delete.
* config/te-delta.h: Delete.
* config/te-dpx2.h: Delete.
* config/te-hp300.h: Delete.
* config/te-ic960.h: Delete.
* config/vms-a-conf.h: Delete.
* doc/c-a29k.texi: Delete.
* doc/c-h8500.texi: Delete.
* doc/c-m88k.texi: Delete.
* README: Remove obsolete examples, and list of supported targets.
* Makefile.am: Remove a29k, h8500, m88k, tahoe, tic80, w65,
bout and hp300 support.
(DEP_FLAGS): Don't define BFD_ASSEMBLER.
* configure.in: Remove --enable-bfd-assembler, need_bfd,
primary_bfd_gas.
* configure.tgt: Remove a29k, h8300-coff, h8500-*, i960 non-elf,
m68k non bfd, m88k, or32-coff, tic80-*, vax non-bfd, w65k-*, *-nindy.
* as.c: Remove all non-BFD_ASSEMBLER code, support for above targets.
* as.h: Likewise.
* dw2gencfi.c: Likewise.
* dwarf2dbg.c: Likewise.
* ehopt.c: Likewise.
* input-file.c: Likewise.
* listing.c: Likewise.
* literal.c: Likewise.
* messages.c: Likewise.
* obj.h: Likewise.
* output-file.c: Likewise.
* read.c: Likewise.
* stabs.c: Likewise.
* struc-symbol.h: Likewise.
* subsegs.c: Likewise.
* subsegs.h: Likewise.
* symbols.c: Likewise.
* symbols.h: Likewise.
* tc.h: Likewise.
* write.c: Likewise.
* write.h: Likewise.
* config/aout_gnu.h: Likewise.
* config/obj-aout.c: Likewise.
* config/obj-aout.h: Likewise.
* config/obj-coff.c: Likewise.
* config/obj-coff.h: Likewise.
* config/obj-evax.h: Likewise.
* config/obj-ieee.h: Likewise.
* config/tc-arm.c: Likewise.
* config/tc-arm.h: Likewise.
* config/tc-avr.c: Likewise.
* config/tc-avr.h: Likewise.
* config/tc-crx.h: Likewise.
* config/tc-d10v.h: Likewise.
* config/tc-d30v.h: Likewise.
* config/tc-dlx.h: Likewise.
* config/tc-fr30.h: Likewise.
* config/tc-frv.h: Likewise.
* config/tc-h8300.c: Likewise.
* config/tc-h8300.h: Likewise.
* config/tc-hppa.h: Likewise.
* config/tc-i370.h: Likewise.
* config/tc-i386.c: Likewise.
* config/tc-i386.h: Likewise.
* config/tc-i860.h: Likewise.
* config/tc-i960.c: Likewise.
* config/tc-i960.h: Likewise.
* config/tc-ip2k.h: Likewise.
* config/tc-iq2000.h: Likewise.
* config/tc-m32c.h: Likewise.
* config/tc-m32r.h: Likewise.
* config/tc-m68hc11.h: Likewise.
* config/tc-m68k.c: Likewise.
* config/tc-m68k.h: Likewise.
* config/tc-maxq.c: Likewise.
* config/tc-maxq.h: Likewise.
* config/tc-mcore.c: Likewise.
* config/tc-mcore.h: Likewise.
* config/tc-mn10200.h: Likewise.
* config/tc-mn10300.c: Likewise.
* config/tc-mn10300.h: Likewise.
* config/tc-ms1.h: Likewise.
* config/tc-msp430.c: Likewise.
* config/tc-msp430.h: Likewise.
* config/tc-ns32k.c: Likewise.
* config/tc-ns32k.h: Likewise.
* config/tc-openrisc.h: Likewise.
* config/tc-or32.c: Likewise.
* config/tc-or32.h: Likewise.
* config/tc-ppc.c: Likewise.
* config/tc-ppc.h: Likewise.
* config/tc-s390.h: Likewise.
* config/tc-sh.c: Likewise.
* config/tc-sh.h: Likewise.
* config/tc-sparc.c: Likewise.
* config/tc-tic30.c: Likewise.
* config/tc-tic30.h: Likewise.
* config/tc-tic4x.c: Likewise.
* config/tc-tic4x.h: Likewise.
* config/tc-tic54x.c: Likewise.
* config/tc-tic54x.h: Likewise.
* config/tc-v850.h: Likewise.
* config/tc-vax.c: Likewise.
* config/tc-vax.h: Likewise.
* config/tc-xstormy16.h: Likewise.
* config/tc-xtensa.h: Likewise.
* config/tc-z8k.c: Likewise.
* config/tc-z8k.h: Likewise.
* config/vms-a-conf.h
* doc/Makefile.am: Likewise.
* doc/all.texi: Likewise.
* doc/as.texinfo: Likewise.
* doc/Makefile.in: Regenerate.
* Makefile.in: Regenerate.
* configure: Regenerate.
* config.in: Regenerate.
* po/POTFILES.in: Regenerate.
2005-08-11 03:25:29 +02:00
|
|
|
|
coff_pop_insert (void)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
* README-vms: Delete.
* config-gas.com: Delete.
* makefile.vms: Delete.
* vmsconf.sh: Delete.
* config/atof-tahoe.c: Delete.
* config/m88k-opcode.h: Delete.
* config/obj-bout.c: Delete.
* config/obj-bout.h: Delete.
* config/obj-hp300.c: Delete.
* config/obj-hp300.h: Delete.
* config/tc-a29k.c: Delete.
* config/tc-a29k.h: Delete.
* config/tc-h8500.c: Delete.
* config/tc-h8500.h: Delete.
* config/tc-m88k.c: Delete.
* config/tc-m88k.h: Delete.
* config/tc-tahoe.c: Delete.
* config/tc-tahoe.h: Delete.
* config/tc-tic80.c: Delete.
* config/tc-tic80.h: Delete.
* config/tc-w65.c: Delete.
* config/tc-w65.h: Delete.
* config/te-aux.h: Delete.
* config/te-delt88.h: Delete.
* config/te-delta.h: Delete.
* config/te-dpx2.h: Delete.
* config/te-hp300.h: Delete.
* config/te-ic960.h: Delete.
* config/vms-a-conf.h: Delete.
* doc/c-a29k.texi: Delete.
* doc/c-h8500.texi: Delete.
* doc/c-m88k.texi: Delete.
* README: Remove obsolete examples, and list of supported targets.
* Makefile.am: Remove a29k, h8500, m88k, tahoe, tic80, w65,
bout and hp300 support.
(DEP_FLAGS): Don't define BFD_ASSEMBLER.
* configure.in: Remove --enable-bfd-assembler, need_bfd,
primary_bfd_gas.
* configure.tgt: Remove a29k, h8300-coff, h8500-*, i960 non-elf,
m68k non bfd, m88k, or32-coff, tic80-*, vax non-bfd, w65k-*, *-nindy.
* as.c: Remove all non-BFD_ASSEMBLER code, support for above targets.
* as.h: Likewise.
* dw2gencfi.c: Likewise.
* dwarf2dbg.c: Likewise.
* ehopt.c: Likewise.
* input-file.c: Likewise.
* listing.c: Likewise.
* literal.c: Likewise.
* messages.c: Likewise.
* obj.h: Likewise.
* output-file.c: Likewise.
* read.c: Likewise.
* stabs.c: Likewise.
* struc-symbol.h: Likewise.
* subsegs.c: Likewise.
* subsegs.h: Likewise.
* symbols.c: Likewise.
* symbols.h: Likewise.
* tc.h: Likewise.
* write.c: Likewise.
* write.h: Likewise.
* config/aout_gnu.h: Likewise.
* config/obj-aout.c: Likewise.
* config/obj-aout.h: Likewise.
* config/obj-coff.c: Likewise.
* config/obj-coff.h: Likewise.
* config/obj-evax.h: Likewise.
* config/obj-ieee.h: Likewise.
* config/tc-arm.c: Likewise.
* config/tc-arm.h: Likewise.
* config/tc-avr.c: Likewise.
* config/tc-avr.h: Likewise.
* config/tc-crx.h: Likewise.
* config/tc-d10v.h: Likewise.
* config/tc-d30v.h: Likewise.
* config/tc-dlx.h: Likewise.
* config/tc-fr30.h: Likewise.
* config/tc-frv.h: Likewise.
* config/tc-h8300.c: Likewise.
* config/tc-h8300.h: Likewise.
* config/tc-hppa.h: Likewise.
* config/tc-i370.h: Likewise.
* config/tc-i386.c: Likewise.
* config/tc-i386.h: Likewise.
* config/tc-i860.h: Likewise.
* config/tc-i960.c: Likewise.
* config/tc-i960.h: Likewise.
* config/tc-ip2k.h: Likewise.
* config/tc-iq2000.h: Likewise.
* config/tc-m32c.h: Likewise.
* config/tc-m32r.h: Likewise.
* config/tc-m68hc11.h: Likewise.
* config/tc-m68k.c: Likewise.
* config/tc-m68k.h: Likewise.
* config/tc-maxq.c: Likewise.
* config/tc-maxq.h: Likewise.
* config/tc-mcore.c: Likewise.
* config/tc-mcore.h: Likewise.
* config/tc-mn10200.h: Likewise.
* config/tc-mn10300.c: Likewise.
* config/tc-mn10300.h: Likewise.
* config/tc-ms1.h: Likewise.
* config/tc-msp430.c: Likewise.
* config/tc-msp430.h: Likewise.
* config/tc-ns32k.c: Likewise.
* config/tc-ns32k.h: Likewise.
* config/tc-openrisc.h: Likewise.
* config/tc-or32.c: Likewise.
* config/tc-or32.h: Likewise.
* config/tc-ppc.c: Likewise.
* config/tc-ppc.h: Likewise.
* config/tc-s390.h: Likewise.
* config/tc-sh.c: Likewise.
* config/tc-sh.h: Likewise.
* config/tc-sparc.c: Likewise.
* config/tc-tic30.c: Likewise.
* config/tc-tic30.h: Likewise.
* config/tc-tic4x.c: Likewise.
* config/tc-tic4x.h: Likewise.
* config/tc-tic54x.c: Likewise.
* config/tc-tic54x.h: Likewise.
* config/tc-v850.h: Likewise.
* config/tc-vax.c: Likewise.
* config/tc-vax.h: Likewise.
* config/tc-xstormy16.h: Likewise.
* config/tc-xtensa.h: Likewise.
* config/tc-z8k.c: Likewise.
* config/tc-z8k.h: Likewise.
* config/vms-a-conf.h
* doc/Makefile.am: Likewise.
* doc/all.texi: Likewise.
* doc/as.texinfo: Likewise.
* doc/Makefile.in: Regenerate.
* Makefile.in: Regenerate.
* configure: Regenerate.
* config.in: Regenerate.
* po/POTFILES.in: Regenerate.
2005-08-11 03:25:29 +02:00
|
|
|
|
pop_insert (coff_pseudo_table);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
}
|
|
|
|
|
|
2005-03-16 15:57:00 +01:00
|
|
|
|
static int
|
* README-vms: Delete.
* config-gas.com: Delete.
* makefile.vms: Delete.
* vmsconf.sh: Delete.
* config/atof-tahoe.c: Delete.
* config/m88k-opcode.h: Delete.
* config/obj-bout.c: Delete.
* config/obj-bout.h: Delete.
* config/obj-hp300.c: Delete.
* config/obj-hp300.h: Delete.
* config/tc-a29k.c: Delete.
* config/tc-a29k.h: Delete.
* config/tc-h8500.c: Delete.
* config/tc-h8500.h: Delete.
* config/tc-m88k.c: Delete.
* config/tc-m88k.h: Delete.
* config/tc-tahoe.c: Delete.
* config/tc-tahoe.h: Delete.
* config/tc-tic80.c: Delete.
* config/tc-tic80.h: Delete.
* config/tc-w65.c: Delete.
* config/tc-w65.h: Delete.
* config/te-aux.h: Delete.
* config/te-delt88.h: Delete.
* config/te-delta.h: Delete.
* config/te-dpx2.h: Delete.
* config/te-hp300.h: Delete.
* config/te-ic960.h: Delete.
* config/vms-a-conf.h: Delete.
* doc/c-a29k.texi: Delete.
* doc/c-h8500.texi: Delete.
* doc/c-m88k.texi: Delete.
* README: Remove obsolete examples, and list of supported targets.
* Makefile.am: Remove a29k, h8500, m88k, tahoe, tic80, w65,
bout and hp300 support.
(DEP_FLAGS): Don't define BFD_ASSEMBLER.
* configure.in: Remove --enable-bfd-assembler, need_bfd,
primary_bfd_gas.
* configure.tgt: Remove a29k, h8300-coff, h8500-*, i960 non-elf,
m68k non bfd, m88k, or32-coff, tic80-*, vax non-bfd, w65k-*, *-nindy.
* as.c: Remove all non-BFD_ASSEMBLER code, support for above targets.
* as.h: Likewise.
* dw2gencfi.c: Likewise.
* dwarf2dbg.c: Likewise.
* ehopt.c: Likewise.
* input-file.c: Likewise.
* listing.c: Likewise.
* literal.c: Likewise.
* messages.c: Likewise.
* obj.h: Likewise.
* output-file.c: Likewise.
* read.c: Likewise.
* stabs.c: Likewise.
* struc-symbol.h: Likewise.
* subsegs.c: Likewise.
* subsegs.h: Likewise.
* symbols.c: Likewise.
* symbols.h: Likewise.
* tc.h: Likewise.
* write.c: Likewise.
* write.h: Likewise.
* config/aout_gnu.h: Likewise.
* config/obj-aout.c: Likewise.
* config/obj-aout.h: Likewise.
* config/obj-coff.c: Likewise.
* config/obj-coff.h: Likewise.
* config/obj-evax.h: Likewise.
* config/obj-ieee.h: Likewise.
* config/tc-arm.c: Likewise.
* config/tc-arm.h: Likewise.
* config/tc-avr.c: Likewise.
* config/tc-avr.h: Likewise.
* config/tc-crx.h: Likewise.
* config/tc-d10v.h: Likewise.
* config/tc-d30v.h: Likewise.
* config/tc-dlx.h: Likewise.
* config/tc-fr30.h: Likewise.
* config/tc-frv.h: Likewise.
* config/tc-h8300.c: Likewise.
* config/tc-h8300.h: Likewise.
* config/tc-hppa.h: Likewise.
* config/tc-i370.h: Likewise.
* config/tc-i386.c: Likewise.
* config/tc-i386.h: Likewise.
* config/tc-i860.h: Likewise.
* config/tc-i960.c: Likewise.
* config/tc-i960.h: Likewise.
* config/tc-ip2k.h: Likewise.
* config/tc-iq2000.h: Likewise.
* config/tc-m32c.h: Likewise.
* config/tc-m32r.h: Likewise.
* config/tc-m68hc11.h: Likewise.
* config/tc-m68k.c: Likewise.
* config/tc-m68k.h: Likewise.
* config/tc-maxq.c: Likewise.
* config/tc-maxq.h: Likewise.
* config/tc-mcore.c: Likewise.
* config/tc-mcore.h: Likewise.
* config/tc-mn10200.h: Likewise.
* config/tc-mn10300.c: Likewise.
* config/tc-mn10300.h: Likewise.
* config/tc-ms1.h: Likewise.
* config/tc-msp430.c: Likewise.
* config/tc-msp430.h: Likewise.
* config/tc-ns32k.c: Likewise.
* config/tc-ns32k.h: Likewise.
* config/tc-openrisc.h: Likewise.
* config/tc-or32.c: Likewise.
* config/tc-or32.h: Likewise.
* config/tc-ppc.c: Likewise.
* config/tc-ppc.h: Likewise.
* config/tc-s390.h: Likewise.
* config/tc-sh.c: Likewise.
* config/tc-sh.h: Likewise.
* config/tc-sparc.c: Likewise.
* config/tc-tic30.c: Likewise.
* config/tc-tic30.h: Likewise.
* config/tc-tic4x.c: Likewise.
* config/tc-tic4x.h: Likewise.
* config/tc-tic54x.c: Likewise.
* config/tc-tic54x.h: Likewise.
* config/tc-v850.h: Likewise.
* config/tc-vax.c: Likewise.
* config/tc-vax.h: Likewise.
* config/tc-xstormy16.h: Likewise.
* config/tc-xtensa.h: Likewise.
* config/tc-z8k.c: Likewise.
* config/tc-z8k.h: Likewise.
* config/vms-a-conf.h
* doc/Makefile.am: Likewise.
* doc/all.texi: Likewise.
* doc/as.texinfo: Likewise.
* doc/Makefile.in: Regenerate.
* Makefile.in: Regenerate.
* configure: Regenerate.
* config.in: Regenerate.
* po/POTFILES.in: Regenerate.
2005-08-11 03:25:29 +02:00
|
|
|
|
coff_separate_stab_sections (void)
|
2005-03-16 15:57:00 +01:00
|
|
|
|
{
|
* README-vms: Delete.
* config-gas.com: Delete.
* makefile.vms: Delete.
* vmsconf.sh: Delete.
* config/atof-tahoe.c: Delete.
* config/m88k-opcode.h: Delete.
* config/obj-bout.c: Delete.
* config/obj-bout.h: Delete.
* config/obj-hp300.c: Delete.
* config/obj-hp300.h: Delete.
* config/tc-a29k.c: Delete.
* config/tc-a29k.h: Delete.
* config/tc-h8500.c: Delete.
* config/tc-h8500.h: Delete.
* config/tc-m88k.c: Delete.
* config/tc-m88k.h: Delete.
* config/tc-tahoe.c: Delete.
* config/tc-tahoe.h: Delete.
* config/tc-tic80.c: Delete.
* config/tc-tic80.h: Delete.
* config/tc-w65.c: Delete.
* config/tc-w65.h: Delete.
* config/te-aux.h: Delete.
* config/te-delt88.h: Delete.
* config/te-delta.h: Delete.
* config/te-dpx2.h: Delete.
* config/te-hp300.h: Delete.
* config/te-ic960.h: Delete.
* config/vms-a-conf.h: Delete.
* doc/c-a29k.texi: Delete.
* doc/c-h8500.texi: Delete.
* doc/c-m88k.texi: Delete.
* README: Remove obsolete examples, and list of supported targets.
* Makefile.am: Remove a29k, h8500, m88k, tahoe, tic80, w65,
bout and hp300 support.
(DEP_FLAGS): Don't define BFD_ASSEMBLER.
* configure.in: Remove --enable-bfd-assembler, need_bfd,
primary_bfd_gas.
* configure.tgt: Remove a29k, h8300-coff, h8500-*, i960 non-elf,
m68k non bfd, m88k, or32-coff, tic80-*, vax non-bfd, w65k-*, *-nindy.
* as.c: Remove all non-BFD_ASSEMBLER code, support for above targets.
* as.h: Likewise.
* dw2gencfi.c: Likewise.
* dwarf2dbg.c: Likewise.
* ehopt.c: Likewise.
* input-file.c: Likewise.
* listing.c: Likewise.
* literal.c: Likewise.
* messages.c: Likewise.
* obj.h: Likewise.
* output-file.c: Likewise.
* read.c: Likewise.
* stabs.c: Likewise.
* struc-symbol.h: Likewise.
* subsegs.c: Likewise.
* subsegs.h: Likewise.
* symbols.c: Likewise.
* symbols.h: Likewise.
* tc.h: Likewise.
* write.c: Likewise.
* write.h: Likewise.
* config/aout_gnu.h: Likewise.
* config/obj-aout.c: Likewise.
* config/obj-aout.h: Likewise.
* config/obj-coff.c: Likewise.
* config/obj-coff.h: Likewise.
* config/obj-evax.h: Likewise.
* config/obj-ieee.h: Likewise.
* config/tc-arm.c: Likewise.
* config/tc-arm.h: Likewise.
* config/tc-avr.c: Likewise.
* config/tc-avr.h: Likewise.
* config/tc-crx.h: Likewise.
* config/tc-d10v.h: Likewise.
* config/tc-d30v.h: Likewise.
* config/tc-dlx.h: Likewise.
* config/tc-fr30.h: Likewise.
* config/tc-frv.h: Likewise.
* config/tc-h8300.c: Likewise.
* config/tc-h8300.h: Likewise.
* config/tc-hppa.h: Likewise.
* config/tc-i370.h: Likewise.
* config/tc-i386.c: Likewise.
* config/tc-i386.h: Likewise.
* config/tc-i860.h: Likewise.
* config/tc-i960.c: Likewise.
* config/tc-i960.h: Likewise.
* config/tc-ip2k.h: Likewise.
* config/tc-iq2000.h: Likewise.
* config/tc-m32c.h: Likewise.
* config/tc-m32r.h: Likewise.
* config/tc-m68hc11.h: Likewise.
* config/tc-m68k.c: Likewise.
* config/tc-m68k.h: Likewise.
* config/tc-maxq.c: Likewise.
* config/tc-maxq.h: Likewise.
* config/tc-mcore.c: Likewise.
* config/tc-mcore.h: Likewise.
* config/tc-mn10200.h: Likewise.
* config/tc-mn10300.c: Likewise.
* config/tc-mn10300.h: Likewise.
* config/tc-ms1.h: Likewise.
* config/tc-msp430.c: Likewise.
* config/tc-msp430.h: Likewise.
* config/tc-ns32k.c: Likewise.
* config/tc-ns32k.h: Likewise.
* config/tc-openrisc.h: Likewise.
* config/tc-or32.c: Likewise.
* config/tc-or32.h: Likewise.
* config/tc-ppc.c: Likewise.
* config/tc-ppc.h: Likewise.
* config/tc-s390.h: Likewise.
* config/tc-sh.c: Likewise.
* config/tc-sh.h: Likewise.
* config/tc-sparc.c: Likewise.
* config/tc-tic30.c: Likewise.
* config/tc-tic30.h: Likewise.
* config/tc-tic4x.c: Likewise.
* config/tc-tic4x.h: Likewise.
* config/tc-tic54x.c: Likewise.
* config/tc-tic54x.h: Likewise.
* config/tc-v850.h: Likewise.
* config/tc-vax.c: Likewise.
* config/tc-vax.h: Likewise.
* config/tc-xstormy16.h: Likewise.
* config/tc-xtensa.h: Likewise.
* config/tc-z8k.c: Likewise.
* config/tc-z8k.h: Likewise.
* config/vms-a-conf.h
* doc/Makefile.am: Likewise.
* doc/all.texi: Likewise.
* doc/as.texinfo: Likewise.
* doc/Makefile.in: Regenerate.
* Makefile.in: Regenerate.
* configure: Regenerate.
* config.in: Regenerate.
* po/POTFILES.in: Regenerate.
2005-08-11 03:25:29 +02:00
|
|
|
|
return 1;
|
2005-03-16 15:57:00 +01:00
|
|
|
|
}
|
|
|
|
|
|
* README-vms: Delete.
* config-gas.com: Delete.
* makefile.vms: Delete.
* vmsconf.sh: Delete.
* config/atof-tahoe.c: Delete.
* config/m88k-opcode.h: Delete.
* config/obj-bout.c: Delete.
* config/obj-bout.h: Delete.
* config/obj-hp300.c: Delete.
* config/obj-hp300.h: Delete.
* config/tc-a29k.c: Delete.
* config/tc-a29k.h: Delete.
* config/tc-h8500.c: Delete.
* config/tc-h8500.h: Delete.
* config/tc-m88k.c: Delete.
* config/tc-m88k.h: Delete.
* config/tc-tahoe.c: Delete.
* config/tc-tahoe.h: Delete.
* config/tc-tic80.c: Delete.
* config/tc-tic80.h: Delete.
* config/tc-w65.c: Delete.
* config/tc-w65.h: Delete.
* config/te-aux.h: Delete.
* config/te-delt88.h: Delete.
* config/te-delta.h: Delete.
* config/te-dpx2.h: Delete.
* config/te-hp300.h: Delete.
* config/te-ic960.h: Delete.
* config/vms-a-conf.h: Delete.
* doc/c-a29k.texi: Delete.
* doc/c-h8500.texi: Delete.
* doc/c-m88k.texi: Delete.
* README: Remove obsolete examples, and list of supported targets.
* Makefile.am: Remove a29k, h8500, m88k, tahoe, tic80, w65,
bout and hp300 support.
(DEP_FLAGS): Don't define BFD_ASSEMBLER.
* configure.in: Remove --enable-bfd-assembler, need_bfd,
primary_bfd_gas.
* configure.tgt: Remove a29k, h8300-coff, h8500-*, i960 non-elf,
m68k non bfd, m88k, or32-coff, tic80-*, vax non-bfd, w65k-*, *-nindy.
* as.c: Remove all non-BFD_ASSEMBLER code, support for above targets.
* as.h: Likewise.
* dw2gencfi.c: Likewise.
* dwarf2dbg.c: Likewise.
* ehopt.c: Likewise.
* input-file.c: Likewise.
* listing.c: Likewise.
* literal.c: Likewise.
* messages.c: Likewise.
* obj.h: Likewise.
* output-file.c: Likewise.
* read.c: Likewise.
* stabs.c: Likewise.
* struc-symbol.h: Likewise.
* subsegs.c: Likewise.
* subsegs.h: Likewise.
* symbols.c: Likewise.
* symbols.h: Likewise.
* tc.h: Likewise.
* write.c: Likewise.
* write.h: Likewise.
* config/aout_gnu.h: Likewise.
* config/obj-aout.c: Likewise.
* config/obj-aout.h: Likewise.
* config/obj-coff.c: Likewise.
* config/obj-coff.h: Likewise.
* config/obj-evax.h: Likewise.
* config/obj-ieee.h: Likewise.
* config/tc-arm.c: Likewise.
* config/tc-arm.h: Likewise.
* config/tc-avr.c: Likewise.
* config/tc-avr.h: Likewise.
* config/tc-crx.h: Likewise.
* config/tc-d10v.h: Likewise.
* config/tc-d30v.h: Likewise.
* config/tc-dlx.h: Likewise.
* config/tc-fr30.h: Likewise.
* config/tc-frv.h: Likewise.
* config/tc-h8300.c: Likewise.
* config/tc-h8300.h: Likewise.
* config/tc-hppa.h: Likewise.
* config/tc-i370.h: Likewise.
* config/tc-i386.c: Likewise.
* config/tc-i386.h: Likewise.
* config/tc-i860.h: Likewise.
* config/tc-i960.c: Likewise.
* config/tc-i960.h: Likewise.
* config/tc-ip2k.h: Likewise.
* config/tc-iq2000.h: Likewise.
* config/tc-m32c.h: Likewise.
* config/tc-m32r.h: Likewise.
* config/tc-m68hc11.h: Likewise.
* config/tc-m68k.c: Likewise.
* config/tc-m68k.h: Likewise.
* config/tc-maxq.c: Likewise.
* config/tc-maxq.h: Likewise.
* config/tc-mcore.c: Likewise.
* config/tc-mcore.h: Likewise.
* config/tc-mn10200.h: Likewise.
* config/tc-mn10300.c: Likewise.
* config/tc-mn10300.h: Likewise.
* config/tc-ms1.h: Likewise.
* config/tc-msp430.c: Likewise.
* config/tc-msp430.h: Likewise.
* config/tc-ns32k.c: Likewise.
* config/tc-ns32k.h: Likewise.
* config/tc-openrisc.h: Likewise.
* config/tc-or32.c: Likewise.
* config/tc-or32.h: Likewise.
* config/tc-ppc.c: Likewise.
* config/tc-ppc.h: Likewise.
* config/tc-s390.h: Likewise.
* config/tc-sh.c: Likewise.
* config/tc-sh.h: Likewise.
* config/tc-sparc.c: Likewise.
* config/tc-tic30.c: Likewise.
* config/tc-tic30.h: Likewise.
* config/tc-tic4x.c: Likewise.
* config/tc-tic4x.h: Likewise.
* config/tc-tic54x.c: Likewise.
* config/tc-tic54x.h: Likewise.
* config/tc-v850.h: Likewise.
* config/tc-vax.c: Likewise.
* config/tc-vax.h: Likewise.
* config/tc-xstormy16.h: Likewise.
* config/tc-xtensa.h: Likewise.
* config/tc-z8k.c: Likewise.
* config/tc-z8k.h: Likewise.
* config/vms-a-conf.h
* doc/Makefile.am: Likewise.
* doc/all.texi: Likewise.
* doc/as.texinfo: Likewise.
* doc/Makefile.in: Regenerate.
* Makefile.in: Regenerate.
* configure: Regenerate.
* config.in: Regenerate.
* po/POTFILES.in: Regenerate.
2005-08-11 03:25:29 +02:00
|
|
|
|
const struct format_ops coff_format_ops =
|
1999-05-03 09:29:11 +02:00
|
|
|
|
{
|
|
|
|
|
bfd_target_coff_flavour,
|
2000-01-26 23:48:31 +01:00
|
|
|
|
0, /* dfl_leading_underscore */
|
|
|
|
|
1, /* emit_section_symbols */
|
* obj.h (struct format_ops): New members begin, app_file,
s_set_other, s_set_desc, s_get_type, s_set_type,
separate_stab_sections, init_stab_section.
* config/obj-multi.h: Update GPL notice to v2.
(obj_begin): New.
(obj_app_file): New.
(S_SET_SIZE): Test s_set_size for NULL before calling.
(S_SET_ALIGN): Similar for s_set_align.
(S_SET_OTHER): New.
(S_SET_DESC): New.
(S_GET_TYPE): New.
(S_SET_TYPE): New.
(SEPARATE_STAB_SECTIONS): New.
(INIT_STAB_SECTION): New.
(EMIT_SECTION_SYMBOLS): New.
(AOUT_STABS) [OBJ_MAYBE_AOUT]: Define.
* config/obj-elf.h: Update GPL notice to v2.
Mention that this file is included from obj-multi.h.
(obj_begin): Wrap definition in ifndef.
(elf_file_symbol): Constify declaration.
(obj_app_file): Ditto.
(SEPARATE_STAB_SECTIONS, INIT_STAB_SECTION, OBJ_PROCESS_STAB):
Wrap in ifndef SEPARATE_STAB_SECTIONS.
* config/obj-elf.c (elf_s_set_other): New.
(elf_file_symbol): Constify argument.
(elf_separate_stab_sections): New.
(elf_init_stab_section): New.
(elf_format_ops): Add new members. Remove comma at end.
* config/obj-ecoff.c (ecoff_separate_stab_sections): New.
(ecoff_format_ops): Add new fields. Remove comma at end.
Mention inconsistency for emit_section_symbols.
* config/obj-coff.h (c_dot_file_symbol): Constify declaration.
* config/obj-coff.c (c_dot_file_symbol): Constify argument.
(coff_separate_stab_sections): New.
(coff_format_ops): Add new members.
* config/obj-aout.c (obj_aout_sec_sym_ok_for_reloc): New.
(obj_aout_s_set_other): New.
(obj_aout_s_set_desc): New.
(obj_aout_s_get_type): New.
(obj_aout_s_set_type): New.
(obj_aout_separate_stab_sections): New.
(aout_format_ops): New members added. Use obj_aout_process_stab,
not 0. Use obj_aout_sec_sym_ok_for_reloc, not 0.
(obj_aout_frob_symbol): Add ATTRIBUTE_UNUSED to args as
appropriate.
(obj_aout_line, obj_aout_weak, obj_aout_type): Ditto.
2000-05-22 23:19:43 +02:00
|
|
|
|
0, /* begin */
|
|
|
|
|
c_dot_file_symbol,
|
1999-05-03 09:29:11 +02:00
|
|
|
|
coff_frob_symbol,
|
2000-01-26 23:48:31 +01:00
|
|
|
|
0, /* frob_file */
|
2000-11-08 01:24:23 +01:00
|
|
|
|
0, /* frob_file_before_adjust */
|
2002-09-05 02:01:18 +02:00
|
|
|
|
0, /* frob_file_before_fix */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
coff_frob_file_after_relocs,
|
2000-01-26 23:48:31 +01:00
|
|
|
|
0, /* s_get_size */
|
|
|
|
|
0, /* s_set_size */
|
|
|
|
|
0, /* s_get_align */
|
|
|
|
|
0, /* s_set_align */
|
|
|
|
|
0, /* s_get_other */
|
* obj.h (struct format_ops): New members begin, app_file,
s_set_other, s_set_desc, s_get_type, s_set_type,
separate_stab_sections, init_stab_section.
* config/obj-multi.h: Update GPL notice to v2.
(obj_begin): New.
(obj_app_file): New.
(S_SET_SIZE): Test s_set_size for NULL before calling.
(S_SET_ALIGN): Similar for s_set_align.
(S_SET_OTHER): New.
(S_SET_DESC): New.
(S_GET_TYPE): New.
(S_SET_TYPE): New.
(SEPARATE_STAB_SECTIONS): New.
(INIT_STAB_SECTION): New.
(EMIT_SECTION_SYMBOLS): New.
(AOUT_STABS) [OBJ_MAYBE_AOUT]: Define.
* config/obj-elf.h: Update GPL notice to v2.
Mention that this file is included from obj-multi.h.
(obj_begin): Wrap definition in ifndef.
(elf_file_symbol): Constify declaration.
(obj_app_file): Ditto.
(SEPARATE_STAB_SECTIONS, INIT_STAB_SECTION, OBJ_PROCESS_STAB):
Wrap in ifndef SEPARATE_STAB_SECTIONS.
* config/obj-elf.c (elf_s_set_other): New.
(elf_file_symbol): Constify argument.
(elf_separate_stab_sections): New.
(elf_init_stab_section): New.
(elf_format_ops): Add new members. Remove comma at end.
* config/obj-ecoff.c (ecoff_separate_stab_sections): New.
(ecoff_format_ops): Add new fields. Remove comma at end.
Mention inconsistency for emit_section_symbols.
* config/obj-coff.h (c_dot_file_symbol): Constify declaration.
* config/obj-coff.c (c_dot_file_symbol): Constify argument.
(coff_separate_stab_sections): New.
(coff_format_ops): Add new members.
* config/obj-aout.c (obj_aout_sec_sym_ok_for_reloc): New.
(obj_aout_s_set_other): New.
(obj_aout_s_set_desc): New.
(obj_aout_s_get_type): New.
(obj_aout_s_set_type): New.
(obj_aout_separate_stab_sections): New.
(aout_format_ops): New members added. Use obj_aout_process_stab,
not 0. Use obj_aout_sec_sym_ok_for_reloc, not 0.
(obj_aout_frob_symbol): Add ATTRIBUTE_UNUSED to args as
appropriate.
(obj_aout_line, obj_aout_weak, obj_aout_type): Ditto.
2000-05-22 23:19:43 +02:00
|
|
|
|
0, /* s_set_other */
|
2000-01-26 23:48:31 +01:00
|
|
|
|
0, /* s_get_desc */
|
* obj.h (struct format_ops): New members begin, app_file,
s_set_other, s_set_desc, s_get_type, s_set_type,
separate_stab_sections, init_stab_section.
* config/obj-multi.h: Update GPL notice to v2.
(obj_begin): New.
(obj_app_file): New.
(S_SET_SIZE): Test s_set_size for NULL before calling.
(S_SET_ALIGN): Similar for s_set_align.
(S_SET_OTHER): New.
(S_SET_DESC): New.
(S_GET_TYPE): New.
(S_SET_TYPE): New.
(SEPARATE_STAB_SECTIONS): New.
(INIT_STAB_SECTION): New.
(EMIT_SECTION_SYMBOLS): New.
(AOUT_STABS) [OBJ_MAYBE_AOUT]: Define.
* config/obj-elf.h: Update GPL notice to v2.
Mention that this file is included from obj-multi.h.
(obj_begin): Wrap definition in ifndef.
(elf_file_symbol): Constify declaration.
(obj_app_file): Ditto.
(SEPARATE_STAB_SECTIONS, INIT_STAB_SECTION, OBJ_PROCESS_STAB):
Wrap in ifndef SEPARATE_STAB_SECTIONS.
* config/obj-elf.c (elf_s_set_other): New.
(elf_file_symbol): Constify argument.
(elf_separate_stab_sections): New.
(elf_init_stab_section): New.
(elf_format_ops): Add new members. Remove comma at end.
* config/obj-ecoff.c (ecoff_separate_stab_sections): New.
(ecoff_format_ops): Add new fields. Remove comma at end.
Mention inconsistency for emit_section_symbols.
* config/obj-coff.h (c_dot_file_symbol): Constify declaration.
* config/obj-coff.c (c_dot_file_symbol): Constify argument.
(coff_separate_stab_sections): New.
(coff_format_ops): Add new members.
* config/obj-aout.c (obj_aout_sec_sym_ok_for_reloc): New.
(obj_aout_s_set_other): New.
(obj_aout_s_set_desc): New.
(obj_aout_s_get_type): New.
(obj_aout_s_set_type): New.
(obj_aout_separate_stab_sections): New.
(aout_format_ops): New members added. Use obj_aout_process_stab,
not 0. Use obj_aout_sec_sym_ok_for_reloc, not 0.
(obj_aout_frob_symbol): Add ATTRIBUTE_UNUSED to args as
appropriate.
(obj_aout_line, obj_aout_weak, obj_aout_type): Ditto.
2000-05-22 23:19:43 +02:00
|
|
|
|
0, /* s_set_desc */
|
|
|
|
|
0, /* s_get_type */
|
|
|
|
|
0, /* s_set_type */
|
2000-01-26 23:48:31 +01:00
|
|
|
|
0, /* copy_symbol_attributes */
|
|
|
|
|
0, /* generate_asm_lineno */
|
|
|
|
|
0, /* process_stab */
|
* obj.h (struct format_ops): New members begin, app_file,
s_set_other, s_set_desc, s_get_type, s_set_type,
separate_stab_sections, init_stab_section.
* config/obj-multi.h: Update GPL notice to v2.
(obj_begin): New.
(obj_app_file): New.
(S_SET_SIZE): Test s_set_size for NULL before calling.
(S_SET_ALIGN): Similar for s_set_align.
(S_SET_OTHER): New.
(S_SET_DESC): New.
(S_GET_TYPE): New.
(S_SET_TYPE): New.
(SEPARATE_STAB_SECTIONS): New.
(INIT_STAB_SECTION): New.
(EMIT_SECTION_SYMBOLS): New.
(AOUT_STABS) [OBJ_MAYBE_AOUT]: Define.
* config/obj-elf.h: Update GPL notice to v2.
Mention that this file is included from obj-multi.h.
(obj_begin): Wrap definition in ifndef.
(elf_file_symbol): Constify declaration.
(obj_app_file): Ditto.
(SEPARATE_STAB_SECTIONS, INIT_STAB_SECTION, OBJ_PROCESS_STAB):
Wrap in ifndef SEPARATE_STAB_SECTIONS.
* config/obj-elf.c (elf_s_set_other): New.
(elf_file_symbol): Constify argument.
(elf_separate_stab_sections): New.
(elf_init_stab_section): New.
(elf_format_ops): Add new members. Remove comma at end.
* config/obj-ecoff.c (ecoff_separate_stab_sections): New.
(ecoff_format_ops): Add new fields. Remove comma at end.
Mention inconsistency for emit_section_symbols.
* config/obj-coff.h (c_dot_file_symbol): Constify declaration.
* config/obj-coff.c (c_dot_file_symbol): Constify argument.
(coff_separate_stab_sections): New.
(coff_format_ops): Add new members.
* config/obj-aout.c (obj_aout_sec_sym_ok_for_reloc): New.
(obj_aout_s_set_other): New.
(obj_aout_s_set_desc): New.
(obj_aout_s_get_type): New.
(obj_aout_s_set_type): New.
(obj_aout_separate_stab_sections): New.
(aout_format_ops): New members added. Use obj_aout_process_stab,
not 0. Use obj_aout_sec_sym_ok_for_reloc, not 0.
(obj_aout_frob_symbol): Add ATTRIBUTE_UNUSED to args as
appropriate.
(obj_aout_line, obj_aout_weak, obj_aout_type): Ditto.
2000-05-22 23:19:43 +02:00
|
|
|
|
coff_separate_stab_sections,
|
|
|
|
|
obj_coff_init_stab_section,
|
2000-01-26 23:48:31 +01:00
|
|
|
|
0, /* sec_sym_ok_for_reloc */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
coff_pop_insert,
|
2000-01-26 23:48:31 +01:00
|
|
|
|
0, /* ecoff_set_ext */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
coff_obj_read_begin_hook,
|
2009-11-02 12:49:48 +01:00
|
|
|
|
coff_obj_symbol_new_hook,
|
2010-10-25 14:38:42 +02:00
|
|
|
|
coff_obj_symbol_clone_hook,
|
2010-10-26 05:44:39 +02:00
|
|
|
|
coff_adjust_symtab
|
1999-05-03 09:29:11 +02:00
|
|
|
|
};
|