diff options
author | Ian Lance Taylor <ian@airs.com> | 1993-07-14 19:35:45 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1993-07-14 19:35:45 +0000 |
commit | 85051959f4b156350cb8fcb4c08db004950f3ea1 (patch) | |
tree | 623a81719bbf71379b445b7a525aa0252086caa3 /gas/config/obj-ieee.c | |
parent | 87ce60f98b5821f31e3e8a048d270d0124f096d0 (diff) | |
download | gdb-85051959f4b156350cb8fcb4c08db004950f3ea1.zip gdb-85051959f4b156350cb8fcb4c08db004950f3ea1.tar.gz gdb-85051959f4b156350cb8fcb4c08db004950f3ea1.tar.bz2 |
* Changes to keep a full expression as the value of a symbol, not
just a longword:
* struc-symbol.h: New field sy_value.
* as.h: Include expr.h before struc-symbol.h.
* expr.h: Use struct symbol rather than symbolS.
* symbols.c (S_GET_VALUE, S_SET_VALUE): Rewrote to retrieve value
of sy_value field; compile unconditionally, not just if
BFD_ASSEMBLER.
* symbols.h: Compile S_{SG}ET_VALUE prototypes unconditionally.
* write.c (write_object_file): Set BFD symbol value to gas symbol
value.
* config/obj-aout.h, config/obj-bout.h, config/obj-coff.h,
config/obj-coffbfd.h, config/obj-generic.h, config/obj-vms.h
(S_GET_VALUE, S_SET_VALUE): Removed macro definitions.
* config/obj-ieee.c (S_GET_VALUE, S_SET_VALUE): Removed.
* config/obj-coff.h, obj-coffbfd.h: Rewrote several macros to use
S_GET_VALUE rather than ost_entry.n_value.
* config/obj-aout.c (obj_symbol_to_chars), config/obj-bout.c
(obj_symbol_to_chars), config/obj-coff.c (obj_symbol_to_chars),
config/obj-coffbfd.c (symbol_to_chars): Get value to write out
using S_GET_VALUE--don't assume it is already set.
* config/obj-ieee.c (do_symbols): Set BFD symbol value to gas
symbol value.
* config/obj-vms.c (various): Don't assign directly to
S_GET_VALUE; use S_SET_VALUE instead.
Diffstat (limited to 'gas/config/obj-ieee.c')
-rw-r--r-- | gas/config/obj-ieee.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/gas/config/obj-ieee.c b/gas/config/obj-ieee.c index e4a39a6..61fff02 100644 --- a/gas/config/obj-ieee.c +++ b/gas/config/obj-ieee.c @@ -217,7 +217,13 @@ DEFUN (do_relocs_for, (idx), if ((s->flags & BSF_UNDEFINED) == 0) { to->section = s->section; + + /* We can refer directly to the value field here, + rather than using S_GET_VALUE, because this is + only called after do_symbols, which sets up the + value field. */ to->addend += s->value; + to->sym_ptr_ptr = 0; if (to->howto->pcrel_offset) { @@ -276,7 +282,7 @@ DEFUN (do_symbols, (abfd), { ptr->sy_symbol.sy.section = (asection *) (segment_info[ptr->sy_symbol.seg].user_stuff); - ptr->sy_symbol.sy.value += ptr->sy_frag->fr_address; + S_SET_VALUE (ptr, S_GET_VALUE (ptr) + ptr->sy_frag->fr_address); if (ptr->sy_symbol.sy.flags == 0) { ptr->sy_symbol.sy.flags = BSF_LOCAL; @@ -298,6 +304,7 @@ DEFUN (do_symbols, (abfd), abort (); } } + ptr->sy_symbol.sy.value = S_GET_VALUE (ptr); count++; } symbol_ptr_vec = (asymbol **) malloc ((count + 1) * sizeof (asymbol *)); @@ -339,14 +346,6 @@ DEFUN_VOID (bfd_as_write_hook) } - - -S_GET_VALUE (x) - symbolS *x; -{ - return x->sy_symbol.sy.value; -} - S_SET_SEGMENT (x, y) symbolS *x; int y; @@ -399,13 +398,6 @@ S_SET_NAME (x, y) x->sy_symbol.sy.name = y; } -S_SET_VALUE (s, v) - symbolS *s; - long v; -{ - s->sy_symbol.sy.value = v; -} - S_GET_OTHER (x) { abort (); |