aboutsummaryrefslogtreecommitdiff
path: root/gas/config/obj-coffbfd.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1993-07-14 22:21:25 +0000
committerIan Lance Taylor <ian@airs.com>1993-07-14 22:21:25 +0000
commit5868b1fe68831aacbf3934406182a20466aeec20 (patch)
treeb4ca8be5c6c65b1aeb7676181dd1d3f26128b06c /gas/config/obj-coffbfd.c
parentbf5b632df7ee9b664c00a02296b9cdcbea634e55 (diff)
downloadgdb-5868b1fe68831aacbf3934406182a20466aeec20.zip
gdb-5868b1fe68831aacbf3934406182a20466aeec20.tar.gz
gdb-5868b1fe68831aacbf3934406182a20466aeec20.tar.bz2
* Removed sy_forward and replaced it with an undefined expression
as the value of a symbol. * struc-symbol.h (struct symbol): Removed sy_forward field. Added sy_resolved and sy_resolving single bit fields. * symbols.c (symbol_new): Don't initialize sy_forward field. (resolve_symbol_value): New function to adjust symbol value by fragment address, using recursion to resolve forward symbols. * symbols.h: Added prototype for new function. * read.c (pseudo_set): Set symbolP->sy_value to an undefined expression rather than setting symbolP->sy_forward. * write.c (write_object_file): Use resolve_symbol_value on symbols, keeping the common case (the old behaviour) inline. * config/obj-aout.c (obj_aout_frob_symbol): Removed sy_forward handling (subsumed by write.c change). * config/obj-coff.c, config/obj-coffbfd.c (obj_coff_val): Set sy_value rather than sy_forward. * config/obj-coffbfd.c (obj_coff_endef, yank_symbols): Check expression segment rather than sy_forward. (yank_symbols): Use resolve_symbol_value. (crawl_symbols): Removed extra pass over symbols. * config/obj-aout.c, config/obj-bout.c, config/obj-coff.c, config/obj-vms.c (obj_crawl_symbol_chain): Removed extra pass over symbols which handled sy_forward; use resolve_symbol_value instead. * config/obj-coff.h, config/obj-coffbfd.h (obj_frob_forward_symbol): Define. * config/obj-elf.c (obj_elf_stab_generic): Check expression segment rather than sy_forward. * config/obj-vms.c (VMS_Check_For_Main): Don't initialize sy_forward; do initialize sy_resolved and sy_resolving. * config/tc-hppa.h (STAB_FIXUP): Use sy_value, not sy_forward.
Diffstat (limited to 'gas/config/obj-coffbfd.c')
-rw-r--r--gas/config/obj-coffbfd.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/gas/config/obj-coffbfd.c b/gas/config/obj-coffbfd.c
index d2884d3..d62bea7 100644
--- a/gas/config/obj-coffbfd.c
+++ b/gas/config/obj-coffbfd.c
@@ -990,7 +990,7 @@ DEFUN_VOID (obj_coff_endef)
|| (S_GET_SEGMENT (def_symbol_in_progress) == SEG_DEBUG
&& !SF_GET_TAG (def_symbol_in_progress))
|| S_GET_SEGMENT (def_symbol_in_progress) == SEG_ABSOLUTE
- || def_symbol_in_progress->sy_forward != NULL
+ || def_symbol_in_progress->sy_value.X_seg != absolute_section
|| (symbolP = symbol_find_base (S_GET_NAME (def_symbol_in_progress), DO_NOT_STRIP)) == NULL
|| (SF_GET_TAG (def_symbol_in_progress) != SF_GET_TAG (symbolP)))
{
@@ -1238,11 +1238,15 @@ obj_coff_val ()
}
else if (strcmp (S_GET_NAME (def_symbol_in_progress), symbol_name))
{
- def_symbol_in_progress->sy_forward = symbol_find_or_make (symbol_name);
-
- /* If the segment is undefined when the forward
- reference is solved, then copy the segment id
- from the forward symbol. */
+ def_symbol_in_progress->sy_value.X_add_symbol =
+ symbol_find_or_make (symbol_name);
+ def_symbol_in_progress->sy_value.X_subtract_symbol = NULL;
+ def_symbol_in_progress->sy_value.X_add_number = 0;
+ def_symbol_in_progress->sy_value.X_seg = undefined_section;
+
+ /* 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);
/* FIXME: gcc can generate address expressions
@@ -1369,7 +1373,7 @@ DEFUN_VOID (yank_symbols)
/* L* and C_EFCN symbols never merge. */
if (!SF_GET_LOCAL (symbolP)
&& S_GET_STORAGE_CLASS (symbolP) != C_LABEL
- && symbolP->sy_forward == NULL
+ && symbolP->sy_value.X_seg == absolute_section
&& (real_symbolP = symbol_find_base (S_GET_NAME (symbolP), DO_NOT_STRIP))
&& real_symbolP != symbolP)
{
@@ -1396,8 +1400,7 @@ DEFUN_VOID (yank_symbols)
S_SET_SEGMENT (symbolP, SEG_E0);
} /* push data into text */
- S_SET_VALUE (symbolP,
- S_GET_VALUE (symbolP) + symbolP->sy_frag->fr_address);
+ resolve_symbol_value (symbolP);
if (!S_IS_DEFINED (symbolP) && !SF_GET_LOCAL (symbolP))
{
@@ -1612,16 +1615,6 @@ DEFUN (crawl_symbols, (h, abfd),
/* Initialize the stack used to keep track of the matching .bb .be */
block_stack = stack_init (512, sizeof (symbolS *));
- /* JF deal with forward references first... */
- for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next (symbolP))
- if (symbolP->sy_forward)
- {
- S_SET_VALUE (symbolP, (S_GET_VALUE (symbolP)
- + S_GET_VALUE (symbolP->sy_forward)
- + symbolP->sy_forward->sy_frag->fr_address));
- if (SF_GET_GET_SEGMENT (symbolP))
- S_SET_SEGMENT (symbolP, S_GET_SEGMENT (symbolP->sy_forward));
- }
/* The symbol list should be ordered according to the following sequence
* order :