mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-26 19:36:58 +08:00
MIPS/BFD: Streamline hash table references in `mips_elf_sort_hash_table'
Make all hash table references throughout `mips_elf_sort_hash_table' use `htab', simplifying code and improving readability. bfd/ * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout to access the hash table.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
|
||||||
|
|
||||||
|
* elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
|
||||||
|
to access the hash table.
|
||||||
|
|
||||||
2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
|
2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
|
||||||
|
|
||||||
* elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
|
* elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
|
||||||
|
@ -3835,7 +3835,7 @@ mips_elf_sort_hash_table (bfd *abfd, struct bfd_link_info *info)
|
|||||||
htab = mips_elf_hash_table (info);
|
htab = mips_elf_hash_table (info);
|
||||||
BFD_ASSERT (htab != NULL);
|
BFD_ASSERT (htab != NULL);
|
||||||
|
|
||||||
if (elf_hash_table (info)->dynsymcount == 0)
|
if (htab->root.dynsymcount == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
g = htab->got_info;
|
g = htab->got_info;
|
||||||
@ -3845,20 +3845,16 @@ mips_elf_sort_hash_table (bfd *abfd, struct bfd_link_info *info)
|
|||||||
hsd.low = NULL;
|
hsd.low = NULL;
|
||||||
hsd.max_unref_got_dynindx
|
hsd.max_unref_got_dynindx
|
||||||
= hsd.min_got_dynindx
|
= hsd.min_got_dynindx
|
||||||
= (elf_hash_table (info)->dynsymcount - g->reloc_only_gotno);
|
= (htab->root.dynsymcount - g->reloc_only_gotno);
|
||||||
hsd.max_non_got_dynindx = count_section_dynsyms (abfd, info) + 1;
|
hsd.max_non_got_dynindx = count_section_dynsyms (abfd, info) + 1;
|
||||||
mips_elf_link_hash_traverse (((struct mips_elf_link_hash_table *)
|
mips_elf_link_hash_traverse (htab, mips_elf_sort_hash_table_f, &hsd);
|
||||||
elf_hash_table (info)),
|
|
||||||
mips_elf_sort_hash_table_f,
|
|
||||||
&hsd);
|
|
||||||
|
|
||||||
/* There should have been enough room in the symbol table to
|
/* There should have been enough room in the symbol table to
|
||||||
accommodate both the GOT and non-GOT symbols. */
|
accommodate both the GOT and non-GOT symbols. */
|
||||||
BFD_ASSERT (hsd.max_non_got_dynindx <= hsd.min_got_dynindx);
|
BFD_ASSERT (hsd.max_non_got_dynindx <= hsd.min_got_dynindx);
|
||||||
BFD_ASSERT ((unsigned long) hsd.max_unref_got_dynindx
|
BFD_ASSERT ((unsigned long) hsd.max_unref_got_dynindx
|
||||||
== elf_hash_table (info)->dynsymcount);
|
== htab->root.dynsymcount);
|
||||||
BFD_ASSERT (elf_hash_table (info)->dynsymcount - hsd.min_got_dynindx
|
BFD_ASSERT (htab->root.dynsymcount - hsd.min_got_dynindx == g->global_gotno);
|
||||||
== g->global_gotno);
|
|
||||||
|
|
||||||
/* Now we know which dynamic symbol has the lowest dynamic symbol
|
/* Now we know which dynamic symbol has the lowest dynamic symbol
|
||||||
table index in the GOT. */
|
table index in the GOT. */
|
||||||
|
Reference in New Issue
Block a user