summaryrefslogtreecommitdiffstats
path: root/contrib/binutils/gas/config/obj-aout.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/binutils/gas/config/obj-aout.c')
-rw-r--r--contrib/binutils/gas/config/obj-aout.c141
1 files changed, 102 insertions, 39 deletions
diff --git a/contrib/binutils/gas/config/obj-aout.c b/contrib/binutils/gas/config/obj-aout.c
index 7dc8946..eabbe92 100644
--- a/contrib/binutils/gas/config/obj-aout.c
+++ b/contrib/binutils/gas/config/obj-aout.c
@@ -1,5 +1,5 @@
/* a.out object file format
- Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 1996
+ Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -14,9 +14,12 @@ WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
the GNU General Public License for more details.
-You should have received a copy of the GNU General Public
-License along with GAS; see the file COPYING. If not, write
-to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+You should have received a copy of the GNU General Public License
+along with GAS; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+
+#define OBJ_HEADER "obj-aout.h"
#include "as.h"
#ifdef BFD_ASSEMBLER
@@ -66,7 +69,7 @@ static void obj_aout_line PARAMS ((int));
static void obj_aout_weak PARAMS ((int));
static void obj_aout_type PARAMS ((int));
-const pseudo_typeS obj_pseudo_table[] =
+const pseudo_typeS aout_pseudo_table[] =
{
{"line", obj_aout_line, 0}, /* source code line number */
{"ln", obj_aout_line, 0}, /* coff line number that we use anyway */
@@ -93,8 +96,8 @@ const pseudo_typeS obj_pseudo_table[] =
/* other stuff */
{"ABORT", s_abort, 0},
- {NULL} /* end sentinel */
-}; /* obj_pseudo_table */
+ {NULL, NULL, 0} /* end sentinel */
+}; /* aout_pseudo_table */
#ifdef BFD_ASSEMBLER
@@ -108,18 +111,21 @@ obj_aout_frob_symbol (sym, punt)
asection *sec;
int desc, type, other;
- flags = sym->bsym->flags;
- desc = S_GET_DESC (sym);
- type = S_GET_TYPE (sym);
- other = S_GET_OTHER (sym);
- sec = sym->bsym->section;
+ flags = symbol_get_bfdsym (sym)->flags;
+ desc = aout_symbol (symbol_get_bfdsym (sym))->desc;
+ type = aout_symbol (symbol_get_bfdsym (sym))->type;
+ other = aout_symbol (symbol_get_bfdsym (sym))->other;
+ sec = S_GET_SEGMENT (sym);
/* Only frob simple symbols this way right now. */
if (! (type & ~ (N_TYPE | N_EXT)))
{
if (type == (N_UNDF | N_EXT)
&& sec == &bfd_abs_section)
- sym->bsym->section = sec = bfd_und_section_ptr;
+ {
+ sec = bfd_und_section_ptr;
+ S_SET_SEGMENT (sym, sec);
+ }
if ((type & N_TYPE) != N_INDR
&& (type & N_TYPE) != N_SETA
@@ -141,7 +147,7 @@ obj_aout_frob_symbol (sym, punt)
case N_SETB:
/* Set the debugging flag for constructor symbols so that
BFD leaves them alone. */
- sym->bsym->flags |= BSF_DEBUGGING;
+ symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
/* You can't put a common symbol in a set. The way a set
element works is that the symbol has a definition and a
@@ -154,42 +160,42 @@ obj_aout_frob_symbol (sym, punt)
on the other hand, we certainly don't want anybody to be
mislead into thinking that their code will work. */
if (S_IS_COMMON (sym))
- as_bad ("Attempt to put a common symbol into set %s",
+ as_bad (_("Attempt to put a common symbol into set %s"),
S_GET_NAME (sym));
/* Similarly, you can't put an undefined symbol in a set. */
else if (! S_IS_DEFINED (sym))
- as_bad ("Attempt to put an undefined symbol into set %s",
+ as_bad (_("Attempt to put an undefined symbol into set %s"),
S_GET_NAME (sym));
break;
case N_INDR:
/* Put indirect symbols in the indirect section. */
- sym->bsym->section = bfd_ind_section_ptr;
- sym->bsym->flags |= BSF_INDIRECT;
+ S_SET_SEGMENT (sym, bfd_ind_section_ptr);
+ symbol_get_bfdsym (sym)->flags |= BSF_INDIRECT;
if (type & N_EXT)
{
- sym->bsym->flags |= BSF_EXPORT;
- sym->bsym->flags &=~ BSF_LOCAL;
+ symbol_get_bfdsym (sym)->flags |= BSF_EXPORT;
+ symbol_get_bfdsym (sym)->flags &=~ BSF_LOCAL;
}
break;
case N_WARNING:
/* Mark warning symbols. */
- sym->bsym->flags |= BSF_WARNING;
+ symbol_get_bfdsym (sym)->flags |= BSF_WARNING;
break;
}
}
else
{
- sym->bsym->flags |= BSF_DEBUGGING;
+ symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
}
- S_SET_TYPE (sym, type);
+ aout_symbol (symbol_get_bfdsym (sym))->type = type;
/* Double check weak symbols. */
- if (sym->bsym->flags & BSF_WEAK)
+ if (S_IS_WEAK (sym))
{
if (S_IS_COMMON (sym))
- as_bad ("Symbol `%s' can not be both weak and common",
+ as_bad (_("Symbol `%s' can not be both weak and common"),
S_GET_NAME (sym));
}
}
@@ -215,7 +221,7 @@ obj_aout_frob_file ()
assert (x == true);
}
-#else
+#else /* ! BFD_ASSEMBLER */
/* Relocation. */
@@ -247,9 +253,9 @@ obj_emit_relocations (where, fixP, segment_address_in_file)
unsigned int line;
if (expr_symbol_where (sym, &file, &line))
- as_bad_where (file, line, "unresolved relocation");
+ as_bad_where (file, line, _("unresolved relocation"));
else
- as_bad ("bad relocation: symbol `%s' not in symbol table",
+ as_bad (_("bad relocation: symbol `%s' not in symbol table"),
S_GET_NAME (sym));
}
@@ -291,7 +297,7 @@ obj_header_append (where, headers)
#endif /* CROSS_COMPILE */
}
-#endif
+#endif /* ! defined (obj_header_append) */
void
obj_symbol_to_chars (where, symbolP)
@@ -336,7 +342,7 @@ obj_emit_symbols (where, symbol_rootP)
case N_TEXT: S_SET_TYPE (symbolP, N_WEAKT); break;
case N_DATA: S_SET_TYPE (symbolP, N_WEAKD); break;
case N_BSS: S_SET_TYPE (symbolP, N_WEAKB); break;
- default: as_bad ("%s: bad type for weak symbol", temp); break;
+ default: as_bad (_("%s: bad type for weak symbol"), temp); break;
}
}
@@ -416,9 +422,17 @@ obj_aout_type (ignore)
{
++input_line_pointer;
if (strncmp (input_line_pointer, "object", 6) == 0)
+#ifdef BFD_ASSEMBLER
+ aout_symbol (symbol_get_bfdsym (sym))->other = 1;
+#else
S_SET_OTHER (sym, 1);
+#endif
else if (strncmp (input_line_pointer, "function", 8) == 0)
+#ifdef BFD_ASSEMBLER
+ aout_symbol (symbol_get_bfdsym (sym))->other = 2;
+#else
S_SET_OTHER (sym, 2);
+#endif
}
}
}
@@ -427,11 +441,6 @@ obj_aout_type (ignore)
s_ignore (0);
}
-void
-obj_read_begin_hook ()
-{
-}
-
#ifndef BFD_ASSEMBLER
void
@@ -450,7 +459,7 @@ obj_crawl_symbol_chain (headers)
if (symbolP->sy_mri_common)
{
if (S_IS_EXTERNAL (symbolP))
- as_bad ("%s: global symbols not supported in common sections",
+ as_bad (_("%s: global symbols not supported in common sections"),
S_GET_NAME (symbolP));
*symbolPP = symbol_next (symbolP);
continue;
@@ -508,7 +517,7 @@ obj_crawl_symbol_chain (headers)
}
else /* .Stabd case. */
symbolP->sy_name_offset = 0;
- symbolPP = &(symbol_next (symbolP));
+ symbolPP = &symbolP->sy_next;
}
else
{
@@ -517,7 +526,7 @@ obj_crawl_symbol_chain (headers)
Well, maybe if you're doing twisted things with
register names... */
{
- as_bad ("Local symbol %s never defined.", decode_local_label_name (S_GET_NAME (symbolP)));
+ as_bad (_("Local symbol %s never defined."), decode_local_label_name (S_GET_NAME (symbolP)));
} /* oops. */
/* Unhook it from the chain */
@@ -605,7 +614,7 @@ DEFUN_VOID (s_sect)
}
if (exp >= 1000)
{
- as_bad ("subsegment index too high");
+ as_bad (_("subsegment index too high"));
}
if (strcmp (section_name, ".text") == 0)
@@ -626,4 +635,58 @@ DEFUN_VOID (s_sect)
#endif /* ! BFD_ASSEMBLER */
+#ifdef BFD_ASSEMBLER
+
+/* Support for an AOUT emulation. */
+
+static void aout_pop_insert PARAMS ((void));
+static int obj_aout_s_get_other PARAMS ((symbolS *));
+static int obj_aout_s_get_desc PARAMS ((symbolS *));
+
+static void
+aout_pop_insert ()
+{
+ pop_insert (aout_pseudo_table);
+}
+
+static int
+obj_aout_s_get_other (sym)
+ symbolS *sym;
+{
+ return aout_symbol (symbol_get_bfdsym (sym))->other;
+}
+
+static int
+obj_aout_s_get_desc (sym)
+ symbolS *sym;
+{
+ return aout_symbol (symbol_get_bfdsym (sym))->desc;
+}
+
+
+const struct format_ops aout_format_ops =
+{
+ bfd_target_aout_flavour,
+ 1, /* dfl_leading_underscore */
+ 0, /* emit_section_symbols */
+ obj_aout_frob_symbol,
+ obj_aout_frob_file,
+ 0, /* frob_file_after_relocs */
+ 0, /* s_get_size */
+ 0, /* s_set_size */
+ 0, /* s_get_align */
+ 0, /* s_set_align */
+ obj_aout_s_get_other,
+ obj_aout_s_get_desc,
+ 0, /* copy_symbol_attributes */
+ 0, /* generate_asm_lineno */
+ 0, /* process_stab */
+ 0, /* sec_sym_ok_for_reloc */
+ aout_pop_insert,
+ 0, /* ecoff_set_ext */
+ 0, /* read_begin_hook */
+ 0 /* symbol_new_hook */
+};
+#endif BFD_ASSEMBLER
+
/* end of obj-aout.c */
OpenPOWER on IntegriCloud