diff options
author | Alan Modra <amodra@gmail.com> | 2020-08-21 09:17:53 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-08-21 18:26:35 +0930 |
commit | e01e1cee39777b6278ff01502742347247e8dfd7 (patch) | |
tree | 59c5d6f34e19555ac544023bd8d096d17f4fd024 /gas | |
parent | d285ba8d064bbcfbf518cd6cf0142b5722c8215a (diff) | |
download | gdb-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')
42 files changed, 292 insertions, 266 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 94ad709..341530f 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,48 @@ +2020-08-21 Alan Modra <amodra@gmail.com> + + * 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. + 2020-08-21 Cooper Qu <cooper.qu@linux.alibaba.com> * config/tc-csky.c (csky_insn_info): Add member last_isize. @@ -1368,7 +1368,7 @@ main (int argc, char ** argv) dwarf2_init (); local_symbol_make (".gasversion.", absolute_section, - BFD_VERSION / 10000UL, &predefined_address_frag); + &predefined_address_frag, BFD_VERSION / 10000UL); /* Now that we have fully initialized, and have created the output file, define any symbols requested by --defsym command line @@ -1378,8 +1378,8 @@ main (int argc, char ** argv) symbolS *sym; struct defsym_list *next; - sym = symbol_new (defsyms->name, absolute_section, defsyms->value, - &zero_address_frag); + sym = symbol_new (defsyms->name, absolute_section, + &zero_address_frag, defsyms->value); /* Make symbols defined on the command line volatile, so that they can be redefined inside a source file. This makes this assembler's behaviour compatible with earlier versions, but it may not be @@ -61,7 +61,7 @@ cgen_asm_record_register (char *name, int number) /* Use symbol_create here instead of symbol_new so we don't try to output registers into the object file's symbol table. */ symbol_table_insert (symbol_create (name, reg_section, - number, &zero_address_frag)); + &zero_address_frag, number)); } /* We need to keep a list of fixups. We can't simply generate them as @@ -437,8 +437,8 @@ gas_cgen_parse_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, prematurely dives into the symbol evaluator, and in this case it gets a bad answer, so we manually create the expression symbol we want here. */ - stmp = symbol_create (FAKE_LABEL_NAME, expr_section, 0, - & zero_address_frag); + stmp = symbol_create (FAKE_LABEL_NAME, expr_section, + &zero_address_frag, 0); symbol_set_value_expression (stmp, & exp); } else diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c index d0d128f..7e26e58 100644 --- a/gas/config/obj-coff.c +++ b/gas/config/obj-coff.c @@ -144,8 +144,7 @@ tag_find_or_make (char *name) if ((symbolP = tag_find (name)) == NULL) { - symbolP = symbol_new (name, undefined_section, - 0, &zero_address_frag); + symbolP = symbol_new (name, undefined_section, &zero_address_frag, 0); tag_insert (S_GET_NAME (symbolP), symbolP); symbol_table_insert (symbolP); @@ -324,7 +323,7 @@ c_dot_file_symbol (const char *filename, int appfile ATTRIBUTE_UNUSED) /* BFD converts filename to a .file symbol with an aux entry. It also handles chaining. */ - symbolP = symbol_new (filename, bfd_abs_section_ptr, 0, &zero_address_frag); + symbolP = symbol_new (filename, bfd_abs_section_ptr, &zero_address_frag, 0); S_SET_STORAGE_CLASS (symbolP, C_FILE); S_SET_NUMBER_AUXILIARY (symbolP, 1); diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index ba93770..f169187 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -271,8 +271,7 @@ elf_file_symbol (const char *s, int appfile) symbolS *sym; size_t name_length; - sym = symbol_new (s, absolute_section, 0, NULL); - symbol_set_frag (sym, &zero_address_frag); + sym = symbol_new (s, absolute_section, &zero_address_frag, 0); name_length = strlen (s); if (name_length > strlen (S_GET_NAME (sym))) @@ -2724,7 +2723,7 @@ elf_adjust_symtab (void) if (!sy || !symbol_on_chain (sy, symbol_rootP, symbol_lastP)) { /* Create the symbol now. */ - sy = symbol_new (group_name, now_seg, (valueT) 0, frag_now); + sy = symbol_new (group_name, now_seg, frag_now, 0); #ifdef TE_SOLARIS /* Before Solaris 11 build 154, Sun ld rejects local group signature symbols, so make them weak hidden instead. */ diff --git a/gas/config/obj-macho.c b/gas/config/obj-macho.c index 3788f82..4b54a66 100644 --- a/gas/config/obj-macho.c +++ b/gas/config/obj-macho.c @@ -1522,15 +1522,15 @@ obj_mach_o_process_stab (int what, const char *string, switch (what) { case 'd': - symbolP = symbol_new ("", now_seg, frag_now_fix (), frag_now); + symbolP = symbol_new ("", now_seg, frag_now, frag_now_fix ()); /* Special stabd NULL name indicator. */ S_SET_NAME (symbolP, NULL); break; case 'n': case 's': - symbolP = symbol_new (string, undefined_section, (valueT) 0, - &zero_address_frag); + symbolP = symbol_new (string, undefined_section, + &zero_address_frag, 0); pseudo_set (symbolP); break; diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 301b499..c7cae1a 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -1535,7 +1535,7 @@ make_mapping_symbol (enum mstate state, valueT value, fragS * frag) abort (); } - symbolP = symbol_new (symname, now_seg, value, frag); + symbolP = symbol_new (symname, now_seg, frag, value); symbol_get_bfdsym (symbolP)->flags |= type | BSF_LOCAL; /* Save the mapping symbols for future reference. Also check that @@ -1742,7 +1742,7 @@ find_or_make_literal_pool (int size) if (pool->symbol == NULL) { pool->symbol = symbol_create (FAKE_LABEL_NAME, undefined_section, - (valueT) 0, &zero_address_frag); + &zero_address_frag, 0); pool->id = latest_pool_num++; } @@ -7562,7 +7562,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED) as_bad (_("GOT already in the symbol table")); GOT_symbol = symbol_new (name, undefined_section, - (valueT) 0, &zero_address_frag); + &zero_address_frag, 0); } return GOT_symbol; diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c index d844fcf..4810734 100644 --- a/gas/config/tc-alpha.c +++ b/gas/config/tc-alpha.c @@ -3403,8 +3403,7 @@ add_to_link_pool (symbolS *sym, offsetT addend) /* Not found, add a new entry. */ subseg_set (alpha_link_section, 0); - linksym = symbol_new - (FAKE_LABEL_NAME, now_seg, (valueT) frag_now_fix (), frag_now); + linksym = symbol_new (FAKE_LABEL_NAME, now_seg, frag_now, frag_now_fix ()); p = frag_more (8); memset (p, 0, 8); @@ -3903,8 +3902,8 @@ s_alpha_prologue (int ignore ATTRIBUTE_UNUSED) arg = get_absolute_expression (); demand_empty_rest_of_line (); - alpha_prologue_label = symbol_new - (FAKE_LABEL_NAME, now_seg, (valueT) frag_now_fix (), frag_now); + alpha_prologue_label = symbol_new (FAKE_LABEL_NAME, now_seg, frag_now, + frag_now_fix ()); if (ECOFF_DEBUGGING) sym = ecoff_get_cur_proc_sym (); @@ -4055,8 +4054,8 @@ alpha_elf_md_end (void) /* Create a temporary symbol at the same location as our function symbol. This prevents problems with globals. */ cfi_new_fde (symbol_temp_new (S_GET_SEGMENT (p->func_sym), - S_GET_VALUE (p->func_sym), - symbol_get_frag (p->func_sym))); + symbol_get_frag (p->func_sym), + S_GET_VALUE (p->func_sym))); cfi_set_sections (); cfi_set_return_column (p->ra_regno); @@ -4469,8 +4468,8 @@ static void s_alpha_prologue (int ignore ATTRIBUTE_UNUSED) { demand_empty_rest_of_line (); - alpha_prologue_label = symbol_new - (FAKE_LABEL_NAME, now_seg, (valueT) frag_now_fix (), frag_now); + alpha_prologue_label = symbol_new (FAKE_LABEL_NAME, now_seg, frag_now, + frag_now_fix ()); } /* Parse .pdesc <entry_name>,{null|stack|reg} @@ -4705,8 +4704,8 @@ s_alpha_linkage (int ignore ATTRIBUTE_UNUSED) BFD_RELOC_ALPHA_LINKAGE); if (alpha_insn_label == NULL) - alpha_insn_label = symbol_new - (FAKE_LABEL_NAME, now_seg, (valueT) frag_now_fix (), frag_now); + alpha_insn_label = symbol_new (FAKE_LABEL_NAME, now_seg, frag_now, + frag_now_fix ()); /* Create a linkage element. */ linkage_fixup = XNEW (struct alpha_linkage_fixups); @@ -5470,8 +5469,8 @@ md_begin (void) char name[4]; sprintf (name, "$%d", i); - alpha_register_table[i] = symbol_create (name, reg_section, i, - &zero_address_frag); + alpha_register_table[i] = symbol_create (name, reg_section, + &zero_address_frag, i); } for (; i < 64; ++i) @@ -5479,8 +5478,8 @@ md_begin (void) char name[5]; sprintf (name, "$f%d", i - 32); - alpha_register_table[i] = symbol_create (name, reg_section, i, - &zero_address_frag); + alpha_register_table[i] = symbol_create (name, reg_section, + &zero_address_frag, i); } /* Create the special symbols and sections we'll be using. */ @@ -5493,8 +5492,8 @@ md_begin (void) /* For handling the GP, create a symbol that won't be output in the symbol table. We'll edit it out of relocs later. */ - alpha_gp_symbol = symbol_create ("<GP value>", alpha_lita_section, 0x8000, - &zero_address_frag); + alpha_gp_symbol = symbol_create ("<GP value>", alpha_lita_section, + &zero_address_frag, 0x8000); #endif #ifdef OBJ_EVAX diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c index 5fa0ccb..0232b3d 100644 --- a/gas/config/tc-arc.c +++ b/gas/config/tc-arc.c @@ -2550,7 +2550,7 @@ static void declare_register (const char *name, int number) { symbolS *regS = symbol_create (name, reg_section, - number, &zero_address_frag); + &zero_address_frag, number); str_hash_insert (arc_reg_hash, S_GET_NAME (regS), (void *) regS); } @@ -2581,7 +2581,7 @@ static void declare_addrtype (const char *name, int number) { symbolS *addrtypeS = symbol_create (name, undefined_section, - number, &zero_address_frag); + &zero_address_frag, number); str_hash_insert (arc_addrtype_hash, S_GET_NAME (addrtypeS), (void *) addrtypeS); @@ -3350,7 +3350,7 @@ md_undefined_symbol (char *name) as_bad ("GOT already in symbol table"); GOT_symbol = symbol_new (GLOBAL_OFFSET_TABLE_NAME, undefined_section, - (valueT) 0, &zero_address_frag); + &zero_address_frag, 0); }; return GOT_symbol; } diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 3b17e20..ce2dd0e 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -2971,7 +2971,7 @@ make_mapping_symbol (enum mstate state, valueT value, fragS *frag) abort (); } - symbolP = symbol_new (symname, now_seg, value, frag); + symbolP = symbol_new (symname, now_seg, frag, value); symbol_get_bfdsym (symbolP)->flags |= type | BSF_LOCAL; switch (state) @@ -3310,12 +3310,12 @@ s_thumb_set (int equiv) memset (dummy_frag, 0, sizeof (fragS)); dummy_frag->fr_type = rs_fill; dummy_frag->line = listing_tail; - symbolP = symbol_new (name, undefined_section, 0, dummy_frag); + symbolP = symbol_new (name, undefined_section, dummy_frag, 0); dummy_frag->fr_symbol = symbolP; } else #endif - symbolP = symbol_new (name, undefined_section, 0, &zero_address_frag); + symbolP = symbol_new (name, undefined_section, &zero_address_frag, 0); #ifdef OBJ_COFF /* "set" symbols are local unless otherwise specified. */ @@ -3543,7 +3543,7 @@ find_or_make_literal_pool (void) if (pool->symbol == NULL) { pool->symbol = symbol_create (FAKE_LABEL_NAME, undefined_section, - (valueT) 0, &zero_address_frag); + &zero_address_frag, 0); pool->id = latest_pool_num ++; } @@ -28025,7 +28025,7 @@ md_undefined_symbol (char * name ATTRIBUTE_UNUSED) as_bad (_("GOT already in the symbol table")); GOT_symbol = symbol_new (name, undefined_section, - (valueT) 0, & zero_address_frag); + &zero_address_frag, 0); } return GOT_symbol; diff --git a/gas/config/tc-avr.c b/gas/config/tc-avr.c index ae06727..157eb9b 100644 --- a/gas/config/tc-avr.c +++ b/gas/config/tc-avr.c @@ -780,7 +780,7 @@ avr_undefined_symbol (char *name) char xname[30]; sprintf (xname, "%s.%03u", name, (++suffix) % 1000); avr_isr.sym_n_pushed = symbol_new (xname, undefined_section, - (valueT) 0, &zero_address_frag); + &zero_address_frag, (valueT) 0); } return avr_isr.sym_n_pushed; } diff --git a/gas/config/tc-cr16.c b/gas/config/tc-cr16.c index c95d724..e5db874 100644 --- a/gas/config/tc-cr16.c +++ b/gas/config/tc-cr16.c @@ -689,16 +689,16 @@ md_undefined_symbol (char *name) { if (*name == '_' && *(name + 1) == 'G' && strcmp (name, "_GLOBAL_OFFSET_TABLE_") == 0) - { - if (!GOT_symbol) - { - if (symbol_find (name)) - as_bad (_("GOT already in symbol table")); - GOT_symbol = symbol_new (name, undefined_section, - (valueT) 0, &zero_address_frag); - } - return GOT_symbol; - } + { + if (!GOT_symbol) + { + if (symbol_find (name)) + as_bad (_("GOT already in symbol table")); + GOT_symbol = symbol_new (name, undefined_section, + &zero_address_frag, 0); + } + return GOT_symbol; + } return 0; } diff --git a/gas/config/tc-cris.c b/gas/config/tc-cris.c index ea8890f..1231084 100644 --- a/gas/config/tc-cris.c +++ b/gas/config/tc-cris.c @@ -1196,19 +1196,19 @@ md_begin (void) /* Enable use of ".if ..asm.arch.cris.v32" and ".if ..asm.arch.cris.common_v10_v32" and a few others. */ symbol_table_insert (symbol_new ("..asm.arch.cris.v32", absolute_section, - (cris_arch == arch_crisv32), - &zero_address_frag)); + &zero_address_frag, + cris_arch == arch_crisv32)); symbol_table_insert (symbol_new ("..asm.arch.cris.v10", absolute_section, - (cris_arch == arch_crisv10), - &zero_address_frag)); + &zero_address_frag, + cris_arch == arch_crisv10)); symbol_table_insert (symbol_new ("..asm.arch.cris.common_v10_v32", absolute_section, - (cris_arch == arch_cris_common_v10_v32), - &zero_address_frag)); + &zero_address_frag, + cris_arch == arch_cris_common_v10_v32)); symbol_table_insert (symbol_new ("..asm.arch.cris.any_v0_v10", absolute_section, - (cris_arch == arch_cris_any_v0_v10), - &zero_address_frag)); + &zero_address_frag, + cris_arch == arch_cris_any_v0_v10)); while (cris_opcodes[i].name != NULL) { diff --git a/gas/config/tc-csky.c b/gas/config/tc-csky.c index 49a52d4..ec1ea94 100644 --- a/gas/config/tc-csky.c +++ b/gas/config/tc-csky.c @@ -1399,7 +1399,7 @@ make_mapping_symbol (map_state state, valueT value, fragS *frag) abort (); } - symbolP = symbol_new (symname, now_seg, value, frag); + symbolP = symbol_new (symname, now_seg, frag, value); symbol_get_bfdsym (symbolP)->flags |= type | BSF_LOCAL; } diff --git a/gas/config/tc-dlx.c b/gas/config/tc-dlx.c index f08f442..51e7065 100644 --- a/gas/config/tc-dlx.c +++ b/gas/config/tc-dlx.c @@ -92,14 +92,14 @@ insert_sreg (const char *regname, int regnum) char buf[80]; int i; - symbol_table_insert (symbol_new (regname, reg_section, (valueT) regnum, - &zero_address_frag)); + symbol_table_insert (symbol_new (regname, reg_section, + &zero_address_frag, regnum)); for (i = 0; regname[i]; i++) buf[i] = ISLOWER (regname[i]) ? TOUPPER (regname[i]) : regname[i]; buf[i] = '\0'; - symbol_table_insert (symbol_new (buf, reg_section, (valueT) regnum, - &zero_address_frag)); + symbol_table_insert (symbol_new (buf, reg_section, + &zero_address_frag, regnum)); } /* Install symbol definitions for assorted special registers. diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c index 272605b..1feebc8 100644 --- a/gas/config/tc-hppa.c +++ b/gas/config/tc-hppa.c @@ -5989,8 +5989,8 @@ pa_build_unwind_subspace (struct call_info *call_info) else { symbolP = symbol_new (name, now_seg, - S_GET_VALUE (call_info->start_symbol), - symbol_get_frag (call_info->start_symbol)); + symbol_get_frag (call_info->start_symbol), + S_GET_VALUE (call_info->start_symbol)); gas_assert (symbolP); S_CLEAR_EXTERNAL (symbolP); symbol_table_insert (symbolP); @@ -6439,8 +6439,7 @@ hppa_elf_mark_end_of_function (void) { /* symbol value should be the offset of the last instruction of the function */ - symbolP = symbol_new (name, now_seg, (valueT) (frag_now_fix () - 4), - frag_now); + symbolP = symbol_new (name, now_seg, frag_now, frag_now_fix () - 4); gas_assert (symbolP); S_CLEAR_EXTERNAL (symbolP); diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 752a98b..43eb365 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -13798,7 +13798,7 @@ md_undefined_symbol (char *name) if (symbol_find (name)) as_bad (_("GOT already in symbol table")); GOT_symbol = symbol_new (name, undefined_section, - (valueT) 0, &zero_address_frag); + &zero_address_frag, 0); }; return GOT_symbol; } diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c index 1686579..ed4636b 100644 --- a/gas/config/tc-ia64.c +++ b/gas/config/tc-ia64.c @@ -4435,9 +4435,10 @@ dot_endp (int dummy ATTRIBUTE_UNUSED) e.X_add_number = 0; if (!S_IS_LOCAL (unwind.proc_pending.sym) && S_IS_DEFINED (unwind.proc_pending.sym)) - e.X_add_symbol = symbol_temp_new (S_GET_SEGMENT (unwind.proc_pending.sym), - S_GET_VALUE (unwind.proc_pending.sym), - symbol_get_frag (unwind.proc_pending.sym)); + e.X_add_symbol + = symbol_temp_new (S_GET_SEGMENT (unwind.proc_pending.sym), + symbol_get_frag (unwind.proc_pending.sym), + S_GET_VALUE (unwind.proc_pending.sym)); else e.X_add_symbol = unwind.proc_pending.sym; ia64_cons_fix_new (frag_now, where, bytes_per_address, &e, @@ -4487,7 +4488,7 @@ dot_endp (int dummy ATTRIBUTE_UNUSED) symbol_get_obj (sym)->size->X_op = O_subtract; symbol_get_obj (sym)->size->X_add_symbol = symbol_new (FAKE_LABEL_NAME, now_seg, - frag_now_fix (), frag_now); + frag_now, frag_now_fix ()); symbol_get_obj (sym)->size->X_op_symbol = sym; symbol_get_obj (sym)->size->X_add_number = 0; } @@ -5371,7 +5372,7 @@ declare_register (const char *name, unsigned int regnum) { symbolS *sym; - sym = symbol_create (name, reg_section, regnum, &zero_address_frag); + sym = symbol_create (name, reg_section, &zero_address_frag, regnum); str_hash_insert (md.reg_hash, S_GET_NAME (sym), (void *) sym); @@ -7244,77 +7245,77 @@ md_begin (void) secalias_name_hash = str_htab_create (); pseudo_func[FUNC_DTP_MODULE].u.sym = - symbol_new (".<dtpmod>", undefined_section, FUNC_DTP_MODULE, - &zero_address_frag); + symbol_new (".<dtpmod>", undefined_section, + &zero_address_frag, FUNC_DTP_MODULE); pseudo_func[FUNC_DTP_RELATIVE].u.sym = - symbol_new (".<dtprel>", undefined_section, FUNC_DTP_RELATIVE, - &zero_address_frag); + symbol_new (".<dtprel>", undefined_section, + &zero_address_frag, FUNC_DTP_RELATIVE); pseudo_func[FUNC_FPTR_RELATIVE].u.sym = - symbol_new (".<fptr>", undefined_section, FUNC_FPTR_RELATIVE, - &zero_address_frag); + symbol_new (".<fptr>", undefined_section, + &zero_address_frag, FUNC_FPTR_RELATIVE); pseudo_func[FUNC_GP_RELATIVE].u.sym = - symbol_new (".<gprel>", undefined_section, FUNC_GP_RELATIVE, - &zero_address_frag); + symbol_new (".<gprel>", undefined_section, + &zero_address_frag, FUNC_GP_RELATIVE); pseudo_func[FUNC_LT_RELATIVE].u.sym = - symbol_new (".<ltoff>", undefined_section, FUNC_LT_RELATIVE, - &zero_address_frag); + symbol_new (".<ltoff>", undefined_section, + &zero_address_frag, FUNC_LT_RELATIVE); pseudo_func[FUNC_LT_RELATIVE_X].u.sym = - symbol_new (".<ltoffx>", undefined_section, FUNC_LT_RELATIVE_X, - &zero_address_frag); + symbol_new (".<ltoffx>", undefined_section, + &zero_address_frag, FUNC_LT_RELATIVE_X); pseudo_func[FUNC_PC_RELATIVE].u.sym = - symbol_new (".<pcrel>", undefined_section, FUNC_PC_RELATIVE, - &zero_address_frag); + symbol_new (".<pcrel>", undefined_section, + &zero_address_frag, FUNC_PC_RELATIVE); pseudo_func[FUNC_PLT_RELATIVE].u.sym = - symbol_new (".<pltoff>", undefined_section, FUNC_PLT_RELATIVE, - &zero_address_frag); + symbol_new (".<pltoff>", undefined_section, + &zero_address_frag, FUNC_PLT_RELATIVE); pseudo_func[FUNC_SEC_RELATIVE].u.sym = - symbol_new (".<secrel>", undefined_section, FUNC_SEC_RELATIVE, - &zero_address_frag); + symbol_new (".<secrel>", undefined_section, + &zero_address_frag, FUNC_SEC_RELATIVE); pseudo_func[FUNC_SEG_RELATIVE].u.sym = - symbol_new (".<segrel>", undefined_section, FUNC_SEG_RELATIVE, - &zero_address_frag); + symbol_new (".<segrel>", undefined_section, + &zero_address_frag, FUNC_SEG_RELATIVE); pseudo_func[FUNC_TP_RELATIVE].u.sym = - symbol_new (".<tprel>", undefined_section, FUNC_TP_RELATIVE, - &zero_address_frag); + symbol_new (".<tprel>", undefined_section, + &zero_address_frag, FUNC_TP_RELATIVE); pseudo_func[FUNC_LTV_RELATIVE].u.sym = - symbol_new (".<ltv>", undefined_section, FUNC_LTV_RELATIVE, - &zero_address_frag); + symbol_new (".<ltv>", undefined_section, + &zero_address_frag, FUNC_LTV_RELATIVE); pseudo_func[FUNC_LT_FPTR_RELATIVE].u.sym = - symbol_new (".<ltoff.fptr>", undefined_section, FUNC_LT_FPTR_RELATIVE, - &zero_address_frag); + symbol_new (".<ltoff.fptr>", undefined_section, + &zero_address_frag, FUNC_LT_FPTR_RELATIVE); pseudo_func[FUNC_LT_DTP_MODULE].u.sym = - symbol_new (".<ltoff.dtpmod>", undefined_section, FUNC_LT_DTP_MODULE, - &zero_address_frag); + symbol_new (".<ltoff.dtpmod>", undefined_section, + &zero_address_frag, FUNC_LT_DTP_MODULE); pseudo_func[FUNC_LT_DTP_RELATIVE].u.sym = - symbol_new (".<ltoff.dptrel>", undefined_section, FUNC_LT_DTP_RELATIVE, - &zero_address_frag); + symbol_new (".<ltoff.dptrel>", undefined_section, + &zero_address_frag, FUNC_LT_DTP_RELATIVE); pseudo_func[FUNC_LT_TP_RELATIVE].u.sym = - symbol_new (".<ltoff.tprel>", undefined_section, FUNC_LT_TP_RELATIVE, - &zero_address_frag); + symbol_new (".<ltoff.tprel>", undefined_section, + &zero_address_frag, FUNC_LT_TP_RELATIVE); pseudo_func[FUNC_IPLT_RELOC].u.sym = - symbol_new (".<iplt>", undefined_section, FUNC_IPLT_RELOC, - &zero_address_frag); + symbol_new (".<iplt>", undefined_section, + &zero_address_frag, FUNC_IPLT_RELOC); #ifdef TE_VMS pseudo_func[FUNC_SLOTCOUNT_RELOC].u.sym = - symbol_new (".<slotcount>", undefined_section, FUNC_SLOTCOUNT_RELOC, - &zero_address_frag); + symbol_new (".<slotcount>", undefined_section, + &zero_address_frag, FUNC_SLOTCOUNT_RELOC); #endif if (md.tune != itanium1) @@ -11964,7 +11965,7 @@ ia64_vms_note (void) /* This symbol should be passed on the command line and be variable according to language. */ sym = symbol_new ("__gnat_vms_display_name@gnat_demangler_rtl", - absolute_section, 0, &zero_address_frag); + absolute_section, &zero_address_frag, 0); symbol_table_insert (sym); symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING | BSF_DYNAMIC; diff --git a/gas/config/tc-m32r.c b/gas/config/tc-m32r.c index 824f67c..18bd667 100644 --- a/gas/config/tc-m32r.c +++ b/gas/config/tc-m32r.c @@ -574,7 +574,7 @@ debug_sym (int ignore ATTRIBUTE_UNUSED) if ((symbolP = symbol_find (name)) == NULL && (symbolP = md_undefined_symbol (name)) == NULL) - symbolP = symbol_new (name, undefined_section, 0, &zero_address_frag); + symbolP = symbol_new (name, undefined_section, &zero_address_frag, 0); symbol_table_insert (symbolP); if (S_IS_DEFINED (symbolP) && (S_GET_SEGMENT (symbolP) != reg_section diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c index 6542d27..2416652 100644 --- a/gas/config/tc-m68k.c +++ b/gas/config/tc-m68k.c @@ -3959,15 +3959,15 @@ insert_reg (const char *regname, int regnum) } #endif - symbol_table_insert (symbol_new (regname, reg_section, regnum, - &zero_address_frag)); + symbol_table_insert (symbol_new (regname, reg_section, + &zero_address_frag, regnum)); for (i = 0; regname[i]; i++) buf[i] = TOUPPER (regname[i]); buf[i] = '\0'; - symbol_table_insert (symbol_new (buf, reg_section, regnum, - &zero_address_frag)); + symbol_table_insert (symbol_new (buf, reg_section, + &zero_address_frag, regnum)); } struct init_entry diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index f521d48..ebcc633 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -3789,18 +3789,18 @@ md_begin (void) helps us detect invalid uses of them. */ for (i = 0; reg_names[i].name; i++) symbol_table_insert (symbol_new (reg_names[i].name, reg_section, - reg_names[i].num, /* & RNUM_MASK, */ - &zero_address_frag)); + &zero_address_frag, + reg_names[i].num)); if (HAVE_NEWABI) for (i = 0; reg_names_n32n64[i].name; i++) symbol_table_insert (symbol_new (reg_names_n32n64[i].name, reg_section, - reg_names_n32n64[i].num, /* & RNUM_MASK, */ - &zero_address_frag)); + &zero_address_frag, + reg_names_n32n64[i].num)); else for (i = 0; reg_names_o32[i].name; i++) symbol_table_insert (symbol_new (reg_names_o32[i].name, reg_section, - reg_names_o32[i].num, /* & RNUM_MASK, */ - &zero_address_frag)); + &zero_address_frag, + reg_names_o32[i].num)); for (i = 0; i < 32; i++) { @@ -3809,17 +3809,17 @@ md_begin (void) /* R5900 VU0 floating-point register. */ sprintf (regname, "$vf%d", i); symbol_table_insert (symbol_new (regname, reg_section, - RTYPE_VF | i, &zero_address_frag)); + &zero_address_frag, RTYPE_VF | i)); /* R5900 VU0 integer register. */ sprintf (regname, "$vi%d", i); symbol_table_insert (symbol_new (regname, reg_section, - RTYPE_VI | i, &zero_address_frag)); + &zero_address_frag, RTYPE_VI | i)); /* MSA register. */ sprintf (regname, "$w%d", i); symbol_table_insert (symbol_new (regname, reg_section, - RTYPE_MSA | i, &zero_address_frag)); + &zero_address_frag, RTYPE_MSA | i)); } obstack_init (&mips_operand_tokens); @@ -18876,7 +18876,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) } /* Make a label at the end for use with the branch. */ - l = symbol_new (micromips_label_name (), asec, fragp->fr_fix, fragp); + l = symbol_new (micromips_label_name (), asec, fragp, fragp->fr_fix); micromips_label_inc (); S_SET_OTHER (l, ELF_ST_SET_MICROMIPS (S_GET_OTHER (l))); diff --git a/gas/config/tc-mmix.c b/gas/config/tc-mmix.c index fb1f3d2..82a69f1 100644 --- a/gas/config/tc-mmix.c +++ b/gas/config/tc-mmix.c @@ -785,8 +785,8 @@ mmix_md_begin (void) /* Alternatively, we could diddle with '$' and the following number, but keeping the registers as symbols helps keep parsing simple. */ sprintf (buf, "$%d", i); - symbol_table_insert (symbol_new (buf, reg_section, i, - &zero_address_frag)); + symbol_table_insert (symbol_new (buf, reg_section, + &zero_address_frag, i)); } /* Insert mmixal built-in names if allowed. */ @@ -795,21 +795,21 @@ mmix_md_begin (void) for (i = 0; mmix_spec_regs[i].name != NULL; i++) symbol_table_insert (symbol_new (mmix_spec_regs[i].name, reg_section, - mmix_spec_regs[i].number + 256, - &zero_address_frag)); + &zero_address_frag, + mmix_spec_regs[i].number + 256)); /* FIXME: Perhaps these should be recognized as specials; as field names for those instructions. */ - symbol_table_insert (symbol_new ("ROUND_CURRENT", reg_section, 512, - &zero_address_frag)); - symbol_table_insert (symbol_new ("ROUND_OFF", reg_section, 512 + 1, - &zero_address_frag)); - symbol_table_insert (symbol_new ("ROUND_UP", reg_section, 512 + 2, - &zero_address_frag)); - symbol_table_insert (symbol_new ("ROUND_DOWN", reg_section, 512 + 3, - &zero_address_frag)); - symbol_table_insert (symbol_new ("ROUND_NEAR", reg_section, 512 + 4, - &zero_address_frag)); + symbol_table_insert (symbol_new ("ROUND_CURRENT", reg_section, + &zero_address_frag, 512)); + symbol_table_insert (symbol_new ("ROUND_OFF", reg_section, + &zero_address_frag, 512 + 1)); + symbol_table_insert (symbol_new ("ROUND_UP", reg_section, + &zero_address_frag, 512 + 2)); + symbol_table_insert (symbol_new ("ROUND_DOWN", reg_section, + &zero_address_frag, 512 + 3)); + symbol_table_insert (symbol_new ("ROUND_NEAR", reg_section, + &zero_address_frag, 512 + 4)); } } @@ -3520,8 +3520,8 @@ mmix_md_end (void) sprintf (locsymbol, ":%s%s", MMIX_LOC_SECTION_START_SYMBOL_PREFIX, ".text"); symbolP - = symbol_new (locsymbol, absolute_section, lowest_text_loc, - &zero_address_frag); + = symbol_new (locsymbol, absolute_section, &zero_address_frag, + lowest_text_loc); S_SET_EXTERNAL (symbolP); } @@ -3536,8 +3536,8 @@ mmix_md_end (void) sprintf (locsymbol, ":%s%s", MMIX_LOC_SECTION_START_SYMBOL_PREFIX, ".data"); symbolP - = symbol_new (locsymbol, absolute_section, lowest_data_loc, - &zero_address_frag); + = symbol_new (locsymbol, absolute_section, &zero_address_frag, + lowest_data_loc); S_SET_EXTERNAL (symbolP); } @@ -3845,9 +3845,8 @@ mmix_parse_predefined_name (char *name, expressionS *expP) script. */ symp = symbol_find (name); if (symp == NULL) - symp = symbol_new (name, text_section, - 0x10 * (handler_charp + 1 - handler_chars), - &zero_address_frag); + symp = symbol_new (name, text_section, &zero_address_frag, + 0x10 * (handler_charp + 1 - handler_chars)); } else { @@ -3906,8 +3905,8 @@ mmix_parse_predefined_name (char *name, expressionS *expP) { symbol_table_insert (symbol_new (predefined_abs_syms[i].name, absolute_section, - predefined_abs_syms[i].val, - &zero_address_frag)); + &zero_address_frag, + predefined_abs_syms[i].val)); /* Let gas find the symbol we just created, through its ordinary lookup. */ diff --git a/gas/config/tc-mn10200.c b/gas/config/tc-mn10200.c index 6ce1c59..19cfc39 100644 --- a/gas/config/tc-mn10200.c +++ b/gas/config/tc-mn10200.c @@ -382,7 +382,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, /* Create a fixup for the reversed conditional branch. */ sprintf (buf, ".%s_%ld", FAKE_LABEL_NAME, label_count++); fix_new (fragP, fragP->fr_fix + 1, 1, - symbol_new (buf, sec, 0, fragP->fr_next), + symbol_new (buf, sec, fragP->fr_next, 0), fragP->fr_offset, 1, BFD_RELOC_8_PCREL); /* Now create the unconditional branch + fixup to the @@ -439,7 +439,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, /* Create a fixup for the reversed conditional branch. */ sprintf (buf, ".%s_%ld", FAKE_LABEL_NAME, label_count++); fix_new (fragP, fragP->fr_fix + 1, 1, - symbol_new (buf, sec, 0, fragP->fr_next), + symbol_new (buf, sec, fragP->fr_next, 0), fragP->fr_offset, 1, BFD_RELOC_8_PCREL); /* Now create the unconditional branch + fixup to the @@ -528,7 +528,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, /* Create a fixup for the reversed conditional branch. */ sprintf (buf, ".%s_%ld", FAKE_LABEL_NAME, label_count++); fix_new (fragP, fragP->fr_fix + 2, 1, - symbol_new (buf, sec, 0, fragP->fr_next), + symbol_new (buf, sec, fragP->fr_next, 0), fragP->fr_offset, 1, BFD_RELOC_8_PCREL); /* Now create the unconditional branch + fixup to the @@ -609,7 +609,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, /* Create a fixup for the reversed conditional branch. */ sprintf (buf, ".%s_%ld", FAKE_LABEL_NAME, label_count++); fix_new (fragP, fragP->fr_fix + 2, 1, - symbol_new (buf, sec, 0, fragP->fr_next), + symbol_new (buf, sec, fragP->fr_next, 0), fragP->fr_offset, 1, BFD_RELOC_8_PCREL); /* Now create the unconditional branch + fixup to the diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c index bcd76cc..ae5ad9d 100644 --- a/gas/config/tc-mn10300.c +++ b/gas/config/tc-mn10300.c @@ -520,7 +520,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, /* Create a fixup for the reversed conditional branch. */ sprintf (buf, ".%s_%ld", FAKE_LABEL_NAME, label_count++); fix_new (fragP, fragP->fr_fix + 1, 1, - symbol_new (buf, sec, 0, fragP->fr_next), + symbol_new (buf, sec, fragP->fr_next, 0), fragP->fr_offset + 1, 1, BFD_RELOC_8_PCREL); /* Now create the unconditional branch + fixup to the @@ -577,7 +577,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, /* Create a fixup for the reversed conditional branch. */ sprintf (buf, ".%s_%ld", FAKE_LABEL_NAME, label_count++); fix_new (fragP, fragP->fr_fix + 1, 1, - symbol_new (buf, sec, 0, fragP->fr_next), + symbol_new (buf, sec, fragP->fr_next, 0), fragP->fr_offset + 1, 1, BFD_RELOC_8_PCREL); /* Now create the unconditional branch + fixup to the @@ -623,7 +623,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, /* Create a fixup for the reversed conditional branch. */ sprintf (buf, ".%s_%ld", FAKE_LABEL_NAME, label_count++); fix_new (fragP, fragP->fr_fix + 2, 1, - symbol_new (buf, sec, 0, fragP->fr_next), + symbol_new (buf, sec, fragP->fr_next, 0), fragP->fr_offset + 2, 1, BFD_RELOC_8_PCREL); /* Now create the unconditional branch + fixup to the @@ -659,7 +659,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, /* Create a fixup for the reversed conditional branch. */ sprintf (buf, ".%s_%ld", FAKE_LABEL_NAME, label_count++); fix_new (fragP, fragP->fr_fix + 2, 1, - symbol_new (buf, sec, 0, fragP->fr_next), + symbol_new (buf, sec, fragP->fr_next, 0), fragP->fr_offset + 2, 1, BFD_RELOC_8_PCREL); /* Now create the unconditional branch + fixup to the @@ -813,7 +813,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, /* Create a fixup for the reversed conditional branch. */ sprintf (buf, ".%s_%ld", FAKE_LABEL_NAME, label_count++); fix_new (fragP, fragP->fr_fix + 2, 1, - symbol_new (buf, sec, 0, fragP->fr_next), + symbol_new (buf, sec, fragP->fr_next, 0), fragP->fr_offset + 2, 1, BFD_RELOC_8_PCREL); /* Now create the unconditional branch + fixup to the @@ -882,7 +882,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, /* Create a fixup for the reversed conditional branch. */ sprintf (buf, ".%s_%ld", FAKE_LABEL_NAME, label_count++); fix_new (fragP, fragP->fr_fix + 2, 1, - symbol_new (buf, sec, 0, fragP->fr_next), + symbol_new (buf, sec, fragP->fr_next, 0), fragP->fr_offset + 2, 1, BFD_RELOC_8_PCREL); /* Now create the unconditional branch + fixup to the diff --git a/gas/config/tc-nds32.c b/gas/config/tc-nds32.c index cda673f..900f715 100644 --- a/gas/config/tc-nds32.c +++ b/gas/config/tc-nds32.c @@ -4002,7 +4002,7 @@ make_mapping_symbol (enum mstate state, valueT value, fragS * frag, unsigned int abort (); } - symbol_p = symbol_new (symbol_name, now_seg, value, frag); + symbol_p = symbol_new (symbol_name, now_seg, frag, value); /* local scope attribute */ symbol_get_bfdsym (symbol_p)->flags |= BSF_NO_FLAGS | BSF_LOCAL; } @@ -6088,8 +6088,9 @@ nds32_elf_append_relax_relocs (const char *key, void *value) { ptr_offset = pattern_temp->where - pattern_temp->frag->fr_literal; - exp.X_add_symbol = symbol_temp_new (now_seg, ptr_offset, - pattern_temp->frag); + exp.X_add_symbol = symbol_temp_new (now_seg, + pattern_temp->frag, + ptr_offset); exp.X_add_number = 0; fixP = fix_new_exp (fragP, where - fragP->fr_literal, @@ -6186,8 +6187,9 @@ nds32_elf_append_relax_relocs (const char *key, void *value) { ptr_offset = next_pattern->where - next_pattern->frag->fr_literal; - exp.X_add_symbol = symbol_temp_new (now_seg, ptr_offset, - next_pattern->frag); + exp.X_add_symbol = symbol_temp_new (now_seg, + next_pattern->frag, + ptr_offset); exp.X_add_number = 0; fixP = fix_new_exp (fragP, where - fragP->fr_literal, fixup_size, &exp, 0, @@ -6218,8 +6220,8 @@ nds32_elf_append_relax_relocs (const char *key, void *value) ptr_offset = next_insn->where - next_insn->frag->fr_literal; exp.X_add_symbol = symbol_temp_new (now_seg, - ptr_offset, - next_insn->frag); + next_insn->frag, + ptr_offset); exp.X_add_number = 0; fixP = fix_new_exp (fragP, where - fragP->fr_literal, @@ -7191,14 +7193,14 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT sec, fragS *fragP) if ((fixup_info[i].ramp & NDS32_CREATE_LABEL) != 0) { /* This is a reverse branch. */ - exp.X_add_symbol = symbol_temp_new (sec, 0, fragP->fr_next); + exp.X_add_symbol = symbol_temp_new (sec, fragP->fr_next, 0); exp.X_add_number = 0; } else if ((fixup_info[i].ramp & NDS32_PTR) != 0) { /* This relocation has to point to another instruction. */ branch_size = fr_where + code_size - 4; - exp.X_add_symbol = symbol_temp_new (sec, branch_size, fragP); + exp.X_add_symbol = symbol_temp_new (sec, fragP, branch_size); exp.X_add_number = 0; } else if ((fixup_info[i].ramp & NDS32_ABS) != 0) diff --git a/gas/config/tc-nios2.c b/gas/config/tc-nios2.c index eb7a1a5..a8bbe5bf 100644 --- a/gas/config/tc-nios2.c +++ b/gas/config/tc-nios2.c @@ -3907,7 +3907,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED) as_bad ("GOT already in the symbol table"); GOT_symbol = symbol_new (name, undefined_section, - (valueT) 0, &zero_address_frag); + &zero_address_frag, 0); } return GOT_symbol; diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 9149e71..052f64a 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -4902,8 +4902,9 @@ ppc_function (int ignore ATTRIBUTE_UNUSED) { /* The fifth argument is the function size. */ ++input_line_pointer; - symbol_get_tc (ext_sym)->u.size = symbol_new - ("L0\001", absolute_section,(valueT) 0, &zero_address_frag); + symbol_get_tc (ext_sym)->u.size + = symbol_new ("L0\001", absolute_section, + &zero_address_frag, 0); pseudo_set (symbol_get_tc (ext_sym)->u.size); } } @@ -5877,7 +5878,7 @@ ppc_adjust_symtab (void) continue; csect = symbol_create (".abs[XO]", absolute_section, - S_GET_VALUE (sym), &zero_address_frag); + &zero_address_frag, S_GET_VALUE (sym)); symbol_get_bfdsym (csect)->value = S_GET_VALUE (sym); S_SET_STORAGE_CLASS (csect, C_HIDEXT); i = S_GET_NUMBER_AUXILIARY (csect); diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index c575c07..82b681e 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -1266,8 +1266,8 @@ check_absolute_expr (struct riscv_cl_insn *ip, expressionS *ex, static symbolS * make_internal_label (void) { - return (symbolS *) local_symbol_make (FAKE_LABEL_NAME, now_seg, - (valueT) frag_now_fix (), frag_now); + return (symbolS *) local_symbol_make (FAKE_LABEL_NAME, now_seg, frag_now, + frag_now_fix ()); } /* Load an entry from the GOT. */ diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c index 7e84212..f66e90e 100644 --- a/gas/config/tc-s390.c +++ b/gas/config/tc-s390.c @@ -2105,7 +2105,7 @@ md_undefined_symbol (char *name) if (symbol_find (name)) as_bad (_("GOT already in symbol table")); GOT_symbol = symbol_new (name, undefined_section, - (valueT) 0, &zero_address_frag); + &zero_address_frag, 0); } return GOT_symbol; } diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c index e927410..db5a7b9 100644 --- a/gas/config/tc-sh.c +++ b/gas/config/tc-sh.c @@ -1920,7 +1920,7 @@ insert_loop_bounds (char *output, sh_operand_info *operand) /* A REPEAT takes 6 bytes. The SH has a 32 bit address space. Hence a 9 digit number should be enough to count all REPEATs. */ sprintf (name, "_R%x", count++ & 0x3fffffff); - end_sym = symbol_new (name, undefined_section, 0, &zero_address_frag); + end_sym = symbol_new (name, undefined_section, &zero_address_frag, 0); /* Make this a local symbol. */ #ifdef OBJ_COFF SF_SET_LOCAL (end_sym); diff --git a/gas/config/tc-tic4x.c b/gas/config/tc-tic4x.c index 5a2673d..a6db990 100644 --- a/gas/config/tc-tic4x.c +++ b/gas/config/tc-tic4x.c @@ -621,14 +621,14 @@ tic4x_insert_reg (const char *regname, int regnum) char buf[32]; int i; - symbol_table_insert (symbol_new (regname, reg_section, (valueT) regnum, - &zero_address_frag)); + symbol_table_insert (symbol_new (regname, reg_section, + &zero_address_frag, regnum)); for (i = 0; regname[i]; i++) buf[i] = ISLOWER (regname[i]) ? TOUPPER (regname[i]) : regname[i]; buf[i] = '\0'; - symbol_table_insert (symbol_new (buf, reg_section, (valueT) regnum, - &zero_address_frag)); + symbol_table_insert (symbol_new (buf, reg_section, + &zero_address_frag, regnum)); } static void @@ -637,7 +637,7 @@ tic4x_insert_sym (const char *symname, int value) symbolS *symbolP; symbolP = symbol_new (symname, absolute_section, - (valueT) value, &zero_address_frag); + &zero_address_frag, value); SF_SET_LOCAL (symbolP); symbol_table_insert (symbolP); } diff --git a/gas/config/tc-tic54x.c b/gas/config/tc-tic54x.c index 93586b3..6412d38 100644 --- a/gas/config/tc-tic54x.c +++ b/gas/config/tc-tic54x.c @@ -416,8 +416,7 @@ tic54x_eval (int x ATTRIBUTE_UNUSED) ignore_rest_of_line (); return; } - symbolP = symbol_new (name, absolute_section, - (valueT) value, &zero_address_frag); + symbolP = symbol_new (name, absolute_section, &zero_address_frag, value); SF_SET_LOCAL (symbolP); symbol_table_insert (symbolP); @@ -556,10 +555,9 @@ stag_add_field_symbols (struct stag *stag, if (rootsym == NULL) { symbolS *sym; - sym = symbol_new (name, absolute_section, - (field->stag ? field->offset : - (valueT) (base_offset + field->offset)), - &zero_address_frag); + sym = symbol_new (name, absolute_section, &zero_address_frag, + (field->stag ? field->offset + : base_offset + field->offset)); SF_SET_LOCAL (sym); symbol_table_insert (sym); } @@ -611,8 +609,8 @@ stag_add_field (struct stag *parent, /* Only create a symbol for this field if the parent has no name. */ if (!strncmp (".fake", parent->name, 5)) { - symbolS *sym = symbol_new (name, absolute_section, - (valueT) offset, &zero_address_frag); + symbolS *sym = symbol_new (name, absolute_section, &zero_address_frag, + offset); SF_SET_LOCAL (sym); symbol_table_insert (sym); } @@ -675,16 +673,16 @@ tic54x_struct (int arg) char fake[] = ".fake_stagNNNNNNN"; sprintf (fake, ".fake_stag%d", struct_count++); current_stag->sym = symbol_new (fake, absolute_section, - (valueT) abs_section_offset, - &zero_address_frag); + &zero_address_frag, + abs_section_offset); } else { char * label = xstrdup (S_GET_NAME (line_label)); current_stag->sym = symbol_new (label, absolute_section, - (valueT) abs_section_offset, - &zero_address_frag); + &zero_address_frag, + abs_section_offset); free (label); } current_stag->name = S_GET_NAME (current_stag->sym); @@ -1459,7 +1457,7 @@ set_cpu (enum cpu_version version) if (version == V545LP || version == V546LP) { symbolS *symbolP = symbol_new ("__allow_lp", absolute_section, - (valueT) 1, &zero_address_frag); + &zero_address_frag, 1); SF_SET_LOCAL (symbolP); symbol_table_insert (symbolP); } @@ -2016,7 +2014,7 @@ tic54x_mmregs (int ignored ATTRIBUTE_UNUSED) for (sym = (tic54x_symbol *) mmregs; sym->name; sym++) { symbolS *symbolP = symbol_new (sym->name, absolute_section, - (valueT) sym->value, &zero_address_frag); + &zero_address_frag, sym->value); SF_SET_LOCAL (symbolP); symbol_table_insert (symbolP); } @@ -2070,7 +2068,7 @@ set_address_mode (int mode) if (mode == far_mode) { symbolS *symbolP = symbol_new ("__allow_far", absolute_section, - (valueT) 1, &zero_address_frag); + &zero_address_frag, 1); SF_SET_LOCAL (symbolP); symbol_table_insert (symbolP); } @@ -2176,7 +2174,7 @@ tic54x_set (int ignore ATTRIBUTE_UNUSED) if ((symbolP = symbol_find (name)) == NULL && (symbolP = md_undefined_symbol (name)) == NULL) { - symbolP = symbol_new (name, absolute_section, 0, &zero_address_frag); + symbolP = symbol_new (name, absolute_section, &zero_address_frag, 0); S_SET_STORAGE_CLASS (symbolP, C_STAT); } free (name); @@ -3010,7 +3008,7 @@ md_begin (void) { /* Add basic registers to the symbol table. */ symbolS *symbolP = symbol_new (sym->name, absolute_section, - (valueT) sym->value, &zero_address_frag); + &zero_address_frag, sym->value); SF_SET_LOCAL (symbolP); symbol_table_insert (symbolP); str_hash_insert (reg_hash, sym->name, (char *) sym); @@ -5015,18 +5013,15 @@ tic54x_undefined_symbol (char *name) (sym = (tic54x_symbol *) str_hash_find (misc_symbol_hash, name)) != NULL || (sym = (tic54x_symbol *) str_hash_find (sbit_hash, name)) != NULL) { - return symbol_new (name, reg_section, - (valueT) sym->value, - &zero_address_frag); + return symbol_new (name, reg_section, &zero_address_frag, sym->value); } if ((sym = (tic54x_symbol *) str_hash_find (reg_hash, name)) != NULL || (sym = (tic54x_symbol *) str_hash_find (mmreg_hash, name)) != NULL || !strcasecmp (name, "a") || !strcasecmp (name, "b")) { - return symbol_new (name, reg_section, - (valueT) sym ? sym->value : 0, - &zero_address_frag); + return symbol_new (name, reg_section, &zero_address_frag, + sym ? sym->value : 0); } return NULL; diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index e4a234a..82ec439 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -4193,12 +4193,12 @@ xtensa_create_literal_symbol (segT sec, fragS *frag) symbol will be in the output file. */ if (get_is_linkonce_section (stdoutput, sec)) { - symbolP = symbol_new (name, sec, 0, frag); + symbolP = symbol_new (name, sec, frag, 0); S_CLEAR_EXTERNAL (symbolP); /* symbolP->local = 1; */ } else - symbolP = symbol_new (name, sec, 0, frag); + symbolP = symbol_new (name, sec, frag, 0); xtensa_add_literal_sym (symbolP); @@ -10210,7 +10210,7 @@ init_trampoline_frag (fragS *fp) char label[10 + 2 * sizeof(fp)]; sprintf (label, ".L0_TR_%p", fp); - lsym = (symbolS *)local_symbol_make (label, now_seg, 0, fp); + lsym = (symbolS *) local_symbol_make (label, now_seg, fp, 0); fp->fr_symbol = lsym; if (fp->tc_frag_data.needs_jump_around) { @@ -10832,9 +10832,9 @@ convert_frag_immed (segT segP, target_offset += unreach->tc_frag_data.text_expansion[0]; } gas_assert (gen_label == NULL); - gen_label = symbol_new (FAKE_LABEL_NAME, now_seg, + gen_label = symbol_new (FAKE_LABEL_NAME, now_seg, fragP, fr_opcode - fragP->fr_literal - + target_offset, fragP); + + target_offset); break; case ITYPE_INSN: @@ -11137,8 +11137,7 @@ xg_promote_candidate_litpool (struct litpool_seg *lps, /* Create a local symbol pointing to the end of the pool. */ sprintf (label, ".L0_LT_%p", poolbeg); - lsym = (symbolS *)local_symbol_make (label, lps->seg, - 0, poolend); + lsym = (symbolS *) local_symbol_make (label, lps->seg, poolend, 0); poolbeg->fr_symbol = lsym; /* Rest is done in xtensa_relax_frag. */ } diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index a95c297..e4ba56d 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -546,10 +546,10 @@ dwarf2_gen_line_info (addressT ofs, struct dwarf2_line_info *loc) /* Use a non-fake name for the line number location, so that it can be referred to by relocations. */ sprintf (name, ".Loc.%u.%u", line, filenum); - sym = symbol_new (name, now_seg, ofs, frag_now); + sym = symbol_new (name, now_seg, frag_now, ofs); } else - sym = symbol_temp_new (now_seg, ofs, frag_now); + sym = symbol_temp_new (now_seg, frag_now, ofs); dwarf2_gen_line_info_1 (sym, loc); } @@ -1245,8 +1245,8 @@ dwarf2_directive_loc (int dummy ATTRIBUTE_UNUSED) sym = force_reset_view; else { - sym = symbol_temp_new (absolute_section, value, - &zero_address_frag); + sym = symbol_temp_new (absolute_section, &zero_address_frag, + value); if (force_reset) force_reset_view = sym; } @@ -1962,7 +1962,7 @@ process_entries (segT seg, struct line_entry *e) out_inc_line_addr (INT_MAX, frag_ofs - last_frag_ofs); else { - lab = symbol_temp_new (seg, frag_ofs, frag); + lab = symbol_temp_new (seg, frag, frag_ofs); relax_inc_line_addr (INT_MAX, lab, last_lab); } } @@ -2326,11 +2326,11 @@ out_debug_ranges (segT ranges_seg) symbolS *beg, *end; frag = first_frag_for_seg (s->seg); - beg = symbol_temp_new (s->seg, 0, frag); + beg = symbol_temp_new (s->seg, frag, 0); s->text_start = beg; frag = last_frag_for_seg (s->seg); - end = symbol_temp_new (s->seg, get_frag_fix (frag, s->seg), frag); + end = symbol_temp_new (s->seg, frag, get_frag_fix (frag, s->seg)); s->text_end = end; exp.X_op = O_symbol; @@ -2395,11 +2395,11 @@ out_debug_aranges (segT aranges_seg, segT info_seg) symbolS *beg, *end; frag = first_frag_for_seg (s->seg); - beg = symbol_temp_new (s->seg, 0, frag); + beg = symbol_temp_new (s->seg, frag, 0); s->text_start = beg; frag = last_frag_for_seg (s->seg); - end = symbol_temp_new (s->seg, get_frag_fix (frag, s->seg), frag); + end = symbol_temp_new (s->seg, frag, get_frag_fix (frag, s->seg)); s->text_end = end; exp.X_op = O_symbol; diff --git a/gas/ecoff.c b/gas/ecoff.c index 5ec999e..8f884bb 100644 --- a/gas/ecoff.c +++ b/gas/ecoff.c @@ -2219,8 +2219,7 @@ add_file (const char *file_name, int indx ATTRIBUTE_UNUSED, int fake) { (void) add_ecoff_symbol (file_name, st_Nil, sc_Nil, symbol_new (FAKE_LABEL_NAME, now_seg, - (valueT) frag_now_fix (), - frag_now), + frag_now, frag_now_fix ()), (bfd_vma) 0, 0, ECOFF_MARK_STAB (N_SOL)); return; } @@ -3010,8 +3009,7 @@ ecoff_directive_end (int ignore ATTRIBUTE_UNUSED) else (void) add_ecoff_symbol ((const char *) NULL, st_End, sc_Text, symbol_new (FAKE_LABEL_NAME, now_seg, - (valueT) frag_now_fix (), - frag_now), + frag_now, frag_now_fix ()), (bfd_vma) 0, (symint_t) 0, (symint_t) 0); #ifdef md_flush_pending_output @@ -3254,8 +3252,7 @@ ecoff_directive_loc (int ignore ATTRIBUTE_UNUSED) { (void) add_ecoff_symbol ((char *) NULL, st_Label, sc_Text, symbol_new (FAKE_LABEL_NAME, now_seg, - (valueT) frag_now_fix (), - frag_now), + frag_now, frag_now_fix ()), (bfd_vma) 0, 0, lineno); return; } @@ -102,7 +102,7 @@ make_expr_symbol (expressionS *expressionP) : expressionP->X_op == O_register ? reg_section : expr_section), - 0, &zero_address_frag); + &zero_address_frag, 0); symbol_set_value_expression (symbolP, expressionP); if (expressionP->X_op == O_constant) diff --git a/gas/itbl-ops.c b/gas/itbl-ops.c index e5d48e4..aa91007 100644 --- a/gas/itbl-ops.c +++ b/gas/itbl-ops.c @@ -272,7 +272,7 @@ itbl_init (void) for (e = *es; e; e = e->next) { symbol_table_insert (symbol_create (e->name, reg_section, - e->value, &zero_address_frag)); + &zero_address_frag, e->value)); } } append_insns_as_macros (); @@ -1002,8 +1002,7 @@ read_a_source_file (const char *name) else line_label = symbol_create (line_start, absolute_section, - (valueT) 0, - &zero_address_frag); + &zero_address_frag, 0); next_char = restore_line_pointer (nul_char); if (next_char == ':') diff --git a/gas/stabs.c b/gas/stabs.c index c962bb4..1ba9926 100644 --- a/gas/stabs.c +++ b/gas/stabs.c @@ -144,8 +144,7 @@ aout_process_stab (int what, const char *string, int type, int other, int desc) symbol chain. This is to avoid "continuation symbols" (where one ends in "\" and the debug info is continued in the next .stabs directive) from being separated by other random symbols. */ - symbol = symbol_create (string, undefined_section, 0, - &zero_address_frag); + symbol = symbol_create (string, undefined_section, &zero_address_frag, 0); if (what == 's' || what == 'n') { /* Pick up the value from the input line. */ @@ -378,7 +377,7 @@ s_stab_generic (int what, expressionS exp; /* Arrange for a value representing the current location. */ - symbol = symbol_temp_new (saved_seg, dot, saved_frag); + symbol = symbol_temp_new (saved_seg, saved_frag, dot); exp.X_op = O_symbol; exp.X_add_symbol = symbol; diff --git a/gas/subsegs.c b/gas/subsegs.c index 1b72948..e07cef0 100644 --- a/gas/subsegs.c +++ b/gas/subsegs.c @@ -222,7 +222,7 @@ section_symbol (segT sec) if (! EMIT_SECTION_SYMBOLS || symbol_table_frozen) { /* Here we know it won't be going into the symbol table. */ - s = symbol_create (sec->symbol->name, sec, 0, &zero_address_frag); + s = symbol_create (sec->symbol->name, sec, &zero_address_frag, 0); } else { @@ -233,7 +233,7 @@ section_symbol (segT sec) if (s == NULL || ((seg = S_GET_SEGMENT (s)) != sec && seg != undefined_section)) - s = symbol_new (sec->symbol->name, sec, 0, &zero_address_frag); + s = symbol_new (sec->symbol->name, sec, &zero_address_frag, 0); else if (seg == undefined_section) { S_SET_SEGMENT (s, sec); 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) { diff --git a/gas/symbols.h b/gas/symbols.h index dafd677..9c9f7c6 100644 --- a/gas/symbols.h +++ b/gas/symbols.h @@ -45,17 +45,14 @@ symbolS *symbol_find_exact (const char *name); symbolS *symbol_find_exact_noref (const char *name, int noref); symbolS *symbol_find_or_make (const char *name); symbolS *symbol_make (const char *name); -symbolS *symbol_new (const char *name, segT segment, valueT value, - fragS * frag); -symbolS *symbol_create (const char *name, segT segment, valueT value, - fragS * frag); -struct local_symbol *local_symbol_make (const char *name, segT section, - valueT val, fragS *frag); +symbolS *symbol_new (const char *, segT, fragS *, valueT); +symbolS *symbol_create (const char *, segT, fragS *, valueT); +struct local_symbol *local_symbol_make (const char *, segT, fragS *, valueT); symbolS *symbol_clone (symbolS *, int); #undef symbol_clone_if_forward_ref symbolS *symbol_clone_if_forward_ref (symbolS *, int); #define symbol_clone_if_forward_ref(s) symbol_clone_if_forward_ref (s, 0) -symbolS *symbol_temp_new (segT, valueT, fragS *); +symbolS *symbol_temp_new (segT, fragS *, valueT); symbolS *symbol_temp_new_now (void); symbolS *symbol_temp_new_now_octets (void); symbolS *symbol_temp_make (void); |