This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb/binutils-2_28-branch] MIPS/BFD: Use `bfd_size_type' for dynamic symbol table indices
- From: Maciej W.Rozycki <macro at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 13 Feb 2017 14:32:29 -0000
- Subject: [binutils-gdb/binutils-2_28-branch] MIPS/BFD: Use `bfd_size_type' for dynamic symbol table indices
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0e3f75f5e8cd41680a9ca1931a3cfa013ec914b5
commit 0e3f75f5e8cd41680a9ca1931a3cfa013ec914b5
Author: Maciej W. Rozycki <macro@imgtec.com>
Date: Thu Feb 2 21:43:26 2017 +0000
MIPS/BFD: Use `bfd_size_type' for dynamic symbol table indices
Use the `bfd_size_type' data type for dynamic symbol table indices in
the MIPS backend, in line with generic code and removing the need to use
a cast.
bfd/
* elfxx-mips.c (mips_elf_hash_sort_data): Convert the
`min_got_dynindx', `max_unref_got_dynindx' and
`max_non_got_dynindx' members to the `bfd_size_type' data type.
(mips_elf_sort_hash_table): Adjust accordingly.
(cherry picked from commit 55f8b9d243dbd879ffa585f7e0c7d8b6b819302d)
Diff:
---
bfd/ChangeLog | 7 +++++++
bfd/elfxx-mips.c | 9 ++++-----
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 39b1295..3f972d2 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,12 @@
2017-02-13 Maciej W. Rozycki <macro@imgtec.com>
+ * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
+ `min_got_dynindx', `max_unref_got_dynindx' and
+ `max_non_got_dynindx' members to the `bfd_size_type' data type.
+ (mips_elf_sort_hash_table): Adjust accordingly.
+
+2017-02-13 Maciej W. Rozycki <macro@imgtec.com>
+
* elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
to access the hash table.
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index eec10b4..1b93a95 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -310,14 +310,14 @@ struct mips_elf_hash_sort_data
struct elf_link_hash_entry *low;
/* The least dynamic symbol table index corresponding to a non-TLS
symbol with a GOT entry. */
- long min_got_dynindx;
+ bfd_size_type min_got_dynindx;
/* The greatest dynamic symbol table index corresponding to a symbol
with a GOT entry that is not referenced (e.g., a dynamic symbol
with dynamic relocations pointing to it from non-primary GOTs). */
- long max_unref_got_dynindx;
+ bfd_size_type max_unref_got_dynindx;
/* The greatest dynamic symbol table index not corresponding to a
symbol without a GOT entry. */
- long max_non_got_dynindx;
+ bfd_size_type max_non_got_dynindx;
};
/* We make up to two PLT entries if needed, one for standard MIPS code
@@ -3852,8 +3852,7 @@ mips_elf_sort_hash_table (bfd *abfd, struct bfd_link_info *info)
/* 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
- == htab->root.dynsymcount);
+ BFD_ASSERT (hsd.max_unref_got_dynindx == 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