Make asection->id and asection->index unsigned

These int vars are really unsigned, so make them so.

	* section.c (struct bfd_section): Make "id" and "index" unsigned.
	* coff-rs6000.c (_bfd_xcoff_sizeof_headers): Adjust local var to suit.
	* elf.c (elf_map_symbols): Likewise.
	* elf64-ppc.c (sym_exists_at): Make "id" param unsigned.
	(struct ppc_link_hash_table): Make "top_id" and "top_index" unsigned.
	(ppc64_elf_setup_section_lists): Ditto for local vars.
	* elf32-arm.c: Similarly to elf64-ppc.c.
	* elf32-avr.c: Likewise.
	* elf32-hppa.c: Likewise.
	* elf32-m68hc1x.c: Likewise.
	* elf32-metag.c: Likewise.
	* elf32-nios2.c: Likewise.
	* elfnn-aarch64.c: Likewise.
	* simple.c (struct saved_offsets): Make "section_count" unsigned.
	* bfd-in2.h: Regenerate.
This commit is contained in:
Alan Modra 2015-08-31 08:32:29 +09:30
parent 56e3225bfb
commit 7292b3ac74
14 changed files with 46 additions and 28 deletions

View File

@ -1,3 +1,21 @@
2015-08-31 Alan Modra <amodra@gmail.com>
* section.c (struct bfd_section): Make "id" and "index" unsigned.
* coff-rs6000.c (_bfd_xcoff_sizeof_headers): Adjust local var to suit.
* elf.c (elf_map_symbols): Likewise.
* elf64-ppc.c (sym_exists_at): Make "id" param unsigned.
(struct ppc_link_hash_table): Make "top_id" and "top_index" unsigned.
(ppc64_elf_setup_section_lists): Ditto for local vars.
* elf32-arm.c: Similarly to elf64-ppc.c.
* elf32-avr.c: Likewise.
* elf32-hppa.c: Likewise.
* elf32-m68hc1x.c: Likewise.
* elf32-metag.c: Likewise.
* elf32-nios2.c: Likewise.
* elfnn-aarch64.c: Likewise.
* simple.c (struct saved_offsets): Make "section_count" unsigned.
* bfd-in2.h: Regenerate.
2015-08-27 Alan Modra <amodra@gmail.com>
PR 18867

View File

@ -1209,10 +1209,10 @@ typedef struct bfd_section
const char *name;
/* A unique sequence number. */
int id;
unsigned int id;
/* Which section in the bfd; 0..n-1 as sections are created in a bfd. */
int index;
unsigned int index;
/* The next section in the list belonging to the BFD, or NULL. */
struct bfd_section *next;

View File

