aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@imgtec.com>2017-02-02 21:30:27 +0000
committerMaciej W. Rozycki <macro@imgtec.com>2017-02-02 22:35:29 +0000
commit0f8c4b60ef3953a2373992e468106ae833049fff (patch)
treeab54b0d1ee7519dd46339e2c92a37227722eb886 /bfd
parent17a80fa80adbe79df39ba1fc70e611dff92df197 (diff)
downloadgdb-0f8c4b60ef3953a2373992e468106ae833049fff.zip
gdb-0f8c4b60ef3953a2373992e468106ae833049fff.tar.gz
gdb-0f8c4b60ef3953a2373992e468106ae833049fff.tar.bz2
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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elfxx-mips.c14
2 files changed, 10 insertions, 9 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index fca45ac..ffb467c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
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>
+
* elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
non-NULL `htab' to the beginning.
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index d1c0f80..eec10b4 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -3835,7 +3835,7 @@ mips_elf_sort_hash_table (bfd *abfd, struct bfd_link_info *info)
htab = mips_elf_hash_table (info);
BFD_ASSERT (htab != NULL);
- if (elf_hash_table (info)->dynsymcount == 0)
+ if (htab->root.dynsymcount == 0)
return TRUE;
g = htab->got_info;
@@ -3845,20 +3845,16 @@ mips_elf_sort_hash_table (bfd *abfd, struct bfd_link_info *info)
hsd.low = NULL;
hsd.max_unref_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;
- mips_elf_link_hash_traverse (((struct mips_elf_link_hash_table *)
- elf_hash_table (info)),
- mips_elf_sort_hash_table_f,
- &hsd);
+ mips_elf_link_hash_traverse (htab, mips_elf_sort_hash_table_f, &hsd);
/* There should have been enough room in the symbol table to
accommodate both the GOT and non-GOT symbols. */
BFD_ASSERT (hsd.max_non_got_dynindx <= hsd.min_got_dynindx);
BFD_ASSERT ((unsigned long) hsd.max_unref_got_dynindx
- == elf_hash_table (info)->dynsymcount);
- BFD_ASSERT (elf_hash_table (info)->dynsymcount - hsd.min_got_dynindx
- == g->global_gotno);
+ == htab->root.dynsymcount);
+ BFD_ASSERT (htab->root.dynsymcount - hsd.min_got_dynindx == g->global_gotno);
/* Now we know which dynamic symbol has the lowest dynamic symbol
table index in the GOT. */