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:
parent
56e3225bfb
commit
7292b3ac74
|
@ -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>
|
2015-08-27 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
PR 18867
|
PR 18867
|
||||||
|
|
|
@ -1209,10 +1209,10 @@ typedef struct bfd_section
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
/* A unique sequence number. */
|
/* A unique sequence number. */
|
||||||
int id;
|
unsigned int id;
|
||||||
|
|
||||||
/* Which section in the bfd; 0..n-1 as sections are created in a bfd. */
|
/* 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. */
|
/* The next section in the list belonging to the BFD, or NULL. */
|
||||||
struct bfd_section *next;
|
struct bfd_section *next;
|
||||||
|
|
|
@ -2556,7 +2556,7 @@ _bfd_xcoff_sizeof_headers (bfd *abfd,
|
||||||
};
|
};
|
||||||
struct nbr_reloc_lineno *n_rl;
|
struct nbr_reloc_lineno *n_rl;
|
||||||
bfd *sub;
|
bfd *sub;
|
||||||
int max_index;
|
unsigned int max_index;
|
||||||
asection *s;
|
asection *s;
|
||||||
|
|
||||||
/* Although the number of sections is known, the maximum value of
|
/* Although the number of sections is known, the maximum value of
|
||||||
|
|
|
@ -3664,7 +3664,7 @@ elf_map_symbols (bfd *abfd, unsigned int *pnum_locals)
|
||||||
unsigned int num_globals = 0;
|
unsigned int num_globals = 0;
|
||||||
unsigned int num_locals2 = 0;
|
unsigned int num_locals2 = 0;
|
||||||
unsigned int num_globals2 = 0;
|
unsigned int num_globals2 = 0;
|
||||||
int max_index = 0;
|
unsigned int max_index = 0;
|
||||||
unsigned int idx;
|
unsigned int idx;
|
||||||
asection *asect;
|
asection *asect;
|
||||||
asymbol **new_syms;
|
asymbol **new_syms;
|
||||||
|
|
|
@ -3061,11 +3061,11 @@ struct elf32_arm_link_hash_table
|
||||||
struct map_stub *stub_group;
|
struct map_stub *stub_group;
|
||||||
|
|
||||||
/* Number of elements in stub_group. */
|
/* Number of elements in stub_group. */
|
||||||
int top_id;
|
unsigned int top_id;
|
||||||
|
|
||||||
/* Assorted information used by elf32_arm_size_stubs. */
|
/* Assorted information used by elf32_arm_size_stubs. */
|
||||||
unsigned int bfd_count;
|
unsigned int bfd_count;
|
||||||
int top_index;
|
unsigned int top_index;
|
||||||
asection **input_list;
|
asection **input_list;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4432,7 +4432,7 @@ elf32_arm_setup_section_lists (bfd *output_bfd,
|
||||||
{
|
{
|
||||||
bfd *input_bfd;
|
bfd *input_bfd;
|
||||||
unsigned int bfd_count;
|
unsigned int bfd_count;
|
||||||
int top_id, top_index;
|
unsigned int top_id, top_index;
|
||||||
asection *section;
|
asection *section;
|
||||||
asection **input_list, **list;
|
asection **input_list, **list;
|
||||||
bfd_size_type amt;
|
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, ...). */
|
/* Process stub sections (eg BE8 encoding, ...). */
|
||||||
struct elf32_arm_link_hash_table *htab = elf32_arm_hash_table (info);
|
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++)
|
for (i=0; i<htab->top_id; i++)
|
||||||
{
|
{
|
||||||
sec = htab->stub_group[i].stub_sec;
|
sec = htab->stub_group[i].stub_sec;
|
||||||
|
|
|
@ -89,7 +89,7 @@ struct elf32_avr_link_hash_table
|
||||||
|
|
||||||
/* Assorted information used by elf32_avr_size_stubs. */
|
/* Assorted information used by elf32_avr_size_stubs. */
|
||||||
unsigned int bfd_count;
|
unsigned int bfd_count;
|
||||||
int top_index;
|
unsigned int top_index;
|
||||||
asection ** input_list;
|
asection ** input_list;
|
||||||
Elf_Internal_Sym ** all_local_syms;
|
Elf_Internal_Sym ** all_local_syms;
|
||||||
|
|
||||||
|
@ -3365,7 +3365,7 @@ elf32_avr_setup_section_lists (bfd *output_bfd,
|
||||||
{
|
{
|
||||||
bfd *input_bfd;
|
bfd *input_bfd;
|
||||||
unsigned int bfd_count;
|
unsigned int bfd_count;
|
||||||
int top_id, top_index;
|
unsigned int top_id, top_index;
|
||||||
asection *section;
|
asection *section;
|
||||||
asection **input_list, **list;
|
asection **input_list, **list;
|
||||||
bfd_size_type amt;
|
bfd_size_type amt;
|
||||||
|
|
|
@ -270,7 +270,7 @@ struct elf32_hppa_link_hash_table
|
||||||
|
|
||||||
/* Assorted information used by elf32_hppa_size_stubs. */
|
/* Assorted information used by elf32_hppa_size_stubs. */
|
||||||
unsigned int bfd_count;
|
unsigned int bfd_count;
|
||||||
int top_index;
|
unsigned int top_index;
|
||||||
asection **input_list;
|
asection **input_list;
|
||||||
Elf_Internal_Sym **all_local_syms;
|
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;
|
bfd *input_bfd;
|
||||||
unsigned int bfd_count;
|
unsigned int bfd_count;
|
||||||
int top_id, top_index;
|
unsigned int top_id, top_index;
|
||||||
asection *section;
|
asection *section;
|
||||||
asection **input_list, **list;
|
asection **input_list, **list;
|
||||||
bfd_size_type amt;
|
bfd_size_type amt;
|
||||||
|
|
|
@ -237,7 +237,7 @@ elf32_m68hc11_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info)
|
||||||
{
|
{
|
||||||
bfd *input_bfd;
|
bfd *input_bfd;
|
||||||
unsigned int bfd_count;
|
unsigned int bfd_count;
|
||||||
int top_id, top_index;
|
unsigned int top_id, top_index;
|
||||||
asection *section;
|
asection *section;
|
||||||
asection **input_list, **list;
|
asection **input_list, **list;
|
||||||
bfd_size_type amt;
|
bfd_size_type amt;
|
||||||
|
|
|
@ -838,7 +838,7 @@ struct elf_metag_link_hash_table
|
||||||
|
|
||||||
/* Assorted information used by elf_metag_size_stubs. */
|
/* Assorted information used by elf_metag_size_stubs. */
|
||||||
unsigned int bfd_count;
|
unsigned int bfd_count;
|
||||||
int top_index;
|
unsigned int top_index;
|
||||||
asection **input_list;
|
asection **input_list;
|
||||||
Elf_Internal_Sym **all_local_syms;
|
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;
|
bfd *input_bfd;
|
||||||
unsigned int bfd_count;
|
unsigned int bfd_count;
|
||||||
int top_id, top_index;
|
unsigned int top_id, top_index;
|
||||||
asection *section;
|
asection *section;
|
||||||
asection **input_list, **list;
|
asection **input_list, **list;
|
||||||
bfd_size_type amt;
|
bfd_size_type amt;
|
||||||
|
|
|
@ -1815,7 +1815,7 @@ struct elf32_nios2_link_hash_table
|
||||||
|
|
||||||
/* Assorted information used by nios2_elf32_size_stubs. */
|
/* Assorted information used by nios2_elf32_size_stubs. */
|
||||||
unsigned int bfd_count;
|
unsigned int bfd_count;
|
||||||
int top_index;
|
unsigned int top_index;
|
||||||
asection **input_list;
|
asection **input_list;
|
||||||
Elf_Internal_Sym **all_local_syms;
|
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;
|
bfd *input_bfd;
|
||||||
unsigned int bfd_count;
|
unsigned int bfd_count;
|
||||||
int top_id, top_index;
|
unsigned int top_id, top_index;
|
||||||
asection *section;
|
asection *section;
|
||||||
asection **input_list, **list;
|
asection **input_list, **list;
|
||||||
bfd_size_type amt;
|
bfd_size_type amt;
|
||||||
|
|
|
@ -3101,11 +3101,11 @@ compare_symbols (const void *ap, const void *bp)
|
||||||
/* Search SYMS for a symbol of the given VALUE. */
|
/* Search SYMS for a symbol of the given VALUE. */
|
||||||
|
|
||||||
static asymbol *
|
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;
|
long mid;
|
||||||
|
|
||||||
if (id == -1)
|
if (id == (unsigned) -1)
|
||||||
{
|
{
|
||||||
while (lo < hi)
|
while (lo < hi)
|
||||||
{
|
{
|
||||||
|
@ -3942,10 +3942,10 @@ struct ppc_link_hash_table
|
||||||
asection *toc_first_sec;
|
asection *toc_first_sec;
|
||||||
|
|
||||||
/* Highest input section id. */
|
/* Highest input section id. */
|
||||||
int top_id;
|
unsigned int top_id;
|
||||||
|
|
||||||
/* Highest output section index. */
|
/* Highest output section index. */
|
||||||
int top_index;
|
unsigned int top_index;
|
||||||
|
|
||||||
/* Used when adding symbols. */
|
/* Used when adding symbols. */
|
||||||
struct ppc_link_hash_entry *dot_syms;
|
struct ppc_link_hash_entry *dot_syms;
|
||||||
|
@ -11163,7 +11163,7 @@ int
|
||||||
ppc64_elf_setup_section_lists (struct bfd_link_info *info)
|
ppc64_elf_setup_section_lists (struct bfd_link_info *info)
|
||||||
{
|
{
|
||||||
bfd *input_bfd;
|
bfd *input_bfd;
|
||||||
int top_id, top_index, id;
|
unsigned int top_id, top_index, id;
|
||||||
asection *section;
|
asection *section;
|
||||||
asection **input_list;
|
asection **input_list;
|
||||||
bfd_size_type amt;
|
bfd_size_type amt;
|
||||||
|
|
|
@ -2260,7 +2260,7 @@ struct elf_aarch64_link_hash_table
|
||||||
|
|
||||||
/* Assorted information used by elfNN_aarch64_size_stubs. */
|
/* Assorted information used by elfNN_aarch64_size_stubs. */
|
||||||
unsigned int bfd_count;
|
unsigned int bfd_count;
|
||||||
int top_index;
|
unsigned int top_index;
|
||||||
asection **input_list;
|
asection **input_list;
|
||||||
|
|
||||||
/* The offset into splt of the PLT entry for the TLS descriptor
|
/* 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;
|
bfd *input_bfd;
|
||||||
unsigned int bfd_count;
|
unsigned int bfd_count;
|
||||||
int top_id, top_index;
|
unsigned int top_id, top_index;
|
||||||
asection *section;
|
asection *section;
|
||||||
asection **input_list, **list;
|
asection **input_list, **list;
|
||||||
bfd_size_type amt;
|
bfd_size_type amt;
|
||||||
|
|
|
@ -155,10 +155,10 @@ CODE_FRAGMENT
|
||||||
. const char *name;
|
. const char *name;
|
||||||
.
|
.
|
||||||
. {* A unique sequence number. *}
|
. {* A unique sequence number. *}
|
||||||
. int id;
|
. unsigned int id;
|
||||||
.
|
.
|
||||||
. {* Which section in the bfd; 0..n-1 as sections are created in a bfd. *}
|
. {* 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. *}
|
. {* The next section in the list belonging to the BFD, or NULL. *}
|
||||||
. struct bfd_section *next;
|
. struct bfd_section *next;
|
||||||
|
@ -826,7 +826,7 @@ _bfd_generic_new_section_hook (bfd *abfd, asection *newsect)
|
||||||
static asection *
|
static asection *
|
||||||
bfd_section_init (bfd *abfd, asection *newsect)
|
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->id = section_id;
|
||||||
newsect->index = abfd->section_count;
|
newsect->index = abfd->section_count;
|
||||||
|
|
|
@ -102,7 +102,7 @@ struct saved_output_info
|
||||||
|
|
||||||
struct saved_offsets
|
struct saved_offsets
|
||||||
{
|
{
|
||||||
int section_count;
|
unsigned int section_count;
|
||||||
struct saved_output_info *sections;
|
struct saved_output_info *sections;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue