aboutsummaryrefslogtreecommitdiff
path: root/gas/symbols.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-08-21 09:17:53 +0930
committerAlan Modra <amodra@gmail.com>2020-08-21 18:26:35 +0930
commite01e1cee39777b6278ff01502742347247e8dfd7 (patch)
tree59c5d6f34e19555ac544023bd8d096d17f4fd024 /gas/symbols.c
parentd285ba8d064bbcfbf518cd6cf0142b5722c8215a (diff)
downloadgdb-e01e1cee39777b6278ff01502742347247e8dfd7.zip
gdb-e01e1cee39777b6278ff01502742347247e8dfd7.tar.gz
gdb-e01e1cee39777b6278ff01502742347247e8dfd7.tar.bz2
Rearrange symbol_create parameters
These functions take an offset within frag, frag within section, and section parameter. So it makes sense to order the parameters as section, frag, offset. * symbols.h (symbol_new, symbol_create, local_symbol_make), (symbol_temp_new): Arrange params as section, frag, offset. * symbols.c: Adjust to suit. * as.c: Likewise. * cgen.c: Likewise. * dwarf2dbg.c: Likewise. * ecoff.c: Likewise. * expr.c: Likewise. * itbl-ops.c: Likewise. * read.c: Likewise. * stabs.c: Likewise. * subsegs.c: Likewise. * config/obj-coff.c: Likewise. * config/obj-elf.c: Likewise. * config/obj-macho.c: Likewise. * config/tc-aarch64.c: Likewise. * config/tc-alpha.c: Likewise. * config/tc-arc.c: Likewise. * config/tc-arm.c: Likewise. * config/tc-avr.c: Likewise. * config/tc-cr16.c: Likewise. * config/tc-cris.c: Likewise. * config/tc-csky.c: Likewise. * config/tc-dlx.c: Likewise. * config/tc-hppa.c: Likewise. * config/tc-i386.c: Likewise. * config/tc-ia64.c: Likewise. * config/tc-m32r.c: Likewise. * config/tc-m68k.c: Likewise. * config/tc-mips.c: Likewise. * config/tc-mmix.c: Likewise. * config/tc-mn10200.c: Likewise. * config/tc-mn10300.c: Likewise. * config/tc-nds32.c: Likewise. * config/tc-nios2.c: Likewise. * config/tc-ppc.c: Likewise. * config/tc-riscv.c: Likewise. * config/tc-s390.c: Likewise. * config/tc-sh.c: Likewise. * config/tc-tic4x.c: Likewise. * config/tc-tic54x.c: Likewise. * config/tc-xtensa.c: Likewise.
Diffstat (limited to 'gas/symbols.c')
-rw-r--r--gas/symbols.c40
1 files changed, 18 insertions, 22 deletions
diff --git a/gas/symbols.c b/gas/symbols.c
index 587d3b7..092c945 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -268,9 +268,9 @@ static void print_binary (FILE *, const char *, expressionS *);
output file, you can call symbol_create. */
symbolS *
-symbol_new (const char *name, segT segment, valueT valu, fragS *frag)
+symbol_new (const char *name, segT segment, fragS *frag, valueT valu)
{
- symbolS *symbolP = symbol_create (name, segment, valu, frag);
+ symbolS *symbolP = symbol_create (name, segment, frag, valu);
/* Link to end of symbol chain. */
{
@@ -312,11 +312,10 @@ save_symbol_name (const char *name)
return ret;
}
+/* Create a symbol. NAME is copied, the caller can destroy/modify. */
+
symbolS *
-symbol_create (const char *name, /* It is copied, the caller can destroy/modify. */
- segT segment, /* Segment identifier (SEG_<something>). */
- valueT valu, /* Symbol value. */
- fragS *frag /* Associated fragment. */)
+symbol_create (const char *name, segT segment, fragS *frag, valueT valu)
{
const char *preserved_copy_of_name;
symbolS *symbolP;
@@ -374,7 +373,7 @@ static unsigned long local_symbol_conversion_count;
/* Create a local symbol and insert it into the local hash table. */
struct local_symbol *
-local_symbol_make (const char *name, segT section, valueT val, fragS *frag)
+local_symbol_make (const char *name, segT section, fragS *frag, valueT val)
{
const char *name_copy;
struct local_symbol *ret;
@@ -410,8 +409,8 @@ local_symbol_convert (struct local_symbol *locsym)
++local_symbol_conversion_count;
- ret = symbol_new (locsym->lsy_name, locsym->lsy_section, locsym->lsy_value,
- local_symbol_get_frag (locsym));
+ ret = symbol_new (locsym->lsy_name, locsym->lsy_section,
+ local_symbol_get_frag (locsym), locsym->lsy_value);
if (local_symbol_resolved_p (locsym))
ret->sy_flags.sy_resolved = 1;
@@ -626,14 +625,12 @@ colon (/* Just seen "x:" - rattle symbols & frags. */
}
else if (! flag_keep_locals && bfd_is_local_label_name (stdoutput, sym_name))
{
- symbolP = (symbolS *) local_symbol_make (sym_name, now_seg,
- (valueT) frag_now_fix (),
- frag_now);
+ symbolP = (symbolS *) local_symbol_make (sym_name, now_seg, frag_now,
+ frag_now_fix ());
}
else
{
- symbolP = symbol_new (sym_name, now_seg, (valueT) frag_now_fix (),
- frag_now);
+ symbolP = symbol_new (sym_name, now_seg, frag_now, frag_now_fix ());
symbol_table_insert (symbolP);
}
@@ -698,8 +695,7 @@ symbol_find_or_make (const char *name)
return symbolP;
symbolP = (symbolS *) local_symbol_make (name, undefined_section,
- (valueT) 0,
- &zero_address_frag);
+ &zero_address_frag, 0);
return symbolP;
}
@@ -720,7 +716,7 @@ symbol_make (const char *name)
symbolP = md_undefined_symbol ((char *) name);
if (!symbolP)
- symbolP = symbol_new (name, undefined_section, (valueT) 0, &zero_address_frag);
+ symbolP = symbol_new (name, undefined_section, &zero_address_frag, 0);
return (symbolP);
}
@@ -873,21 +869,21 @@ symbol_clone_if_forward_ref (symbolS *symbolP, int is_forward)
}
symbolS *
-symbol_temp_new (segT seg, valueT ofs, fragS *frag)
+symbol_temp_new (segT seg, fragS *frag, valueT ofs)
{
- return symbol_new (FAKE_LABEL_NAME, seg, ofs, frag);
+ return symbol_new (FAKE_LABEL_NAME, seg, frag, ofs);
}
symbolS *
symbol_temp_new_now (void)
{
- return symbol_temp_new (now_seg, frag_now_fix (), frag_now);
+ return symbol_temp_new (now_seg, frag_now, frag_now_fix ());
}
symbolS *
symbol_temp_new_now_octets (void)
{
- return symbol_temp_new (now_seg, frag_now_fix_octets (), frag_now);
+ return symbol_temp_new (now_seg, frag_now, frag_now_fix_octets ());
}
symbolS *
@@ -1322,7 +1318,7 @@ resolve_symbol_value (symbolS *symp)
if (relc_symbol_name != NULL)
relc_symbol = symbol_new (relc_symbol_name, undefined_section,
- 0, & zero_address_frag);
+ &zero_address_frag, 0);
if (relc_symbol == NULL)
{