@ -2556,7 +2556,7 @@ _bfd_xcoff_sizeof_headers (bfd *abfd,
};
struct nbr_reloc_lineno *n_rl;
bfd *sub;
int max_index;
unsigned int max_index;
asection *s;
/* Although the number of sections is known, the maximum value of

View File

@ -3664,7 +3664,7 @@ elf_map_symbols (bfd *abfd, unsigned int *pnum_locals)
unsigned int num_globals = 0;
unsigned int num_locals2 = 0;
unsigned int num_globals2 = 0;
int max_index = 0;
unsigned int max_index = 0;
unsigned int idx;
asection *asect;
asymbol **new_syms;

View File

@ -3061,11 +3061,11 @@ struct elf32_arm_link_hash_table
struct map_stub *stub_group;
/* Number of elements in stub_group. */
int top_id;
unsigned int top_id;
/* Assorted information used by elf32_arm_size_stubs. */
unsigned int bfd_count;
int top_index;
unsigned int top_index;
asection **input_list;
};
@ -4432,7 +4432,7 @@ elf32_arm_setup_section_lists (bfd *output_bfd,
{
bfd *input_bfd;
unsigned int bfd_count;
int top_id, top_index;
unsigned int top_id, top_index;
asection *section;
asection **input_list, **list;
bfd_size_type amt;
@ -11137,7 +11137,7 @@ elf32_arm_final_link (bfd *abfd, struct bfd_link_info *info)
/* Process stub sections (eg BE8 encoding, ...). */
struct elf32_arm_link_hash_table *htab = elf32_arm_hash_table (info);
int i;
unsigned int i;
for (i=0; i<htab->top_id; i++)
{
sec = htab->stub_group[i].stub_sec;

View File

@ -89,7 +89,7 @@ struct elf32_avr_link_hash_table
/* Assorted information used by elf32_avr_size_stubs. */
unsigned int bfd_count;
int top_index;
unsigned int top_index;
asection ** input_list;
Elf_Internal_Sym ** all_local_syms;
@ -3365,7 +3365,7 @@ elf32_avr_setup_section_lists (bfd *output_bfd,
{
bfd *input_bfd;
unsigned int bfd_count;
int top_id, top_index;
unsigned int top_id, top_index;
asection *section;
asection **input_list, **list;
bfd_size_type amt;

View File

@ -270,7 +270,7 @@ struct elf32_hppa_link_hash_table
/* Assorted information used by elf32_hppa_size_stubs. */
unsigned int bfd_count;
int top_index;
unsigned int top_index;
asection **input_list;
Elf_Internal_Sym **all_local_syms;
@ -2495,7 +2495,7 @@ elf32_hppa_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info)
{
bfd *input_bfd;
unsigned int bfd_count;
int top_id, top_index;
unsigned int top_id, top_index;
asection *section;
asection **input_list, **list;
bfd_size_type amt;

View File

@ -237,7 +237,7 @@ elf32_m68hc11_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info)
{
bfd *input_bfd;
unsigned int bfd_count;
int top_id, top_index;
unsigned int top_id, top_index;
asection *section;
asection **input_list, **list;
bfd_size_type amt;

View File

@ -838,7 +838,7 @@ struct elf_metag_link_hash_table
/* Assorted information used by elf_metag_size_stubs. */
unsigned int bfd_count;
int top_index;
unsigned int top_index;
asection **input_list;
Elf_Internal_Sym **all_local_syms;
@ -3729,7 +3729,7 @@ elf_metag_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info)
{
bfd *input_bfd;
unsigned int bfd_count;
int top_id, top_index;
unsigned int top_id, top_index;
asection *section;
asection **input_list, **list;
bfd_size_type amt;

View File

@ -1815,7 +1815,7 @@ struct elf32_nios2_link_hash_table
/* Assorted information used by nios2_elf32_size_stubs. */
unsigned int bfd_count;
int top_index;
unsigned int top_index;
asection **input_list;
Elf_Internal_Sym **all_local_syms;
@ -2245,7 +2245,7 @@ nios2_elf32_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info)
{
bfd *input_bfd;
unsigned int bfd_count;
int top_id, top_index;
unsigned int top_id, top_index;
asection *section;
asection **input_list, **list;
bfd_size_type amt;

View File

@ -3101,11 +3101,11 @@ compare_symbols (const void *ap, const void *bp)
/* Search SYMS for a symbol of the given VALUE. */
static asymbol *
sym_exists_at (asymbol **syms, long lo, long hi, int id, bfd_vma value)
sym_exists_at (asymbol **syms, long lo, long hi, unsigned int id, bfd_vma value)
{
long mid;
if (id == -1)
if (id == (unsigned) -1)
{
while (lo < hi)
{
@ -3942,10 +3942,10 @@ struct ppc_link_hash_table
asection *toc_first_sec;
/* Highest input section id. */
int top_id;
unsigned int top_id;
/* Highest output section index. */
int top_index;
unsigned int top_index;
/* Used when adding symbols. */
struct ppc_link_hash_entry *dot_syms;
@ -11163,7 +11163,7 @@ int
ppc64_elf_setup_section_lists (struct bfd_link_info *info)
{
bfd *input_bfd;
int top_id, top_index, id;
unsigned int top_id, top_index, id;
asection *section;
asection **input_list;
bfd_size_type amt;

View File

@ -2260,7 +2260,7 @@ struct elf_aarch64_link_hash_table
/* Assorted information used by elfNN_aarch64_size_stubs. */
unsigned int bfd_count;
int top_index;
unsigned int top_index;
asection **input_list;
/* The offset into splt of the PLT entry for the TLS descriptor
@ -2985,7 +2985,7 @@ elfNN_aarch64_setup_section_lists (bfd *output_bfd,
{
bfd *input_bfd;
unsigned int bfd_count;
int top_id, top_index;
unsigned int top_id, top_index;
asection *section;
asection **input_list, **list;
bfd_size_type amt;

View File

@ -155,10 +155,10 @@ CODE_FRAGMENT
. const char *name;
.
. {* A unique sequence number. *}
. int id;
. unsigned int id;
.
. {* Which section in the bfd; 0..n-1 as sections are created in a bfd. *}
. int index;
. unsigned int index;
.
. {* The next section in the list belonging to the BFD, or NULL. *}
. struct bfd_section *next;
@ -826,7 +826,7 @@ _bfd_generic_new_section_hook (bfd *abfd, asection *newsect)
static asection *
bfd_section_init (bfd *abfd, asection *newsect)
{
static int section_id = 0x10; /* id 0 to 3 used by STD_SECTION. */
static unsigned int section_id = 0x10; /* id 0 to 3 used by STD_SECTION. */
newsect->id = section_id;
newsect->index = abfd->section_count;

View File

@ -102,7 +102,7 @@ struct saved_output_info
struct saved_offsets
{
int section_count;
unsigned int section_count;
struct saved_output_info *sections;
};