diff options
author | Ian Lance Taylor <ian@airs.com> | 1999-06-03 00:29:48 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1999-06-03 00:29:48 +0000 |
commit | 49309057b4c45a2586735182830793c77633f51d (patch) | |
tree | 1aaca2ad34e77400fd91047b31afce59afa71426 /gas/config | |
parent | 2b47531bf9ef778773831ecb1b43186e95ffe8d7 (diff) | |
download | gdb-49309057b4c45a2586735182830793c77633f51d.zip gdb-49309057b4c45a2586735182830793c77633f51d.tar.gz gdb-49309057b4c45a2586735182830793c77633f51d.tar.bz2 |
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.
Diffstat (limited to 'gas/config')
36 files changed, 395 insertions, 333 deletions
diff --git a/gas/config/obj-aout.c b/gas/config/obj-aout.c index b519347..5465ef4 100644 --- a/gas/config/obj-aout.c +++ b/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, 1999 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -14,9 +14,10 @@ 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. */ #include "as.h" #ifdef BFD_ASSEMBLER @@ -108,18 +109,21 @@ obj_aout_frob_symbol (sym, punt) asection *sec; int desc, type, other; - flags = sym->bsym->flags; + flags = symbol_get_bfdsym (sym)->flags; desc = S_GET_DESC (sym); type = S_GET_TYPE (sym); other = S_GET_OTHER (sym); - sec = sym->bsym->section; + 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 +145,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 @@ -164,29 +168,29 @@ obj_aout_frob_symbol (sym, punt) 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); /* 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"), diff --git a/gas/config/obj-aout.h b/gas/config/obj-aout.h index 339070e..2cf33fd 100644 --- a/gas/config/obj-aout.h +++ b/gas/config/obj-aout.h @@ -1,5 +1,5 @@ /* obj-aout.h, a.out object file format for gas, the assembler. - Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 1998 + Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 98, 1999 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -60,18 +60,24 @@ typedef struct nlist obj_symbol_type; /* Symbol table entry */ #ifdef BFD_ASSEMBLER -#define S_SET_OTHER(S,V) (aout_symbol((S)->bsym)->other = (V)) -#define S_SET_TYPE(S,T) (aout_symbol((S)->bsym)->type = (T)) -#define S_SET_DESC(S,D) (aout_symbol((S)->bsym)->desc = (D)) -#define S_GET_OTHER(S) (aout_symbol((S)->bsym)->other) -#define S_GET_TYPE(S) (aout_symbol((S)->bsym)->type) -#define S_GET_DESC(S) (aout_symbol((S)->bsym)->desc) +#define S_SET_OTHER(S,V) \ + (aout_symbol (symbol_get_bfdsym (S))->other = (V)) +#define S_SET_TYPE(S,T) \ + (aout_symbol (symbol_get_bfdsym (S))->type = (T)) +#define S_SET_DESC(S,D) \ + (aout_symbol (symbol_get_bfdsym (S))->desc = (D)) +#define S_GET_OTHER(S) \ + (aout_symbol (symbol_get_bfdsym (S))->other) +#define S_GET_TYPE(S) \ + (aout_symbol (symbol_get_bfdsym (S))->type) +#define S_GET_DESC(S) \ + (aout_symbol (symbol_get_bfdsym (S))->desc) asection *text_section, *data_section, *bss_section; #define obj_frob_symbol(S,PUNT) obj_aout_frob_symbol (S, &PUNT) #define obj_frob_file() obj_aout_frob_file () -extern void obj_aout_frob_symbol PARAMS ((struct symbol *, int *)); +extern void obj_aout_frob_symbol PARAMS ((symbolS *, int *)); extern void obj_aout_frob_file PARAMS ((void)); #define obj_sec_sym_ok_for_reloc(SEC) (1) diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c index e8e3df9..a6bdaee 100644 --- a/gas/config/obj-coff.c +++ b/gas/config/obj-coff.c @@ -1,5 +1,5 @@ /* coff object file format - Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 1998 + Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. This file is part of GAS. @@ -249,8 +249,8 @@ SA_SET_SYM_ENDNDX (sym, val) { combined_entry_type *entry, *p; - entry = &coffsymbol (sym->bsym)->native[1]; - p = coffsymbol (val->bsym)->native; + entry = &coffsymbol (symbol_get_bfdsym (sym))->native[1]; + p = coffsymbol (symbol_get_bfdsym (val))->native; entry->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.p = p; entry->fix_end = 1; } @@ -262,8 +262,8 @@ SA_SET_SYM_TAGNDX (sym, val) { combined_entry_type *entry, *p; - entry = &coffsymbol (sym->bsym)->native[1]; - p = coffsymbol (val->bsym)->native; + entry = &coffsymbol (symbol_get_bfdsym (sym))->native[1]; + p = coffsymbol (symbol_get_bfdsym (val))->native; entry->u.auxent.x_sym.x_tagndx.p = p; entry->fix_tag = 1; } @@ -272,7 +272,7 @@ static int S_GET_DATA_TYPE (sym) symbolS *sym; { - return coffsymbol (sym->bsym)->native->u.syment.n_type; + return coffsymbol (symbol_get_bfdsym (sym))->native->u.syment.n_type; } int @@ -280,7 +280,7 @@ S_SET_DATA_TYPE (sym, val) symbolS *sym; int val; { - coffsymbol (sym->bsym)->native->u.syment.n_type = val; + coffsymbol (symbol_get_bfdsym (sym))->native->u.syment.n_type = val; return val; } @@ -288,7 +288,7 @@ int S_GET_STORAGE_CLASS (sym) symbolS *sym; { - return coffsymbol (sym->bsym)->native->u.syment.n_sclass; + return coffsymbol (symbol_get_bfdsym (sym))->native->u.syment.n_sclass; } int @@ -296,7 +296,7 @@ S_SET_STORAGE_CLASS (sym, val) symbolS *sym; int val; { - coffsymbol (sym->bsym)->native->u.syment.n_sclass = val; + coffsymbol (symbol_get_bfdsym (sym))->native->u.syment.n_sclass = val; return val; } @@ -339,7 +339,7 @@ c_dot_file_symbol (filename) S_SET_STORAGE_CLASS (symbolP, C_FILE); S_SET_NUMBER_AUXILIARY (symbolP, 1); - symbolP->bsym->flags = BSF_DEBUGGING; + symbol_get_bfdsym (symbolP)->flags = BSF_DEBUGGING; #ifndef NO_LISTING { @@ -385,7 +385,7 @@ coff_obj_symbol_new_hook (symbolP) char * s = (char *) xmalloc (sz); memset (s, 0, sz); - coffsymbol (symbolP->bsym)->native = (combined_entry_type *) s; + coffsymbol (symbol_get_bfdsym (symbolP))->native = (combined_entry_type *) s; S_SET_DATA_TYPE (symbolP, T_NULL); S_SET_STORAGE_CLASS (symbolP, 0); @@ -434,7 +434,8 @@ coff_add_linesym (sym) { if (line_nos) { - coffsymbol (current_lineno_sym->bsym)->lineno = (alent *) line_nos; + coffsymbol (symbol_get_bfdsym (current_lineno_sym))->lineno = + (alent *) line_nos; coff_n_line_nos++; line_nos = 0; } @@ -532,7 +533,7 @@ obj_coff_def (what) /* Initialize the new symbol */ def_symbol_in_progress = symbol_make (symbol_name_copy); - def_symbol_in_progress->sy_frag = &zero_address_frag; + symbol_set_frag (def_symbol_in_progress, &zero_address_frag); S_SET_VALUE (def_symbol_in_progress, 0); if (S_IS_STRING (def_symbol_in_progress)) @@ -585,7 +586,7 @@ obj_coff_endef (ignore) CONST char *name; S_SET_SEGMENT (def_symbol_in_progress, text_section); - name = bfd_asymbol_name (def_symbol_in_progress->bsym); + name = S_GET_NAME (def_symbol_in_progress); if (name[1] == 'b' && name[2] == 'f') { if (! in_function ()) @@ -909,17 +910,19 @@ obj_coff_val (ignore) #endif if (!strcmp (symbol_name, ".")) { - def_symbol_in_progress->sy_frag = frag_now; + symbol_set_frag (def_symbol_in_progress, frag_now); S_SET_VALUE (def_symbol_in_progress, (valueT) frag_now_fix ()); /* If the .val is != from the .def (e.g. statics) */ } else if (strcmp (S_GET_NAME (def_symbol_in_progress), symbol_name)) { - def_symbol_in_progress->sy_value.X_op = O_symbol; - def_symbol_in_progress->sy_value.X_add_symbol = - symbol_find_or_make (symbol_name); - def_symbol_in_progress->sy_value.X_op_symbol = NULL; - def_symbol_in_progress->sy_value.X_add_number = 0; + 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); /* If the segment is undefined when the forward reference is resolved, then copy the segment id from the forward @@ -1034,7 +1037,8 @@ coff_frob_symbol (symp, punt) coff_last_function = symp; if (S_GET_NUMBER_AUXILIARY (symp) < 1) S_SET_NUMBER_AUXILIARY (symp, 1); - auxp = &coffsymbol (symp->bsym)->native[1].u.auxent; + auxp = + &coffsymbol (symbol_get_bfdsym (symp))->native[1].u.auxent; memset (auxp->x_sym.x_fcnary.x_ary.x_dimen, 0, sizeof (auxp->x_sym.x_fcnary.x_ary.x_dimen)); } @@ -1055,7 +1059,7 @@ coff_frob_symbol (symp, punt) *punt = 1; if (SF_GET_FUNCTION (symp)) - symp->bsym->flags |= BSF_FUNCTION; + symbol_get_bfdsym (symp)->flags |= BSF_FUNCTION; /* more ... */ } @@ -1069,7 +1073,7 @@ coff_frob_symbol (symp, punt) /* This is pretty horrible, but we have to set *punt correctly in order to call SA_SET_SYM_ENDNDX correctly. */ if (! symp->sy_used_in_reloc - && ((symp->bsym->flags & BSF_SECTION_SYM) != 0 + && ((symbol_get_bfdsym (symp)->flags & BSF_SECTION_SYM) != 0 || (! S_IS_EXTERNAL (symp) && ! symp->sy_tc.output && S_GET_STORAGE_CLASS (symp) != C_FILE))) @@ -1078,7 +1082,7 @@ coff_frob_symbol (symp, punt) if (set_end != (symbolS *) NULL && ! *punt - && ((symp->bsym->flags & BSF_NOT_AT_END) != 0 + && ((symbol_get_bfdsym (symp)->flags & BSF_NOT_AT_END) != 0 || (S_IS_DEFINED (symp) && ! S_IS_COMMON (symp) && (! S_IS_EXTERNAL (symp) || SF_GET_FUNCTION (symp))))) @@ -1100,22 +1104,22 @@ coff_frob_symbol (symp, punt) coff_last_bf = symp; } - if (coffsymbol (symp->bsym)->lineno) + if (coffsymbol (symbol_get_bfdsym (symp))->lineno) { int i; struct line_no *lptr; alent *l; - lptr = (struct line_no *) coffsymbol (symp->bsym)->lineno; + lptr = (struct line_no *) coffsymbol (symbol_get_bfdsym (symp))->lineno; for (i = 0; lptr; lptr = lptr->next) i++; - lptr = (struct line_no *) coffsymbol (symp->bsym)->lineno; + lptr = (struct line_no *) coffsymbol (symbol_get_bfdsym (symp))->lineno; /* 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). */ l = (alent *) xmalloc ((i + 2) * sizeof (alent)); - coffsymbol (symp->bsym)->lineno = l; + coffsymbol (symbol_get_bfdsym (symp))->lineno = l; l[i + 1].line_number = 0; l[i + 1].u.sym = NULL; for (; i > 0; i--) diff --git a/gas/config/obj-coff.h b/gas/config/obj-coff.h index 4650477..a8799a3 100644 --- a/gas/config/obj-coff.h +++ b/gas/config/obj-coff.h @@ -154,7 +154,7 @@ #define OBJ_COFF_MAX_AUXENTRIES 1 #endif /* OBJ_COFF_MAX_AUXENTRIES */ -extern void coff_obj_symbol_new_hook PARAMS ((struct symbol *)); +extern void coff_obj_symbol_new_hook PARAMS ((symbolS *)); #define obj_symbol_new_hook coff_obj_symbol_new_hook extern void coff_obj_read_begin_hook PARAMS ((void)); @@ -211,32 +211,35 @@ extern void coff_obj_read_begin_hook PARAMS ((void)); /* Alter the field names, for now, until we've fixed up the other references to use the new name. */ #ifdef TC_I960 -#define TC_SYMFIELD_TYPE struct symbol * +#define TC_SYMFIELD_TYPE symbolS * #define sy_tc bal #endif #define OBJ_SYMFIELD_TYPE unsigned long #define sy_obj sy_flags -#define SYM_AUXENT(S) (&coffsymbol ((S)->bsym)->native[1].u.auxent) -#define SYM_AUXINFO(S) (&coffsymbol ((S)->bsym)->native[1]) +#define SYM_AUXENT(S) \ + (&coffsymbol (symbol_get_bfdsym (S))->native[1].u.auxent) +#define SYM_AUXINFO(S) \ + (&coffsymbol (symbol_get_bfdsym (S))->native[1]) #define DO_NOT_STRIP 0 extern void obj_coff_section PARAMS ((int)); /* The number of auxiliary entries */ -#define S_GET_NUMBER_AUXILIARY(s) (coffsymbol((s)->bsym)->native->u.syment.n_numaux) +#define S_GET_NUMBER_AUXILIARY(s) \ + (coffsymbol (symbol_get_bfdsym (s))->native->u.syment.n_numaux) /* The number of auxiliary entries */ #define S_SET_NUMBER_AUXILIARY(s,v) (S_GET_NUMBER_AUXILIARY (s) = (v)) /* True if a symbol name is in the string table, i.e. its length is > 8. */ #define S_IS_STRING(s) (strlen(S_GET_NAME(s)) > 8 ? 1 : 0) -extern int S_SET_DATA_TYPE PARAMS ((struct symbol *, int)); -extern int S_SET_STORAGE_CLASS PARAMS ((struct symbol *, int)); -extern int S_GET_STORAGE_CLASS PARAMS ((struct symbol *)); -extern void SA_SET_SYM_ENDNDX PARAMS ((struct symbol *, struct symbol *)); +extern int S_SET_DATA_TYPE PARAMS ((symbolS *, int)); +extern int S_SET_STORAGE_CLASS PARAMS ((symbolS *, int)); +extern int S_GET_STORAGE_CLASS PARAMS ((symbolS *)); +extern void SA_SET_SYM_ENDNDX PARAMS ((symbolS *, symbolS *)); /* Auxiliary entry macros. SA_ stands for symbol auxiliary */ /* Omit the tv related fields */ @@ -298,9 +301,9 @@ extern void SA_SET_SYM_ENDNDX PARAMS ((struct symbol *, struct symbol *)); /* All other bits are unused. */ /* Accessors */ -#define SF_GET(s) ((s)->sy_flags) -#define SF_GET_DEBUG(s) ((s)->bsym->flags & BSF_DEBUGGING) -#define SF_SET_DEBUG(s) ((s)->bsym->flags |= BSF_DEBUGGING) +#define SF_GET(s) (*symbol_get_obj (s)) +#define SF_GET_DEBUG(s) (symbol_get_bfdsym (s)->flags & BSF_DEBUGGING) +#define SF_SET_DEBUG(s) (symbol_get_bfdsym (s)->flags |= BSF_DEBUGGING) #define SF_GET_NORMAL_FIELD(s) (SF_GET (s) & SF_NORMAL_MASK) #define SF_GET_DEBUG_FIELD(s) (SF_GET (s) & SF_DEBUG_MASK) #define SF_GET_FILE(s) (SF_GET (s) & SF_FILE) @@ -346,13 +349,13 @@ extern int coff_line_base; extern int coff_n_line_nos; #define obj_emit_lineno(WHERE,LINE,FILE_START) abort () -extern void coff_add_linesym PARAMS ((struct symbol *)); +extern void coff_add_linesym PARAMS ((symbolS *)); void c_dot_file_symbol PARAMS ((char *filename)); #define obj_app_file c_dot_file_symbol -extern void coff_frob_symbol PARAMS ((struct symbol *, int *)); +extern void coff_frob_symbol PARAMS ((symbolS *, int *)); extern void coff_adjust_symtab PARAMS ((void)); extern void coff_frob_section PARAMS ((segT)); extern void coff_adjust_section_syms PARAMS ((bfd *, asection *, PTR)); @@ -364,7 +367,7 @@ extern void coff_frob_file_after_relocs PARAMS ((void)); #define obj_frob_section(S) coff_frob_section (S) #define obj_frob_file_after_relocs() coff_frob_file_after_relocs () -extern struct symbol *coff_last_function; +extern symbolS *coff_last_function; /* Forward the segment of a forwarded symbol, handle assignments that just copy symbol values, etc. */ @@ -778,7 +781,7 @@ extern void c_dot_file_symbol PARAMS ((char *filename)); #define obj_app_file c_dot_file_symbol extern void obj_extra_stuff PARAMS ((object_headers * headers)); -extern segT s_get_segment PARAMS ((struct symbol * ptr)); +extern segT s_get_segment PARAMS ((symbolS *ptr)); extern void c_section_header PARAMS ((struct internal_scnhdr * header, char *name, @@ -792,7 +795,7 @@ extern void c_section_header PARAMS ((struct internal_scnhdr * header, long alignment)); #ifndef tc_coff_symbol_emit_hook -void tc_coff_symbol_emit_hook PARAMS ((struct symbol *)); +void tc_coff_symbol_emit_hook PARAMS ((symbolS *)); #endif /* sanity check */ diff --git a/gas/config/obj-ecoff.h b/gas/config/obj-ecoff.h index 427e619..8bca254 100644 --- a/gas/config/obj-ecoff.h +++ b/gas/config/obj-ecoff.h @@ -36,10 +36,14 @@ symbols is undefined (this last is needed to distinguish a .extern symbols from a .comm symbol). */ -#define TARGET_SYMBOL_FIELDS \ - struct efdr *ecoff_file; \ - struct localsym *ecoff_symbol; \ +struct ecoff_sy_obj +{ + struct efdr *ecoff_file; + struct localsym *ecoff_symbol; valueT ecoff_extern_size; +}; + +#define OBJ_SYMFIELD_TYPE struct ecoff_sy_obj /* Modify the ECOFF symbol. */ #define obj_frob_symbol(symp, punt) ecoff_frob_symbol (symp) @@ -64,4 +68,4 @@ extern void ecoff_frob_file PARAMS ((void)); #define obj_sec_sym_ok_for_reloc(SEC) 1 #define obj_ecoff_set_ext ecoff_set_ext -extern void obj_ecoff_set_ext PARAMS ((struct symbol *, EXTR *)); +extern void obj_ecoff_set_ext PARAMS ((symbolS *, EXTR *)); diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index 4ff8950..24f0926 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -1,5 +1,6 @@ /* ELF object file format - Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. + Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -235,8 +236,8 @@ elf_file_symbol (s) symbolS *sym; sym = symbol_new (s, absolute_section, (valueT) 0, (struct frag *) 0); - sym->sy_frag = &zero_address_frag; - sym->bsym->flags |= BSF_FILE; + symbol_set_frag (sym, &zero_address_frag); + symbol_get_bfdsym (sym)->flags |= BSF_FILE; if (symbol_rootP != sym) { @@ -322,7 +323,7 @@ obj_elf_common (ignore) as_warn (_("Common alignment negative; 0 assumed")); } } - if (symbolP->local) + if (symbol_get_obj (symbolP)->local) { segT old_sec; int old_subsec; @@ -350,8 +351,8 @@ obj_elf_common (ignore) if (align) frag_align (align, 0, 0); if (S_GET_SEGMENT (symbolP) == bss_section) - symbolP->sy_frag->fr_symbol = 0; - symbolP->sy_frag = frag_now; + symbol_get_frag (symbolP)->fr_symbol = 0; + symbol_set_frag (symbolP, frag_now); pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP, (offsetT) size, (char *) 0); *pfrag = 0; @@ -389,7 +390,7 @@ obj_elf_common (ignore) goto allocate_common; } - symbolP->bsym->flags |= BSF_OBJECT; + symbol_get_bfdsym (symbolP)->flags |= BSF_OBJECT; demand_empty_rest_of_line (); return; @@ -425,7 +426,7 @@ obj_elf_local (ignore) *input_line_pointer = c; SKIP_WHITESPACE (); S_CLEAR_EXTERNAL (symbolP); - symbolP->local = 1; + symbol_get_obj (symbolP)->local = 1; if (c == ',') { input_line_pointer++; @@ -454,7 +455,7 @@ obj_elf_weak (ignore) *input_line_pointer = c; SKIP_WHITESPACE (); S_SET_WEAK (symbolP); - symbolP->local = 1; + symbol_get_obj (symbolP)->local = 1; if (c == ',') { input_line_pointer++; @@ -815,7 +816,7 @@ obj_elf_section (xxx) /* Add a symbol for this section to the symbol table. */ secsym = symbol_find (string); if (secsym != NULL) - secsym->bsym = sec->symbol; + symbol_set_bfdsym (secsym, sec->symbol); else symbol_table_insert (section_symbol (sec)); @@ -949,7 +950,7 @@ obj_elf_symver (ignore) *input_line_pointer = c; - if (sym->sy_obj.versioned_name != NULL) + if (symbol_get_obj (sym)->versioned_name != NULL) { as_bad (_("multiple .symver directives for symbol `%s'"), S_GET_NAME (sym)); @@ -975,14 +976,14 @@ obj_elf_symver (ignore) *input_line_pointer++ = c; } - sym->sy_obj.versioned_name = xstrdup (name); + symbol_get_obj (sym)->versioned_name = xstrdup (name); *input_line_pointer = c; - if (strchr (sym->sy_obj.versioned_name, ELF_VER_CHR) == NULL) + if (strchr (symbol_get_obj (sym)->versioned_name, ELF_VER_CHR) == NULL) { as_bad (_("missing version name in `%s' for symbol `%s'"), - sym->sy_obj.versioned_name, S_GET_NAME (sym)); + symbol_get_obj (sym)->versioned_name, S_GET_NAME (sym)); ignore_rest_of_line (); return; } @@ -1012,7 +1013,7 @@ obj_elf_vtable_inherit (ignore) the same child symbol. Also, we can currently only do this if the child symbol is already exists and is placed in a fragment. */ - if (csym == NULL || csym->sy_frag == NULL) + if (csym == NULL || symbol_get_frag (csym) == NULL) { as_bad ("expected `%s' to have already been set for .vtable_inherit", cname); @@ -1055,8 +1056,9 @@ obj_elf_vtable_inherit (ignore) if (bad) return; - assert (csym->sy_value.X_op == O_constant); - fix_new (csym->sy_frag, csym->sy_value.X_add_number, 0, psym, 0, 0, + assert (symbol_get_value_expression (csym)->X_op == O_constant); + fix_new (symbol_get_frag (csym), + symbol_get_value_expression (csym)->X_add_number, 0, psym, 0, 0, BFD_RELOC_VTABLE_INHERIT); } @@ -1113,8 +1115,11 @@ void obj_symbol_new_hook (symbolP) symbolS *symbolP; { - symbolP->sy_obj.size = NULL; - symbolP->sy_obj.versioned_name = NULL; + struct elf_obj_sy *sy_obj; + + sy_obj = symbol_get_obj (symbolP); + sy_obj->size = NULL; + sy_obj->versioned_name = NULL; #ifdef NEED_ECOFF_DEBUG if (ECOFF_DEBUGGING) @@ -1225,8 +1230,9 @@ obj_elf_size (ignore) S_SET_SIZE (sym, exp.X_add_number); else { - sym->sy_obj.size = (expressionS *) xmalloc (sizeof (expressionS)); - *sym->sy_obj.size = exp; + symbol_get_obj (sym)->size = + (expressionS *) xmalloc (sizeof (expressionS)); + *symbol_get_obj (sym)->size = exp; } demand_empty_rest_of_line (); } @@ -1284,7 +1290,7 @@ obj_elf_type (ignore) *input_line_pointer = c; - sym->bsym->flags |= type; + symbol_get_bfdsym (sym)->flags |= type; demand_empty_rest_of_line (); } @@ -1393,7 +1399,7 @@ elf_ecoff_set_ext (sym, ext) symbolS *sym; struct ecoff_extr *ext; { - sym->bsym->udata.p = (PTR) ext; + symbol_get_bfdsym (sym)->udata.p = (PTR) ext; } /* This function is called by bfd_ecoff_debug_externals. It is @@ -1429,35 +1435,39 @@ elf_frob_symbol (symp, puntp) symbolS *symp; int *puntp; { + struct elf_obj_sy *sy_obj; + #ifdef NEED_ECOFF_DEBUG if (ECOFF_DEBUGGING) ecoff_frob_symbol (symp); #endif - if (symp->sy_obj.size != NULL) + sy_obj = symbol_get_obj (symp); + + if (sy_obj->size != NULL) { - switch (symp->sy_obj.size->X_op) + switch (sy_obj->size->X_op) { case O_subtract: S_SET_SIZE (symp, - (S_GET_VALUE (symp->sy_obj.size->X_add_symbol) - + symp->sy_obj.size->X_add_number - - S_GET_VALUE (symp->sy_obj.size->X_op_symbol))); + (S_GET_VALUE (sy_obj->size->X_add_symbol) + + sy_obj->size->X_add_number + - S_GET_VALUE (sy_obj->size->X_op_symbol))); break; case O_constant: S_SET_SIZE (symp, - (S_GET_VALUE (symp->sy_obj.size->X_add_symbol) - + symp->sy_obj.size->X_add_number)); + (S_GET_VALUE (sy_obj->size->X_add_symbol) + + sy_obj->size->X_add_number)); break; default: as_bad (_(".size expression too complicated to fix up")); break; } - free (symp->sy_obj.size); - symp->sy_obj.size = NULL; + free (sy_obj->size); + sy_obj->size = NULL; } - if (symp->sy_obj.versioned_name != NULL) + if (sy_obj->versioned_name != NULL) { /* This symbol was given a new name with the .symver directive. @@ -1477,15 +1487,15 @@ elf_frob_symbol (symp, puntp) /* Verify that the name isn't using the @@ syntax--this is reserved for definitions of the default version to link against. */ - p = strchr (symp->sy_obj.versioned_name, ELF_VER_CHR); + p = strchr (sy_obj->versioned_name, ELF_VER_CHR); know (p != NULL); if (p[1] == ELF_VER_CHR) { as_bad (_("invalid attempt to declare external version name as default in symbol `%s'"), - symp->sy_obj.versioned_name); + sy_obj->versioned_name); *puntp = true; } - S_SET_NAME (symp, symp->sy_obj.versioned_name); + S_SET_NAME (symp, sy_obj->versioned_name); } else { @@ -1497,7 +1507,7 @@ elf_frob_symbol (symp, puntp) where the loop will still see it. It would probably be better to do this in obj_frob_file_before_adjust. */ - symp2 = symbol_find_or_make (symp->sy_obj.versioned_name); + symp2 = symbol_find_or_make (sy_obj->versioned_name); /* Now we act as though we saw symp2 = sym. */ @@ -1505,9 +1515,11 @@ elf_frob_symbol (symp, puntp) /* Subtracting out the frag address here is a hack because we are in the middle of the final loop. */ - S_SET_VALUE (symp2, S_GET_VALUE (symp) - symp->sy_frag->fr_address); + S_SET_VALUE (symp2, + (S_GET_VALUE (symp) + - symbol_get_frag (symp)->fr_address)); - symp2->sy_frag = symp->sy_frag; + symbol_set_frag (symp2, symbol_get_frag (symp)); /* This will copy over the size information. */ copy_symbol_attributes (symp2, symp); @@ -1521,7 +1533,7 @@ elf_frob_symbol (symp, puntp) } /* Double check weak symbols. */ - if (symp->bsym->flags & BSF_WEAK) + if (S_IS_WEAK (symp)) { if (S_IS_COMMON (symp)) as_bad (_("Symbol `%s' can not be both weak and common"), @@ -1537,19 +1549,21 @@ elf_frob_symbol (symp, puntp) .global directives to mark functions. */ if (S_IS_COMMON (symp)) - symp->bsym->flags |= BSF_OBJECT; + symbol_get_bfdsym (symp)->flags |= BSF_OBJECT; if (strstr (TARGET_OS, "irix") != NULL - && (! S_IS_DEFINED (symp) && ((symp->bsym->flags & BSF_FUNCTION) == 0))) - symp->bsym->flags |= BSF_OBJECT; + && ! S_IS_DEFINED (symp) + && (symbol_get_bfdsym (symp)->flags & BSF_FUNCTION) == 0) + symbol_get_bfdsym (symp)->flags |= BSF_OBJECT; #endif #ifdef TC_PPC /* Frob the PowerPC, so that the symbol always has object type if it is not some other type. VxWorks needs this. */ - if ((symp->bsym->flags & (BSF_FUNCTION | BSF_FILE | BSF_SECTION_SYM)) == 0 + if ((symbol_get_bfdsym (symp)->flags + & (BSF_FUNCTION | BSF_FILE | BSF_SECTION_SYM)) == 0 && S_IS_DEFINED (symp)) - symp->bsym->flags |= BSF_OBJECT; + symbol_get_bfdsym (symp)->flags |= BSF_OBJECT; #endif } diff --git a/gas/config/obj-elf.h b/gas/config/obj-elf.h index 2f4bc5f..4380f1f 100644 --- a/gas/config/obj-elf.h +++ b/gas/config/obj-elf.h @@ -1,5 +1,6 @@ /* ELF object file format. - Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. + Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -34,6 +35,22 @@ #define BYTES_IN_WORD 4 /* for now */ #include "bfd/elf-bfd.h" +#include "targ-cpu.h" + +#ifdef TC_ALPHA +#define ECOFF_DEBUGGING alpha_flag_mdebug +extern int alpha_flag_mdebug; +#endif + +/* For now, always set ECOFF_DEBUGGING for a MIPS target. */ +#ifdef TC_MIPS +#ifdef MIPS_STABS_ELF +#define ECOFF_DEBUGGING 0 +#else +#define ECOFF_DEBUGGING 1 +#endif /* MIPS_STABS_ELF */ +#endif /* TC_MIPS */ + /* Additional information we keep for each symbol. */ /* FIXME: For some reason, this structure is needed both here and in @@ -41,25 +58,28 @@ #ifndef OBJ_SYMFIELD_TYPE struct elf_obj_sy { + /* Whether the symbol has been marked as local. */ + int local; + /* Use this to keep track of .size expressions that involve differences that we can't compute yet. */ expressionS *size; /* The name specified by the .symver directive. */ char *versioned_name; + +#ifdef ECOFF_DEBUGGING + /* If we are generating ECOFF debugging information, we need some + additional fields for each symbol. */ + struct efdr *ecoff_file; + struct localsym *ecoff_symbol; + valueT ecoff_extern_size; +#endif }; #endif #define OBJ_SYMFIELD_TYPE struct elf_obj_sy -/* Symbol fields used by the ELF back end. */ -#define ELF_TARGET_SYMBOL_FIELDS int local:1; - -/* Don't change this; change ELF_TARGET_SYMBOL_FIELDS instead. */ -#define TARGET_SYMBOL_FIELDS ELF_TARGET_SYMBOL_FIELDS - -#include "targ-cpu.h" - #ifndef FALSE #define FALSE 0 #define TRUE !FALSE @@ -71,17 +91,20 @@ extern void elf_begin PARAMS ((void)); /* should be conditional on address size! */ #define elf_symbol(asymbol) ((elf_symbol_type *)(&(asymbol)->the_bfd)) -#define S_GET_SIZE(S) (elf_symbol ((S)->bsym)->internal_elf_sym.st_size) +#define S_GET_SIZE(S) \ + (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_size) #define S_SET_SIZE(S,V) \ - (elf_symbol((S)->bsym)->internal_elf_sym.st_size = (V)) + (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_size = (V)) -#define S_GET_ALIGN(S) (elf_symbol ((S)->bsym)->internal_elf_sym.st_value) +#define S_GET_ALIGN(S) \ + (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_value) #define S_SET_ALIGN(S,V) \ - (elf_symbol ((S)->bsym)->internal_elf_sym.st_value = (V)) + (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_value = (V)) -#define S_GET_OTHER(S) (elf_symbol ((S)->bsym)->internal_elf_sym.st_other) +#define S_GET_OTHER(S) \ + (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_other) #define S_SET_OTHER(S,V) \ - (elf_symbol ((S)->bsym)->internal_elf_sym.st_other = (V)) + (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_other = (V)) extern asection *gdb_section; @@ -110,18 +133,20 @@ extern void obj_elf_version PARAMS ((int)); #define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST,SRC) \ do \ { \ - if ((SRC)->sy_obj.size) \ + struct elf_obj_sy *srcelf = symbol_get_obj (SRC); \ + struct elf_obj_sy *destelf = symbol_get_obj (DEST); \ + if (srcelf->size) \ { \ - if ((DEST)->sy_obj.size == NULL) \ - (DEST)->sy_obj.size = \ + if (destelf->size == NULL) \ + destelf->size = \ (expressionS *) xmalloc (sizeof (expressionS)); \ - *(DEST)->sy_obj.size = *(SRC)->sy_obj.size; \ + *destelf->size = *srcelf->size; \ } \ else \ { \ - if ((DEST)->sy_obj.size != NULL) \ - free ((DEST)->sy_obj.size); \ - (DEST)->sy_obj.size = NULL; \ + if (destelf->size != NULL) \ + free (destelf->size); \ + destelf->size = NULL; \ } \ S_SET_SIZE ((DEST), S_GET_SIZE (SRC)); \ S_SET_OTHER ((DEST), S_GET_OTHER (SRC)); \ @@ -136,30 +161,7 @@ while (0) extern void obj_elf_init_stab_section PARAMS ((segT)); #define INIT_STAB_SECTION(seg) obj_elf_init_stab_section (seg) -#ifdef TC_ALPHA -#define ECOFF_DEBUGGING alpha_flag_mdebug -extern int alpha_flag_mdebug; -#endif - -/* For now, always set ECOFF_DEBUGGING for a MIPS target. */ -#ifdef TC_MIPS -#ifdef MIPS_STABS_ELF -#define ECOFF_DEBUGGING 0 -#else -#define ECOFF_DEBUGGING 1 -#endif /* MIPS_STABS_ELF */ -#endif /* TC_MIPS */ - #ifdef ECOFF_DEBUGGING -/* If we are generating ECOFF debugging information, we need some - additional fields for each symbol. */ -#undef TARGET_SYMBOL_FIELDS -#define TARGET_SYMBOL_FIELDS \ - ELF_TARGET_SYMBOL_FIELDS \ - struct efdr *ecoff_file; \ - struct localsym *ecoff_symbol; \ - valueT ecoff_extern_size; - /* We smuggle stabs in ECOFF rather than using a separate section. The Irix linker can not handle a separate stabs section. */ @@ -175,7 +177,7 @@ extern int alpha_flag_mdebug; ecoff_stab ((seg), (what), (string), (type), (other), (desc)) #endif /* ECOFF_DEBUGGING */ -extern void elf_frob_symbol PARAMS ((struct symbol *, int *)); +extern void elf_frob_symbol PARAMS ((symbolS *, int *)); #ifndef obj_frob_symbol #define obj_frob_symbol(symp, punt) elf_frob_symbol (symp, &punt) #endif @@ -188,7 +190,7 @@ extern void elf_pop_insert PARAMS ((void)); #ifdef ANSI_PROTOTYPES struct ecoff_extr; #endif -extern void elf_ecoff_set_ext PARAMS ((struct symbol *, struct ecoff_extr *)); +extern void elf_ecoff_set_ext PARAMS ((symbolS *, struct ecoff_extr *)); #endif #endif /* _OBJ_ELF_H */ diff --git a/gas/config/obj-multi.h b/gas/config/obj-multi.h index fe8d98d..d54c61f 100644 --- a/gas/config/obj-multi.h +++ b/gas/config/obj-multi.h @@ -25,26 +25,20 @@ /* FIXME: What's the story here? Why do we have to define OBJ_SYMFIELD_TYPE both here and in obj-elf.h? */ + #ifdef OBJ_MAYBE_ELF struct elf_obj_sy { + int local; expressionS *size; char *versioned_name; +#ifdef ECOFF_DEBUGGING + /* If we are generating ECOFF debugging information, we need some + additional fields for each symbol. */ + struct efdr *ecoff_file; + struct localsym *ecoff_symbol; + valueT ecoff_extern_size; +#endif }; #define OBJ_SYMFIELD_TYPE struct elf_obj_sy -#define ELF_TARGET_SYMBOL_FIELDS int local:1; -#else -#define ELF_TARGET_SYMBOL_FIELDS #endif - -#ifdef ECOFF_DEBUGGING -struct efdr; -struct localsym; -#define ECOFF_DEBUG_TARGET_SYMBOL_FIELDS struct efdr *ecoff_file; struct localsym *ecoff_symbol; valueT ecoff_extern_size; -#else -#define ECOFF_DEBUG_TARGET_SYMBOL_FIELDS -#endif - -#define TARGET_SYMBOL_FIELDS \ - ELF_TARGET_SYMBOL_FIELDS \ - ECOFF_DEBUG_TARGET_SYMBOL_FIELDS diff --git a/gas/config/obj-vms.h b/gas/config/obj-vms.h index ac0c1fb..ad8fdce 100644 --- a/gas/config/obj-vms.h +++ b/gas/config/obj-vms.h @@ -1,5 +1,5 @@ /* VMS object file format - Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 1997 + Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 1999 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -214,18 +214,17 @@ typedef struct nlist obj_symbol_type; /* Symbol table entry */ /* Force structure tags into scope so that their use in prototypes will never be their first occurance. */ struct fix; -struct symbol; struct frag; /* obj-vms routines visible to the rest of gas. */ extern void tc_aout_fix_to_chars PARAMS ((char *,struct fix *,relax_addressT)); -extern int vms_resolve_symbol_redef PARAMS ((struct symbol *)); +extern int vms_resolve_symbol_redef PARAMS ((symbolS *)); #define RESOLVE_SYMBOL_REDEFINITION(X) vms_resolve_symbol_redef(X) /* Compiler-generated label "__vax_g_doubles" is used to augment .stabs. */ -extern void vms_check_for_special_label PARAMS ((struct symbol *)); +extern void vms_check_for_special_label PARAMS ((symbolS *)); #define obj_frob_label(X) vms_check_for_special_label(X) extern void vms_check_for_main PARAMS ((void)); diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c index 568617f..a166309 100644 --- a/gas/config/tc-alpha.c +++ b/gas/config/tc-alpha.c @@ -1173,7 +1173,7 @@ md_apply_fix (fixP, valueP) Therefore they must be completely resolved as constants. */ if (fixP->fx_addsy != 0 - && fixP->fx_addsy->bsym->section != absolute_section) + && S_GET_SEGMENT (fixP->fx_addsy) != absolute_section) as_bad_where (fixP->fx_file, fixP->fx_line, _("non-absolute expression in constant field")); @@ -1393,7 +1393,8 @@ tc_gen_reloc (sec, fixp) arelent *reloc; reloc = (arelent *) xmalloc (sizeof (arelent)); - reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym; + reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; /* Make sure none of our internal relocations make it this far. @@ -1435,7 +1436,7 @@ tc_gen_reloc (sec, fixp) */ if ((S_IS_EXTERN (fixp->fx_addsy) || S_IS_WEAK (fixp->fx_addsy)) && !S_IS_COMMON(fixp->fx_addsy)) - reloc->addend -= fixp->fx_addsy->bsym->value; + reloc->addend -= symbol_get_bfdsym (fixp->fx_addsy)->value; #endif } @@ -3557,7 +3558,7 @@ s_alpha_ent (dummy) as_warn (_("nested .ent directives")); sym = symbol_find_or_make (name); - sym->bsym->flags |= BSF_FUNCTION; + symbol_get_bfdsym (sym)->flags |= BSF_FUNCTION; alpha_cur_ent_sym = sym; /* The .ent directive is sometimes followed by a number. Not sure @@ -3604,12 +3605,13 @@ s_alpha_end (dummy) /* Create an expression to calculate the size of the function. */ if (sym) { - sym->sy_obj.size = (expressionS *) xmalloc (sizeof (expressionS)); - sym->sy_obj.size->X_op = O_subtract; - sym->sy_obj.size->X_add_symbol + symbol_get_obj (sym)->size = + (expressionS *) xmalloc (sizeof (expressionS)); + symbol_get_obj (sym)->size->X_op = O_subtract; + symbol_get_obj (sym)->size->X_add_symbol = symbol_new ("L0\001", now_seg, frag_now_fix (), frag_now); - sym->sy_obj.size->X_op_symbol = sym; - sym->sy_obj.size->X_add_number = 0; + symbol_get_obj (sym)->size->X_op_symbol = sym; + symbol_get_obj (sym)->size->X_add_number = 0; } alpha_cur_ent_sym = NULL; @@ -4745,7 +4747,7 @@ alpha_align (n, pfill, label, force) if (label != NULL) { assert (S_GET_SEGMENT (label) == now_seg); - label->sy_frag = frag_now; + symbol_set_frag (label, frag_now); S_SET_VALUE (label, (valueT) frag_now_fix ()); } diff --git a/gas/config/tc-alpha.h b/gas/config/tc-alpha.h index ca6903a..a350513 100644 --- a/gas/config/tc-alpha.h +++ b/gas/config/tc-alpha.h @@ -85,7 +85,7 @@ extern int tc_get_register PARAMS ((int frame)); extern void alpha_frob_ecoff_data PARAMS ((void)); #define tc_frob_label(sym) alpha_define_label (sym) -extern void alpha_define_label PARAMS ((struct symbol *)); +extern void alpha_define_label PARAMS ((symbolS *)); #define md_cons_align(nbytes) alpha_cons_align (nbytes) extern void alpha_cons_align PARAMS ((int)); diff --git a/gas/config/tc-arc.h b/gas/config/tc-arc.h index 6a95ff4..5066201 100644 --- a/gas/config/tc-arc.h +++ b/gas/config/tc-arc.h @@ -1,5 +1,5 @@ /* tc-arc.h - Macros and type defines for the ARC. - Copyright (C) 1994, 1995, 1997 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1997, 1999 Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). This file is part of GAS, the GNU Assembler. @@ -66,6 +66,6 @@ struct arc_tc_sy #define TC_SYMFIELD_TYPE struct arc_tc_sy /* Finish up the symbol. */ -extern int arc_frob_symbol PARAMS ((struct symbol *)); +extern int arc_frob_symbol PARAMS ((symbolS *)); #define tc_frob_symbol(sym, punt) punt = arc_frob_symbol (sym) #endif diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h index bf99e24..7f676e7 100644 --- a/gas/config/tc-arm.h +++ b/gas/config/tc-arm.h @@ -1,5 +1,6 @@ /* This file is tc-arm.h - Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999 + Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) Modified by David Taylor (dtaylor@armltd.co.uk) @@ -103,7 +104,7 @@ extern void arm_start_line_hook PARAMS ((void)); #define tc_frob_label(S) arm_frob_label (S) - extern void arm_frob_label PARAMS ((struct symbol *)); + extern void arm_frob_label PARAMS ((symbolS *)); /* We also need to mark assembler created symbols: */ #define tc_frob_fake_label(S) arm_frob_label (S) diff --git a/gas/config/tc-d10v.c b/gas/config/tc-d10v.c index cf38f3e..bb8ace8 100644 --- a/gas/config/tc-d10v.c +++ b/gas/config/tc-d10v.c @@ -1,6 +1,6 @@ /* tc-d10v.c -- Assembler code for the Mitsubishi D10V - Copyright (C) 1996, 1997, 1998 Free Software Foundation. + Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation. This file is part of GAS, the GNU Assembler. @@ -159,7 +159,7 @@ register_name (expressionP) { expressionP->X_op = O_register; /* temporarily store a pointer to the string here */ - expressionP->X_op_symbol = (struct symbol *)input_line_pointer; + expressionP->X_op_symbol = (symbolS *)input_line_pointer; expressionP->X_add_number = reg_number; input_line_pointer = p; return 1; diff --git a/gas/config/tc-d30v.c b/gas/config/tc-d30v.c index c5033ba..8e93f2a 100644 --- a/gas/config/tc-d30v.c +++ b/gas/config/tc-d30v.c @@ -1,6 +1,6 @@ /* tc-d30v.c -- Assembler code for the Mitsubishi D30V - Copyright (C) 1997, 1998 Free Software Foundation. + Copyright (C) 1997, 1998, 1999 Free Software Foundation. This file is part of GAS, the GNU Assembler. @@ -216,7 +216,7 @@ register_name (expressionP) { expressionP->X_op = O_register; /* temporarily store a pointer to the string here */ - expressionP->X_op_symbol = (struct symbol *)input_line_pointer; + expressionP->X_op_symbol = (symbolS *)input_line_pointer; expressionP->X_add_number = reg_number; input_line_pointer = p; return 1; diff --git a/gas/config/tc-d30v.h b/gas/config/tc-d30v.h index acce285..dfebbb9 100644 --- a/gas/config/tc-d30v.h +++ b/gas/config/tc-d30v.h @@ -1,5 +1,5 @@ /* tc-310v.h -- Header file for tc-d30v.c. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. Written by Martin Hunt, Cygnus Support. This file is part of GAS, the GNU Assembler. @@ -15,8 +15,9 @@ 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. */ + 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 TC_D30V @@ -52,7 +53,7 @@ int d30v_cleanup PARAMS ((int)); #define TC_START_LABEL(ch, ptr) (ch == ':' && d30v_cleanup (false)) #define md_start_line_hook() d30v_start_line (false) -void d30v_frob_label PARAMS ((struct symbol *)); +void d30v_frob_label PARAMS ((symbolS *)); #define tc_frob_label(sym) d30v_frob_label(sym) void d30v_cons_align PARAMS ((int)); diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c index c0f532c..80ac19a 100644 --- a/gas/config/tc-hppa.c +++ b/gas/config/tc-hppa.c @@ -1,5 +1,6 @@ /* tc-hppa.c -- Assemble for the PA - Copyright (C) 1989, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. + Copyright (C) 1989, 93, 94, 95, 96, 97, 98, 1999 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -326,7 +327,7 @@ typedef struct space_dictionary_chain sd_chain_struct; label. */ typedef struct label_symbol_struct { - struct symbol *lss_label; + symbolS *lss_label; sd_chain_struct *lss_space; struct label_symbol_struct *lss_next; } diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index b06298e..ab5cbfb 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -2463,7 +2463,8 @@ md_assemble (line) && GOT_symbol == i.imms[n]->X_add_symbol && (i.imms[n]->X_op == O_symbol || (i.imms[n]->X_op == O_add - && (i.imms[n]->X_op_symbol->sy_value.X_op + && ((symbol_get_value_expression + (i.imms[n]->X_op_symbol)->X_op) == O_subtract)))) { r_type = BFD_RELOC_386_GOTPC; @@ -2829,7 +2830,7 @@ i386_displacement (disp_start, disp_end) { if (S_IS_LOCAL(exp->X_add_symbol) && S_GET_SEGMENT (exp->X_add_symbol) != undefined_section) - section_symbol(exp->X_add_symbol->bsym->section); + section_symbol (S_GET_SEGMENT (exp->X_add_symbol)); assert (exp->X_op == O_symbol); exp->X_op = O_subtract; exp->X_op_symbol = GOT_symbol; @@ -3789,7 +3790,7 @@ md_convert_frag (abfd, sec, fragP) /* Address we want to reach in file space. */ target_address = S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset; #ifdef BFD_ASSEMBLER /* not needed otherwise? */ - target_address += fragP->fr_symbol->sy_frag->fr_address; + target_address += symbol_get_frag (fragP->fr_symbol)->fr_address; #endif /* Address opcode resides at in file space. */ @@ -3943,7 +3944,7 @@ md_apply_fix3 (fixP, valp, seg) #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) if (OUTPUT_FLAVOR == bfd_target_elf_flavour && (S_GET_SEGMENT (fixP->fx_addsy) == seg - || (fixP->fx_addsy->bsym->flags & BSF_SECTION_SYM) != 0) + || symbol_section_p (fixP->fx_addsy)) && ! S_IS_EXTERNAL (fixP->fx_addsy) && ! S_IS_WEAK (fixP->fx_addsy) && S_IS_DEFINED (fixP->fx_addsy) @@ -4387,7 +4388,8 @@ tc_gen_reloc (section, fixp) code = BFD_RELOC_386_GOTPC; rel = (arelent *) xmalloc (sizeof (arelent)); - rel->sym_ptr_ptr = &fixp->fx_addsy->bsym; + rel->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + *rel->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); rel->address = fixp->fx_frag->fr_address + fixp->fx_where; /* HACK: Since i386 ELF uses Rel instead of Rela, encode the diff --git a/gas/config/tc-i960.c b/gas/config/tc-i960.c index a4e8497..60ae033 100644 --- a/gas/config/tc-i960.c +++ b/gas/config/tc-i960.c @@ -3353,7 +3353,8 @@ tc_gen_reloc (section, fixP) assert (!fixP->fx_pcrel == !reloc->howto->pc_relative); - reloc->sym_ptr_ptr = &fixP->fx_addsy->bsym; + reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy); reloc->address = fixP->fx_frag->fr_address + fixP->fx_where; reloc->addend = fixP->fx_addnumber; diff --git a/gas/config/tc-i960.h b/gas/config/tc-i960.h index e415233..2746ede 100644 --- a/gas/config/tc-i960.h +++ b/gas/config/tc-i960.h @@ -130,7 +130,7 @@ struct relocation_info #ifdef OBJ_COFF /* We store the bal information in the sy_tc field. */ -#define TC_SYMFIELD_TYPE struct symbol * +#define TC_SYMFIELD_TYPE symbolS * #define TC_ADJUST_RELOC_COUNT(FIXP,COUNT) \ { fixS *tcfixp = (FIXP); \ @@ -140,7 +140,7 @@ struct relocation_info } #endif -extern int i960_validate_fix PARAMS ((struct fix *, segT, struct symbol **)); +extern int i960_validate_fix PARAMS ((struct fix *, segT, symbolS **)); #define TC_VALIDATE_FIX(FIXP,SEGTYPE,LABEL) \ if (i960_validate_fix (FIXP, SEGTYPE, &add_symbolP) != 0) goto LABEL @@ -167,9 +167,9 @@ extern void brtab_emit PARAMS ((void)); extern void reloc_callj (); -extern void tc_set_bal_of_call PARAMS ((struct symbol *, struct symbol *)); +extern void tc_set_bal_of_call PARAMS ((symbolS *, symbolS *)); -extern struct symbol *tc_get_bal_of_call PARAMS ((struct symbol *)); +extern struct symbol *tc_get_bal_of_call PARAMS ((symbolS *)); extern void i960_handle_align (); #define HANDLE_ALIGN(FRAG) i960_handle_align (FRAG) diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c index e1e1bc2..1aff3da 100644 --- a/gas/config/tc-m68k.c +++ b/gas/config/tc-m68k.c @@ -907,7 +907,8 @@ tc_gen_reloc (section, fixp) #undef MAP reloc = (arelent *) xmalloc (sizeof (arelent)); - reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym; + reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; #ifndef OBJ_ELF if (fixp->fx_pcrel) @@ -4292,7 +4293,7 @@ md_convert_frag_1 (fragP) disp = (disp + fragP->fr_offset) - object_address; #ifdef BFD_ASSEMBLER - disp += fragP->fr_symbol->sy_frag->fr_address; + disp += symbol_get_frag (fragP->fr_symbol)->fr_address; #endif switch (fragP->fr_subtype) @@ -4741,14 +4742,14 @@ md_estimate_size_before_relax (fragP, segment) word mode. */ if (fragP->fr_symbol && S_GET_VALUE (fragP->fr_symbol) == 0) { + fragS *stop; fragS *l; - for (l = fragP->fr_next; - l != fragP->fr_symbol->sy_frag; - l = l->fr_next) + stop = symbol_get_frag (fragP->fr_symbol); + for (l = fragP->fr_next; l != stop; l = l->fr_next) if (l->fr_fix + l->fr_var != 0) break; - if (l == fragP->fr_symbol->sy_frag) + if (l == stop) { fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT); fragP->fr_var += 2; @@ -5472,7 +5473,7 @@ s_reg (ignore) S_SET_SEGMENT (line_label, reg_section); S_SET_VALUE (line_label, ~mask); - line_label->sy_frag = &zero_address_frag; + symbol_set_frag (line_label, &zero_address_frag); if (flag_mri) mri_comment_end (stop, stopc); diff --git a/gas/config/tc-m68k.h b/gas/config/tc-m68k.h index f9a5ef9..b8492b9 100644 --- a/gas/config/tc-m68k.h +++ b/gas/config/tc-m68k.h @@ -1,5 +1,5 @@ /* This file is tc-m68k.h - Copyright (C) 1987, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1998 + Copyright (C) 1987, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -22,7 +22,6 @@ #define TC_M68K 1 #ifdef ANSI_PROTOTYPES -struct symbol; struct fix; #endif @@ -138,13 +137,13 @@ extern void m68k_mri_mode_change PARAMS ((int)); extern int m68k_conditional_pseudoop PARAMS ((pseudo_typeS *)); #define tc_conditional_pseudoop(pop) m68k_conditional_pseudoop (pop) -extern void m68k_frob_label PARAMS ((struct symbol *)); +extern void m68k_frob_label PARAMS ((symbolS *)); #define tc_frob_label(sym) m68k_frob_label (sym) extern void m68k_flush_pending_output PARAMS ((void)); #define md_flush_pending_output() m68k_flush_pending_output () -extern void m68k_frob_symbol PARAMS ((struct symbol *)); +extern void m68k_frob_symbol PARAMS ((symbolS *)); #ifdef BFD_ASSEMBLER diff --git a/gas/config/tc-mcore.c b/gas/config/tc-mcore.c index 4c12f99..28790df 100644 --- a/gas/config/tc-mcore.c +++ b/gas/config/tc-mcore.c @@ -541,7 +541,7 @@ dump_literals (isforce) { int i; struct literal * p; - struct symbol * brarsym; + symbolS * brarsym; if (poolsize == 0) return; diff --git a/gas/config/tc-mcore.h b/gas/config/tc-mcore.h index 9e487c9..e713c27 100644 --- a/gas/config/tc-mcore.h +++ b/gas/config/tc-mcore.h @@ -65,7 +65,12 @@ extern const struct relax_type md_relax_table[]; #define TARGET_FORMAT (target_big_endian ? "pe-mcore-big" : "pe-mcore-little") -#define TARGET_SYMBOL_FIELDS int sy_flags ; +struct mcore_tc_sy +{ + int sy_flags; +}; + +#define TC_SYMFIELD_TYPE struct mcore_tc_sy #endif /* OBJ_COFF */ @@ -93,7 +98,6 @@ extern boolean mcore_fix_adjustable PARAMS ((struct fix *)); # error No target format specified. #endif -#include "struc-symbol.h" /* For definition of symbolS */ #include "write.h" /* For definition of fixS */ extern void md_begin PARAMS ((void)); diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index c25f057..3c1c00c 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -1,5 +1,5 @@ /* tc-mips.c -- assemble code for a MIPS chip. - Copyright (C) 1993, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. + Copyright (C) 1993, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. Contributed by the OSF and Ralph Campbell. Written by Keith Knowles and Ralph Campbell, working independently. Modified for ECOFF and R4000 support by Ian Lance Taylor of Cygnus @@ -54,7 +54,6 @@ static int mips_output_flavor () { return OUTPUT_FLAVOR; } #undef S_GET_SIZE #undef S_SET_ALIGN #undef S_SET_SIZE -#undef TARGET_SYMBOL_FIELDS #undef obj_frob_file #undef obj_frob_file_after_relocs #undef obj_frob_symbol @@ -1373,8 +1372,8 @@ mips16_mark_labels () if (OUTPUT_FLAVOR == bfd_target_elf_flavour) S_SET_OTHER (l->label, STO_MIPS16); #endif - if ((l->label->sy_value.X_add_number & 1) == 0) - ++l->label->sy_value.X_add_number; + if ((S_GET_VALUE (l->label) & 1) == 0) + S_SET_VALUE (l->label, S_GET_VALUE (l->label) + 1); } } } @@ -1656,11 +1655,11 @@ append_insn (place, ip, address_expr, reloc_type, unmatched_hi) for (l = insn_labels; l != NULL; l = l->next) { assert (S_GET_SEGMENT (l->label) == now_seg); - l->label->sy_frag = frag_now; + symbol_set_frag (l->label, frag_now); S_SET_VALUE (l->label, (valueT) frag_now_fix ()); /* mips16 text labels are stored as odd. */ if (mips_opts.mips16) - ++l->label->sy_value.X_add_number; + S_SET_VALUE (l->label, S_GET_VALUE (l->label) + 1); } #ifndef NO_ECOFF_DEBUGGING @@ -2360,11 +2359,11 @@ mips_emit_delays (insns) for (l = insn_labels; l != NULL; l = l->next) { assert (S_GET_SEGMENT (l->label) == now_seg); - l->label->sy_frag = frag_now; + symbol_set_frag (l->label, frag_now); S_SET_VALUE (l->label, (valueT) frag_now_fix ()); /* mips16 text labels are stored as odd. */ if (mips_opts.mips16) - ++l->label->sy_value.X_add_number; + S_SET_VALUE (l->label, S_GET_VALUE (l->label) + 1); } } } @@ -4103,11 +4102,12 @@ macro (ip) if (mips_pic == EMBEDDED_PIC && offset_expr.X_op == O_subtract && now_seg == text_section - && (offset_expr.X_op_symbol->sy_value.X_op == O_constant + && (symbol_constant_p (offset_expr.X_op_symbol) ? S_GET_SEGMENT (offset_expr.X_op_symbol) == text_section - : (offset_expr.X_op_symbol->sy_value.X_op == O_symbol - && (S_GET_SEGMENT (offset_expr.X_op_symbol - ->sy_value.X_add_symbol) + : (symbol_equated_p (offset_expr.X_op_symbol) + && (S_GET_SEGMENT + (symbol_get_value_expression (offset_expr.X_op_symbol) + ->X_add_symbol) == text_section))) && breg == 0 && offset_expr.X_add_number == 0) @@ -8699,10 +8699,10 @@ my_getExpression (ep, str) && ep->X_op == O_symbol && strcmp (S_GET_NAME (ep->X_add_symbol), FAKE_LABEL_NAME) == 0 && S_GET_SEGMENT (ep->X_add_symbol) == now_seg - && ep->X_add_symbol->sy_frag == frag_now - && ep->X_add_symbol->sy_value.X_op == O_constant - && ep->X_add_symbol->sy_value.X_add_number == frag_now_fix ()) - ++ep->X_add_symbol->sy_value.X_add_number; + && symbol_get_frag (ep->X_add_symbol) == frag_now + && symbol_constant_p (ep->X_add_symbol) + && S_GET_VALUE (ep->X_add_symbol) == frag_now_fix ()) + S_SET_VALUE (ep->X_add_symbol, S_GET_VALUE (ep->X_add_symbol) + 1); } /* Turn a string in input_line_pointer into a floating point constant @@ -9472,13 +9472,13 @@ md_apply_fix (fixP, valueP) if (fixP->fx_addsy != NULL && OUTPUT_FLAVOR == bfd_target_elf_flavour) if (S_GET_OTHER (fixP->fx_addsy) == STO_MIPS16 || S_IS_WEAK (fixP->fx_addsy) - || (fixP->fx_addsy->sy_used_in_reloc - && (bfd_get_section_flags (stdoutput, - S_GET_SEGMENT (fixP->fx_addsy)) - & SEC_LINK_ONCE != 0) - || !strncmp (segment_name (S_GET_SEGMENT (fixP->fx_addsy)), - ".gnu.linkonce", - sizeof (".gnu.linkonce") - 1))) + || (symbol_used_in_reloc_p (fixP->fx_addsy) + && (((bfd_get_section_flags (stdoutput, + S_GET_SEGMENT (fixP->fx_addsy)) + & SEC_LINK_ONCE) != 0) + || !strncmp (segment_name (S_GET_SEGMENT (fixP->fx_addsy)), + ".gnu.linkonce", + sizeof (".gnu.linkonce") - 1)))) { value -= S_GET_VALUE (fixP->fx_addsy); @@ -9529,7 +9529,7 @@ md_apply_fix (fixP, valueP) case BFD_RELOC_PCREL_HI16_S: /* The addend for this is tricky if it is internal, so we just do everything here rather than in bfd_install_relocation. */ - if ((fixP->fx_addsy->bsym->flags & BSF_SECTION_SYM) == 0) + if ((symbol_get_bfdsym (fixP->fx_addsy)->flags & BSF_SECTION_SYM) == 0) { /* For an external symbol adjust by the address to make it pcrel_offset. We use the address of the RELLO reloc @@ -9549,7 +9549,7 @@ md_apply_fix (fixP, valueP) case BFD_RELOC_PCREL_LO16: /* The addend for this is tricky if it is internal, so we just do everything here rather than in bfd_install_relocation. */ - if ((fixP->fx_addsy->bsym->flags & BSF_SECTION_SYM) == 0) + if ((symbol_get_bfdsym (fixP->fx_addsy)->flags & BSF_SECTION_SYM) == 0) value += fixP->fx_frag->fr_address + fixP->fx_where; buf = (unsigned char *) fixP->fx_frag->fr_literal + fixP->fx_where; if (target_big_endian) @@ -9818,7 +9818,7 @@ mips_align (to, fill, label) if (label != NULL) { assert (S_GET_SEGMENT (label) == now_seg); - label->sy_frag = frag_now; + symbol_set_frag (label, frag_now); S_SET_VALUE (label, (valueT) frag_now_fix ()); } } @@ -10002,10 +10002,12 @@ s_float_cons (type) mips_emit_delays (false); if (auto_align) - if (type == 'd') - mips_align (3, 0, label); - else - mips_align (2, 0, label); + { + if (type == 'd') + mips_align (3, 0, label); + else + mips_align (2, 0, label); + } mips_clear_insn_labels (); @@ -10053,7 +10055,7 @@ s_mips_globl (x) flag = BSF_FUNCTION; } - symbolP->bsym->flags |= flag; + symbol_get_bfdsym (symbolP)->flags |= flag; S_SET_EXTERNAL (symbolP); demand_empty_rest_of_line (); @@ -10297,7 +10299,7 @@ s_cpload (ignore) ex.X_add_number = 0; /* In ELF, this symbol is implicitly an STT_OBJECT symbol. */ - ex.X_add_symbol->bsym->flags |= BSF_OBJECT; + symbol_get_bfdsym (ex.X_add_symbol)->flags |= BSF_OBJECT; macro_build_lui ((char *) NULL, &icnt, &ex, GP); macro_build ((char *) NULL, &icnt, &ex, "addiu", "t,r,j", GP, GP, @@ -10489,7 +10491,7 @@ s_mips_weakext (ignore) ignore_rest_of_line(); return; } - symbolP->sy_value = exp; + symbol_set_value_expression (symbolP, &exp); } demand_empty_rest_of_line (); @@ -10601,15 +10603,16 @@ nopic_need_relax (sym, before_relaxing) else if ((! S_IS_DEFINED (sym) || S_IS_COMMON (sym)) && (0 #ifndef NO_ECOFF_DEBUGGING - || (sym->ecoff_extern_size != 0 - && sym->ecoff_extern_size <= g_switch_value) + || (symbol_get_obj (sym)->ecoff_extern_size != 0 + && (symbol_get_obj (sym)->ecoff_extern_size + <= g_switch_value)) #endif /* We must defer this decision until after the whole file has been read, since there might be a .extern after the first use of this symbol. */ || (before_relaxing #ifndef NO_ECOFF_DEBUGGING - && sym->ecoff_extern_size == 0 + && symbol_get_obj (sym)->ecoff_extern_size == 0 #endif && S_GET_VALUE (sym) == 0) || (S_GET_VALUE (sym) != 0 @@ -10679,23 +10682,26 @@ mips16_extended_frag (fragp, sec, stretch) maxtiny = (1 << (op->nbits - 1)) - 1; } - /* We can't call S_GET_VALUE here, because we don't want to lock in - a particular frag address. */ - if (fragp->fr_symbol->sy_value.X_op == O_constant) + /* We can't always call S_GET_VALUE here, because we don't want to + lock in a particular frag address. */ + if (symbol_constant_p (fragp->fr_symbol)) { - val = (fragp->fr_symbol->sy_value.X_add_number - + fragp->fr_symbol->sy_frag->fr_address); + val = (S_GET_VALUE (fragp->fr_symbol) + + symbol_get_frag (fragp->fr_symbol)->fr_address); symsec = S_GET_SEGMENT (fragp->fr_symbol); } - else if (fragp->fr_symbol->sy_value.X_op == O_symbol - && (fragp->fr_symbol->sy_value.X_add_symbol->sy_value.X_op - == O_constant)) + else if (symbol_equated_p (fragp->fr_symbol) + && (symbol_constant_p + (symbol_get_value_expression (fragp->fr_symbol)->X_add_symbol))) { - val = (fragp->fr_symbol->sy_value.X_add_symbol->sy_value.X_add_number - + fragp->fr_symbol->sy_value.X_add_symbol->sy_frag->fr_address - + fragp->fr_symbol->sy_value.X_add_number - + fragp->fr_symbol->sy_frag->fr_address); - symsec = S_GET_SEGMENT (fragp->fr_symbol->sy_value.X_add_symbol); + symbolS *eqsym; + + eqsym = symbol_get_value_expression (fragp->fr_symbol)->X_add_symbol; + val = (S_GET_VALUE (eqsym) + + symbol_get_frag (eqsym)->fr_address + + symbol_get_value_expression (fragp->fr_symbol)->X_add_number + + symbol_get_frag (fragp->fr_symbol)->fr_address); + symsec = S_GET_SEGMENT (eqsym); } else return 1; @@ -10737,7 +10743,8 @@ mips16_extended_frag (fragp, sec, stretch) in STRETCH in order to get a better estimate of the address. This particularly matters because of the shift bits. */ if (stretch != 0 - && fragp->fr_symbol->sy_frag->fr_address >= fragp->fr_address) + && (symbol_get_frag (fragp->fr_symbol)->fr_address + >= fragp->fr_address)) { fragS *f; @@ -10748,7 +10755,7 @@ mips16_extended_frag (fragp, sec, stretch) a maximum number of bytes to skip when doing an alignment. */ for (f = fragp; - f != NULL && f != fragp->fr_symbol->sy_frag; + f != NULL && f != symbol_get_frag (fragp->fr_symbol); f = f->fr_next) { if (f->fr_type == rs_align || f->fr_type == rs_align_code) @@ -10882,14 +10889,14 @@ md_estimate_size_before_relax (fragp, segtype) sym = fragp->fr_symbol; /* Handle the case of a symbol equated to another symbol. */ - while (sym->sy_value.X_op == O_symbol + while (symbol_equated_p (sym) && (! S_IS_DEFINED (sym) || S_IS_COMMON (sym))) { symbolS *n; /* It's possible to get a loop here in a badly written program. */ - n = sym->sy_value.X_add_symbol; + n = symbol_get_value_expression (sym)->X_add_symbol; if (n == sym) break; sym = n; @@ -10967,7 +10974,8 @@ tc_gen_reloc (section, fixp) reloc = retval[0] = (arelent *) xmalloc (sizeof (arelent)); retval[1] = NULL; - reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym; + reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; if (mips_pic == EMBEDDED_PIC @@ -10984,7 +10992,7 @@ tc_gen_reloc (section, fixp) else if (fixp->fx_r_type == BFD_RELOC_PCREL_LO16) { /* We use a special addend for an internal RELLO reloc. */ - if (fixp->fx_addsy->bsym->flags & BSF_SECTION_SYM) + if (symbol_section_p (fixp->fx_addsy)) reloc->addend = reloc->address - S_GET_VALUE (fixp->fx_subsy); else reloc->addend = fixp->fx_addnumber + reloc->address; @@ -10996,7 +11004,7 @@ tc_gen_reloc (section, fixp) /* We use a special addend for an internal RELHI reloc. The reloc is relative to the RELLO; adjust the addend accordingly. */ - if (fixp->fx_addsy->bsym->flags & BSF_SECTION_SYM) + if (symbol_section_p (fixp->fx_addsy)) reloc->addend = (fixp->fx_next->fx_frag->fr_address + fixp->fx_next->fx_where - S_GET_VALUE (fixp->fx_subsy)); @@ -11055,7 +11063,8 @@ tc_gen_reloc (section, fixp) reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; reloc2 = retval[1] = (arelent *) xmalloc (sizeof (arelent)); retval[2] = NULL; - reloc2->sym_ptr_ptr = &fixp->fx_addsy->bsym; + reloc2->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + *reloc2->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); reloc2->address = (reloc->address + (RELAX_RELOC2 (fixp->fx_frag->fr_subtype) - RELAX_RELOC1 (fixp->fx_frag->fr_subtype))); @@ -11433,7 +11442,7 @@ mips_elf_final_processing () typedef struct proc { - struct symbol *isym; + symbolS *isym; unsigned long reg_mask; unsigned long reg_offset; unsigned long fpreg_mask; @@ -11659,7 +11668,7 @@ s_mips_ent (aent) cur_proc_ptr->isym = symbolP; - symbolP->bsym->flags |= BSF_FUNCTION; + symbol_get_bfdsym (symbolP)->flags |= BSF_FUNCTION; numprocs++; } diff --git a/gas/config/tc-mips.h b/gas/config/tc-mips.h index 868aede..ccfd998 100644 --- a/gas/config/tc-mips.h +++ b/gas/config/tc-mips.h @@ -1,5 +1,5 @@ /* tc-mips.h -- header file for tc-mips.c. - Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1993, 94, 95, 96, 97, 1999 Free Software Foundation, Inc. Contributed by the OSF and Ralph Campbell. Written by Keith Knowles and Ralph Campbell, working independently. Modified for ECOFF support by Ian Lance Taylor of Cygnus Support. @@ -85,7 +85,7 @@ extern void mips_init_after_args PARAMS ((void)); extern int mips_parse_long_option PARAMS ((const char *)); #define tc_frob_label(sym) mips_define_label (sym) -extern void mips_define_label PARAMS ((struct symbol *)); +extern void mips_define_label PARAMS ((symbolS *)); #define tc_frob_file_before_adjust() mips_frob_file_before_adjust () extern void mips_frob_file_before_adjust PARAMS ((void)); diff --git a/gas/config/tc-ns32k.h b/gas/config/tc-ns32k.h index 4b038eb..69c86ec 100644 --- a/gas/config/tc-ns32k.h +++ b/gas/config/tc-ns32k.h @@ -1,5 +1,5 @@ /* tc-ns32k.h -- Opcode table for National Semi 32k processor - Copyright (C) 1987, 92, 93, 94, 95, 1997 Free Software Foundation, Inc. + Copyright (C) 1987, 92, 93, 94, 95, 97, 1999 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -76,7 +76,7 @@ extern void fix_new_ns32k_exp PARAMS((fragS *frag, extern void fix_new_ns32k PARAMS ((fragS *frag, int where, int size, - struct symbol *add_symbol, + symbolS *add_symbol, long offset, int pcrel, int im_disp, diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 0270ceb..a028e0b 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -1,5 +1,5 @@ /* tc-ppc.c -- Assemble for the PowerPC or POWER (RS/6000) - Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of GAS, the GNU Assembler. @@ -1405,8 +1405,8 @@ ppc_elf_lcomm(xxx) if (align2) frag_align (align2, 0, 0); if (S_GET_SEGMENT (symbolP) == bss_section) - symbolP->sy_frag->fr_symbol = 0; - symbolP->sy_frag = frag_now; + symbol_get_frag (symbolP)->fr_symbol = 0; + symbol_set_frag (symbolP, frag_now); pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP, size, (char *) 0); *pfrag = 0; @@ -4656,7 +4656,7 @@ md_apply_fix3 (fixp, valuep, seg) { /* `*valuep' may contain the value of the symbol on which the reloc will be based; we have to remove it. */ - if (fixp->fx_addsy->sy_used_in_reloc + if (symbol_used_in_reloc_p (fixp->fx_addsy) && S_GET_SEGMENT (fixp->fx_addsy) != absolute_section && S_GET_SEGMENT (fixp->fx_addsy) != undefined_section && ! bfd_is_com_section (S_GET_SEGMENT (fixp->fx_addsy))) @@ -4887,7 +4887,7 @@ md_apply_fix3 (fixp, valuep, seg) if (fixp->fx_pcrel) abort (); md_number_to_chars (fixp->fx_frag->fr_literal + fixp->fx_where, - value + 0x8000 >> 16, 2); + (value + 0x8000) >> 16, 2); break; /* Because SDA21 modifies the register field, the size is set to 4 @@ -4994,7 +4994,8 @@ tc_gen_reloc (seg, fixp) reloc = (arelent *) xmalloc (sizeof (arelent)); - reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym; + reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type); if (reloc->howto == (reloc_howto_type *) NULL) diff --git a/gas/config/tc-ppc.h b/gas/config/tc-ppc.h index 0871d13..1b239bc 100644 --- a/gas/config/tc-ppc.h +++ b/gas/config/tc-ppc.h @@ -1,5 +1,5 @@ /* tc-ppc.h -- Header file for tc-ppc.c. - Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of GAS, the GNU Assembler. @@ -121,7 +121,7 @@ extern int ppc_pe_fix_adjustable PARAMS ((struct fix *)); struct ppc_tc_sy { /* We keep a few linked lists of symbols. */ - struct symbol *next; + symbolS *next; /* Non-zero if the symbol should be output. The RS/6000 assembler only outputs symbols that are external or are mentioned in a .globl or .lglobl statement. */ @@ -137,11 +137,11 @@ struct ppc_tc_sy int align; /* For a function symbol, a symbol whose value is the size. The field is NULL if there is no size. */ - struct symbol *size; + symbolS *size; /* For a csect symbol, the last symbol which has been defined in this csect, or NULL if none have been defined so far. For a .bs symbol, the referenced csect symbol. */ - struct symbol *within; + symbolS *within; }; #define TC_SYMFIELD_TYPE struct ppc_tc_sy @@ -158,11 +158,11 @@ extern char *ppc_canonicalize_symbol_name PARAMS ((char *)); /* Get the symbol class from the name. */ #define tc_symbol_new_hook(sym) ppc_symbol_new_hook (sym) -extern void ppc_symbol_new_hook PARAMS ((struct symbol *)); +extern void ppc_symbol_new_hook PARAMS ((symbolS *)); /* Set the symbol class of a label based on the csect. */ #define tc_frob_label(sym) ppc_frob_label (sym) -extern void ppc_frob_label PARAMS ((struct symbol *)); +extern void ppc_frob_label PARAMS ((symbolS *)); /* TOC relocs requires special handling. */ #define tc_fix_adjustable(fixp) ppc_fix_adjustable (fixp) @@ -178,7 +178,7 @@ extern void ppc_frob_section PARAMS ((asection *)); /* Finish up the symbol. */ #define tc_frob_symbol(sym, punt) punt = ppc_frob_symbol (sym) -extern int ppc_frob_symbol PARAMS ((struct symbol *)); +extern int ppc_frob_symbol PARAMS ((symbolS *)); /* Finish up the entire symtab. */ #define tc_adjust_symtab() ppc_adjust_symtab () @@ -203,8 +203,8 @@ extern void ppc_adjust_symtab PARAMS ((void)); #define TC_FORCE_RELOCATION_SECTION(FIXP,SEC) \ (TC_FORCE_RELOCATION (FIXP) \ - || ((FIXP)->fx_addsy && !(FIXP)->fx_subsy && (FIXP)->fx_addsy->bsym \ - && (FIXP)->fx_addsy->bsym->section != SEC)) + || ((FIXP)->fx_addsy && !(FIXP)->fx_subsy \ + && S_GET_SEGMENT ((FIXP)->fx_addsy) != SEC)) /* Support for SHF_EXCLUDE and SHT_ORDERED */ extern int ppc_section_letter PARAMS ((int, char **)); diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c index 6d8ca81..e21962c 100644 --- a/gas/config/tc-sh.c +++ b/gas/config/tc-sh.c @@ -1,5 +1,5 @@ /* tc-sh.c -- Assemble code for the Hitachi Super-H - Copyright (C) 1993, 94, 95, 96, 97, 1998 Free Software Foundation. + Copyright (C) 1993, 94, 95, 96, 97, 98, 1999 Free Software Foundation. This file is part of GAS, the GNU Assembler. @@ -1450,7 +1450,8 @@ sh_frob_section (abfd, sec, ignore) We have already adjusted the value of sym to include the fragment address, so we undo that adjustment here. */ subseg_change (sec, 0); - fix_new (sym->sy_frag, S_GET_VALUE (sym) - sym->sy_frag->fr_address, + fix_new (symbol_get_frag (sym), + S_GET_VALUE (sym) - symbol_get_frag (sym)->fr_address, 4, &abs_symbol, info.count, 0, BFD_RELOC_SH_COUNT); } } @@ -2056,7 +2057,11 @@ md_apply_fix (fixP, val) case BFD_RELOC_VTABLE_INHERIT: case BFD_RELOC_VTABLE_ENTRY: fixP->fx_done = 0; +#ifdef BFD_ASSEMBLER + return 0; +#else return; +#endif default: abort (); @@ -2377,7 +2382,8 @@ tc_gen_reloc (section, fixp) bfd_reloc_code_real_type r_type; rel = (arelent *) xmalloc (sizeof (arelent)); - rel->sym_ptr_ptr = &fixp->fx_addsy->bsym; + rel->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + *rel->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); rel->address = fixp->fx_frag->fr_address + fixp->fx_where; r_type = fixp->fx_r_type; diff --git a/gas/config/tc-sh.h b/gas/config/tc-sh.h index cc02eab..f4278c2 100644 --- a/gas/config/tc-sh.h +++ b/gas/config/tc-sh.h @@ -1,5 +1,5 @@ /* This file is tc-sh.h - Copyright (C) 1993, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. + Copyright (C) 1993, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -56,6 +56,8 @@ extern int sh_force_relocation (); #ifdef OBJ_ELF #define obj_fix_adjustable(fixP) sh_fix_adjustable(fixP) +struct fix; +extern boolean sh_fix_adjustable PARAMS ((struct fix *)); #endif #define IGNORE_NONSTANDARD_ESCAPES diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index 1518a8a..ae4de1d 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -1,5 +1,5 @@ /* tc-sparc.c -- Assemble for the SPARC - Copyright (C) 1989, 90-96, 97, 1998 Free Software Foundation, Inc. + Copyright (C) 1989, 90-96, 97, 98, 1999 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. GAS is free software; you can redistribute it and/or modify @@ -2504,7 +2504,7 @@ md_apply_fix3 (fixP, value, segment) don't want to include the value of an externally visible symbol. */ if (fixP->fx_addsy != NULL) { - if (fixP->fx_addsy->sy_used_in_reloc + if (symbol_used_in_reloc_p (fixP->fx_addsy) && (S_IS_EXTERNAL (fixP->fx_addsy) || S_IS_WEAK (fixP->fx_addsy) || (sparc_pic_code && ! fixP->fx_pcrel) @@ -2549,7 +2549,7 @@ md_apply_fix3 (fixP, value, segment) && fixP->fx_r_type != BFD_RELOC_32_PCREL_S2 && fixP->fx_addsy != NULL && ! S_IS_COMMON (fixP->fx_addsy) - && (fixP->fx_addsy->bsym->flags & BSF_SECTION_SYM) == 0) + && symbol_section_p (fixP->fx_addsy)) fixP->fx_addnumber -= 2 * S_GET_VALUE (fixP->fx_addsy); /* When generating PIC code, we need to fiddle to get @@ -2606,7 +2606,7 @@ md_apply_fix3 (fixP, value, segment) being done! */ if (! sparc_pic_code || fixP->fx_addsy == NULL - || (fixP->fx_addsy->bsym->flags & BSF_SECTION_SYM) != 0) + || symbol_section_p (fixP->fx_addsy)) ++val; insn |= val & 0x3fffffff; break; @@ -2787,7 +2787,8 @@ tc_gen_reloc (section, fixp) reloc = (arelent *) xmalloc (sizeof (arelent)); - reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym; + reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; switch (fixp->fx_r_type) @@ -2906,7 +2907,7 @@ tc_gen_reloc (section, fixp) || code == BFD_RELOC_SPARC_PC10 || code == BFD_RELOC_SPARC_PC22) reloc->addend = fixp->fx_addnumber; - else if ((fixp->fx_addsy->bsym->flags & BSF_SECTION_SYM) != 0) + else if (symbol_section_p (fixp->fx_addsy)) reloc->addend = (section->vma + fixp->fx_addnumber + md_pcrel_from (fixp)); @@ -2961,7 +2962,7 @@ md_pcrel_from (fixP) ret = fixP->fx_where + fixP->fx_frag->fr_address; if (! sparc_pic_code || fixP->fx_addsy == NULL - || (fixP->fx_addsy->bsym->flags & BSF_SECTION_SYM) != 0) + || symbol_section_p (fixP->fx_addsy)) ret += fixP->fx_size; return ret; } @@ -3110,9 +3111,9 @@ s_reserve (ignore) /* detach from old frag */ if (S_GET_SEGMENT(symbolP) == bss_section) - symbolP->sy_frag->fr_symbol = NULL; + symbol_get_frag (symbolP)->fr_symbol = NULL; - symbolP->sy_frag = frag_now; + symbol_set_frag (symbolP, frag_now); pfrag = frag_var (rs_org, 1, 1, (relax_substateT)0, symbolP, (offsetT) size, (char *)0); *pfrag = 0; @@ -3218,7 +3219,7 @@ s_common (ignore) } #ifdef OBJ_ELF - if (symbolP->local) + if (symbol_get_obj (symbolP)->local) { segT old_sec; int old_subsec; @@ -3245,8 +3246,8 @@ s_common (ignore) if (align) frag_align (align, 0, 0); if (S_GET_SEGMENT (symbolP) == bss_section) - symbolP->sy_frag->fr_symbol = 0; - symbolP->sy_frag = frag_now; + symbol_get_frag (symbolP)->fr_symbol = 0; + symbol_set_frag (symbolP, frag_now); p = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP, (offsetT) size, (char *) 0); *p = 0; @@ -3289,7 +3290,7 @@ s_common (ignore) } #ifdef BFD_ASSEMBLER - symbolP->bsym->flags |= BSF_OBJECT; + symbol_get_bfdsym (symbolP)->flags |= BSF_OBJECT; #endif demand_empty_rest_of_line (); diff --git a/gas/config/tc-tahoe.c b/gas/config/tc-tahoe.c index 2bd63ca..26a7524 100644 --- a/gas/config/tc-tahoe.c +++ b/gas/config/tc-tahoe.c @@ -1611,7 +1611,7 @@ md_assemble (instruction_string) segT to_seg; /* Target segment of the address. */ register valueT this_add_number; - register struct symbol *this_add_symbol; /* +ve (minuend) symbol. */ + register symbolS *this_add_symbol; /* +ve (minuend) symbol. */ /* tahoe_opcodeT opcode_as_number; fixme: remove this line *//* The opcode as a number. */ char *opcodeP; /* Where it is in a frag. */ diff --git a/gas/config/tc-vax.c b/gas/config/tc-vax.c index 24e4a9b..f425ccc 100644 --- a/gas/config/tc-vax.c +++ b/gas/config/tc-vax.c @@ -1,5 +1,6 @@ /* tc-vax.c - vax-specific - - Copyright (C) 1987, 91, 92, 93, 94, 95, 1998 Free Software Foundation, Inc. + Copyright (C) 1987, 91, 92, 93, 94, 95, 98, 1999 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -335,7 +336,7 @@ md_assemble (instruction_string) segT to_seg; valueT this_add_number; /* Positive (minuend) symbol. */ - struct symbol *this_add_symbol; + symbolS *this_add_symbol; /* As a number. */ long opcode_as_number; /* Least significant byte 1st. */ diff --git a/gas/config/tc-w65.c b/gas/config/tc-w65.c index 72201e7..e57eb0f 100644 --- a/gas/config/tc-w65.c +++ b/gas/config/tc-w65.c @@ -1081,7 +1081,7 @@ md_pcrel_from (fixP) void tc_coff_symbol_emit_hook (x) - struct symbol *x; + symbolS *x; { } diff --git a/gas/config/tc-z8k.c b/gas/config/tc-z8k.c index 1611341..f89b14b 100644 --- a/gas/config/tc-z8k.c +++ b/gas/config/tc-z8k.c @@ -1,5 +1,5 @@ /* tc-z8k.c -- Assemble code for the Zilog Z800n - Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation. + Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999 Free Software Foundation. This file is part of GAS, the GNU Assembler. @@ -1520,7 +1520,7 @@ md_pcrel_from (fixP) void tc_coff_symbol_emit_hook (s) - struct symbol *s; + symbolS *s; { } |