aboutsummaryrefslogtreecommitdiff
path: root/gas/symbols.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-05-22 10:23:50 +0000
committerAlan Modra <amodra@gmail.com>2001-05-22 10:23:50 +0000
commit6386f3a76709a4d55f17b30449280e1b3ed01ed9 (patch)
treed54b59808b66538a730f1e79a93186fdeafaf493 /gas/symbols.c
parentc801568a3aea2906c9134468c7389acab7f54763 (diff)
downloadgdb-6386f3a76709a4d55f17b30449280e1b3ed01ed9.zip
gdb-6386f3a76709a4d55f17b30449280e1b3ed01ed9.tar.gz
gdb-6386f3a76709a4d55f17b30449280e1b3ed01ed9.tar.bz2
* symbols.c (resolve_symbol_value): Remove "finalize" param,
instead use finalize_syms directly. Don't treat expressions specially with regard to finalize_syms. Update calls to self. (resolve_local_symbol): Update call to resolve_symbol_value. (S_GET_VALUE): Likewise. Return resolve_symbol_value if !finalize_syms. * symbols.h (resolve_symbol_value): Update prototype. * config/obj-aout.c (obj_crawl_symbol_chain): Update call to resolve_symbol_value. * config/obj-bout.c (obj_crawl_symbol_chain): Likewise. * config/obj-coff.c (do_relocs_for): Likewise. (yank_symbols): Likewise. (fixup_segment): Likewise. * config/obj-vms.c (obj_crawl_symbol_chain): Likewise. * config/tc-mips.c (md_convert_frag): Likewise. * config/tc-ppc.c (ppc_frob_symbol): Likewise. (ppc_fix_adjustable): Likewise. * dwarf2dbg.c (dwarf2dbg_estimate_size_before_relax): Likewise. (dwarf2dbg_convert_frag): Likewise. * ehopt.c (eh_frame_estimate_size_before_relax): Likewise. (eh_frame_convert_frag): Likewise. * expr.c (make_expr_symbol): Likewise. * write.c (adjust_reloc_syms): Likewise. (write_object_file): Likewise. (relax_segment): Likewise. (fixup_segment): Likewise. (finalize_syms): Init to zero, and update comment. (write_object_file): Set finalize_syms to 1 rather than 2. * doc/internals.texi (sy_value): Mention finalize_syms. (S_GET_VALUE): Remove restriction on when S_GET_VALUE can be called.
Diffstat (limited to 'gas/symbols.c')
-rw-r--r--gas/symbols.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/gas/symbols.c b/gas/symbols.c
index 98623eb..3640723 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -831,9 +831,8 @@ verify_symbol_chain_2 (sym)
values. */
valueT
-resolve_symbol_value (symp, finalize)
+resolve_symbol_value (symp)
symbolS *symp;
- int finalize;
{
int resolved;
valueT final_val;
@@ -850,7 +849,7 @@ resolve_symbol_value (symp, finalize)
final_val = (local_symbol_get_frag (locsym)->fr_address
+ locsym->lsy_offset) / bfd_octets_per_byte (stdoutput);
- if (finalize)
+ if (finalize_syms)
{
locsym->lsy_offset = final_val;
local_symbol_mark_resolved (locsym);
@@ -870,14 +869,10 @@ resolve_symbol_value (symp, finalize)
resolved = 0;
final_seg = S_GET_SEGMENT (symp);
- /* Expressions aren't really symbols, so don't finalize their values
- until relaxation is complete. */
- if (final_seg == expr_section && finalize != 2)
- finalize = 0;
if (symp->sy_resolving)
{
- if (finalize)
+ if (finalize_syms)
as_bad (_("Symbol definition loop encountered at %s"),
S_GET_NAME (symp));
final_val = 0;
@@ -917,7 +912,7 @@ resolve_symbol_value (symp, finalize)
case O_symbol:
case O_symbol_rva:
- left = resolve_symbol_value (add_symbol, finalize);
+ left = resolve_symbol_value (add_symbol);
do_symbol:
if (symp->sy_mri_common)
@@ -929,7 +924,7 @@ resolve_symbol_value (symp, finalize)
break;
}
- if (finalize && final_val == 0)
+ if (finalize_syms && final_val == 0)
{
if (LOCAL_SYMBOL_CHECK (add_symbol))
add_symbol = local_symbol_convert ((struct local_symbol *)
@@ -945,7 +940,7 @@ resolve_symbol_value (symp, finalize)
is equated. */
if (! S_IS_DEFINED (add_symbol) || S_IS_COMMON (add_symbol))
{
- if (finalize)
+ if (finalize_syms)
{
S_SET_SEGMENT (symp, S_GET_SEGMENT (add_symbol));
symp->sy_value.X_op = O_symbol;
@@ -969,7 +964,7 @@ resolve_symbol_value (symp, finalize)
case O_uminus:
case O_bit_not:
case O_logical_not:
- left = resolve_symbol_value (add_symbol, finalize);
+ left = resolve_symbol_value (add_symbol);
if (op == O_uminus)
left = -left;
@@ -1004,8 +999,8 @@ resolve_symbol_value (symp, finalize)
case O_gt:
case O_logical_and:
case O_logical_or:
- left = resolve_symbol_value (add_symbol, finalize);
- right = resolve_symbol_value (op_symbol, finalize);
+ left = resolve_symbol_value (add_symbol);
+ right = resolve_symbol_value (op_symbol);
seg_left = S_GET_SEGMENT (add_symbol);
seg_right = S_GET_SEGMENT (op_symbol);
@@ -1047,7 +1042,7 @@ resolve_symbol_value (symp, finalize)
&& (op != O_subtract
|| seg_left != seg_right
|| seg_left == undefined_section)
- && finalize)
+ && finalize_syms)
{
char *file;
unsigned int line;
@@ -1089,7 +1084,7 @@ resolve_symbol_value (symp, finalize)
{
/* If seg_right is not absolute_section, then we've
already issued a warning about using a bad symbol. */
- if (seg_right == absolute_section && finalize)
+ if (seg_right == absolute_section && finalize_syms)
{
char *file;
unsigned int line;
@@ -1149,7 +1144,7 @@ resolve_symbol_value (symp, finalize)
symp->sy_resolving = 0;
}
- if (finalize)
+ if (finalize_syms)
{
S_SET_VALUE (symp, final_val);
@@ -1163,7 +1158,7 @@ resolve_symbol_value (symp, finalize)
exit_dont_set_value:
/* Don't worry if we can't resolve an expr_section symbol. */
- if (finalize)
+ if (finalize_syms)
{
if (resolved)
symp->sy_resolved = 1;
@@ -1190,7 +1185,7 @@ resolve_local_symbol (key, value)
PTR value;
{
if (value != NULL)
- resolve_symbol_value (value, finalize_syms);
+ resolve_symbol_value (value);
}
#endif
@@ -1583,8 +1578,8 @@ S_GET_VALUE (s)
if (!s->sy_resolved && s->sy_value.X_op != O_constant)
{
- valueT val = resolve_symbol_value (s, finalize_syms);
- if (finalize_syms != 2 && S_GET_SEGMENT (s) == expr_section)
+ valueT val = resolve_symbol_value (s);
+ if (!finalize_syms)
return val;
}
if (s->sy_value.X_op != O_constant)