diff options
author | Alan Modra <amodra@gmail.com> | 2001-05-25 10:07:43 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2001-05-25 10:07:43 +0000 |
commit | 05bdb37eec56a54e1115eddf807f57ebdb7e002e (patch) | |
tree | 2998e8b5cc45dfbe08d3af57b2dc7ea08bc332d5 /gas | |
parent | 1cd55018a65dbe3bbd25772c16d78feef8ede1cc (diff) | |
download | gdb-05bdb37eec56a54e1115eddf807f57ebdb7e002e.zip gdb-05bdb37eec56a54e1115eddf807f57ebdb7e002e.tar.gz gdb-05bdb37eec56a54e1115eddf807f57ebdb7e002e.tar.bz2 |
* symbols.c (resolve_symbol_value): Always set segment, even when
not finalizing symbol value.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 3 | ||||
-rw-r--r-- | gas/symbols.c | 18 |
2 files changed, 12 insertions, 9 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 8bcc652..b122f20 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,8 @@ 2001-05-25 Alan Modra <amodra@one.net.au> + * symbols.c (resolve_symbol_value): Always set segment, even when + not finalizing symbol value. + * config/obj-ieee.c (write_object_file): Set finalize_syms. * config/obj-coff.c (write_object_file): Likewise. * (size_section): Remove rs_space assert as fr_symbol is no longer diff --git a/gas/symbols.c b/gas/symbols.c index b8c78d2..764217d 100644 --- a/gas/symbols.c +++ b/gas/symbols.c @@ -942,7 +942,7 @@ resolve_symbol_value (symp) { if (finalize_syms) { - S_SET_SEGMENT (symp, S_GET_SEGMENT (add_symbol)); + final_seg = S_GET_SEGMENT (add_symbol); symp->sy_value.X_op = O_symbol; symp->sy_value.X_add_symbol = add_symbol; symp->sy_value.X_add_number = final_val; @@ -1146,18 +1146,18 @@ resolve_symbol_value (symp) } if (finalize_syms) - { - S_SET_VALUE (symp, final_val); + S_SET_VALUE (symp, final_val); +exit_dont_set_value: + /* Always set the segment, even if not finalizing the value. + The segment is used to determine whether a symbol is defined. */ #if defined (OBJ_AOUT) && ! defined (BFD_ASSEMBLER) - /* The old a.out backend does not handle S_SET_SEGMENT correctly - for a stab symbol, so we use this bad hack. */ - if (final_seg != S_GET_SEGMENT (symp)) + /* The old a.out backend does not handle S_SET_SEGMENT correctly + for a stab symbol, so we use this bad hack. */ + if (final_seg != S_GET_SEGMENT (symp)) #endif - S_SET_SEGMENT (symp, final_seg); - } + S_SET_SEGMENT (symp, final_seg); -exit_dont_set_value: /* Don't worry if we can't resolve an expr_section symbol. */ if (finalize_syms) { |