From 973ffd6335bb35d78d2ea2b844019f38ac9dbba5 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 17 Oct 2001 12:01:05 +0000 Subject: [PATCH] * elf-m10200.c (mn10200_elf_relax_section): Cast assignment to Elf_Internal_Shdr.contents now that it's no longer a PTR. * elf-m10300.c (mn10300_elf_relax_section): Likewise. * elf32-h8300.c (elf32_h8_relax_section): Likewise. * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise. * elf32-sh.c (sh_elf_relax_section): Likewise. * elf64-alpha.c (elf64_alpha_relax_section): Likewise. * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. * elf.c (setup_group): Warning fixes. * elflink.h (elf_link_sort_relocs): Likewise. * pdp11.c (slurp_reloc_table): Likewise. --- bfd/ChangeLog | 14 ++++++++++++++ bfd/elf-m10200.c | 2 +- bfd/elf-m10300.c | 6 +++--- bfd/elf.c | 6 +++--- bfd/elf32-h8300.c | 2 +- bfd/elf32-m68k.c | 2 +- bfd/elf32-sh.c | 2 +- bfd/elf64-alpha.c | 2 +- bfd/elflink.h | 4 ++-- bfd/elfxx-ia64.c | 2 +- bfd/pdp11.c | 2 +- 11 files changed, 29 insertions(+), 15 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 0cebc35f10..3356f8a79e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,17 @@ +2001-10-17 Alan Modra + + * elf-m10200.c (mn10200_elf_relax_section): Cast assignment to + Elf_Internal_Shdr.contents now that it's no longer a PTR. + * elf-m10300.c (mn10300_elf_relax_section): Likewise. + * elf32-h8300.c (elf32_h8_relax_section): Likewise. + * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise. + * elf32-sh.c (sh_elf_relax_section): Likewise. + * elf64-alpha.c (elf64_alpha_relax_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. + * elf.c (setup_group): Warning fixes. + * elflink.h (elf_link_sort_relocs): Likewise. + * pdp11.c (slurp_reloc_table): Likewise. + 2001-10-16 Jeff Holcomb * elflink.h (elf_link_sort_relocs): Remove unnecessary pointer diff --git a/bfd/elf-m10200.c b/bfd/elf-m10200.c index 9caf1bbc13..b73ebec33d 100644 --- a/bfd/elf-m10200.c +++ b/bfd/elf-m10200.c @@ -1225,7 +1225,7 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) else { /* Cache the symbols for elf_link_input_bfd. */ - symtab_hdr->contents = extsyms; + symtab_hdr->contents = (unsigned char *) extsyms; } free_extsyms = NULL; } diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c index 01211ba9d3..ff88350832 100644 --- a/bfd/elf-m10300.c +++ b/bfd/elf-m10300.c @@ -1108,7 +1108,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) else { /* Cache the symbols for elf_link_input_bfd. */ - symtab_hdr->contents = extsyms; + symtab_hdr->contents = (unsigned char *) extsyms; } free_extsyms = NULL; } @@ -1381,7 +1381,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) else { /* Cache the symbols for elf_link_input_bfd. */ - symtab_hdr->contents = extsyms; + symtab_hdr->contents = (unsigned char *) extsyms; } free_extsyms = NULL; } @@ -2437,7 +2437,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) else { /* Cache the symbols for elf_link_input_bfd. */ - symtab_hdr->contents = extsyms; + symtab_hdr->contents = (unsigned char *) extsyms; } free_extsyms = NULL; } diff --git a/bfd/elf.c b/bfd/elf.c index feffd7c859..16c6fcb17d 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -384,7 +384,7 @@ setup_group (abfd, hdr, newsect) } if (num_group == 0) - num_group = -1; + num_group = (unsigned) -1; elf_tdata (abfd)->num_group = num_group; if (num_group > 0) @@ -402,7 +402,7 @@ setup_group (abfd, hdr, newsect) Elf_Internal_Shdr *shdr = elf_elfsections (abfd)[i]; if (shdr->sh_type == SHT_GROUP && shdr->sh_size >= 8) { - char *src; + unsigned char *src; Elf_Internal_Group *dest; /* Add to list of sections. */ @@ -502,7 +502,7 @@ setup_group (abfd, hdr, newsect) pos = elf_tdata (abfd)->symtab_hdr.sh_offset; pos += shdr->sh_info * bed->s->sizeof_sym; if (bfd_seek (abfd, pos, SEEK_SET) != 0 - || bfd_bread (ename, 4, abfd) != 4) + || bfd_bread (ename, (bfd_size_type) 4, abfd) != 4) return false; iname = H_GET_32 (abfd, ename); gname = elf_string_from_elf_strtab (abfd, iname); diff --git a/bfd/elf32-h8300.c b/bfd/elf32-h8300.c index 397f595bab..0c37002b91 100644 --- a/bfd/elf32-h8300.c +++ b/bfd/elf32-h8300.c @@ -1230,7 +1230,7 @@ elf32_h8_relax_section (abfd, sec, link_info, again) else { /* Cache the symbols for elf_link_input_bfd. */ - symtab_hdr->contents = extsyms; + symtab_hdr->contents = (unsigned char *) extsyms; } free_extsyms = NULL; } diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index c3252240d2..609e91a537 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -2202,7 +2202,7 @@ bfd_m68k_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) != symtab_hdr->sh_size)) goto error_return; if (info->keep_memory) - symtab_hdr->contents = extsyms; + symtab_hdr->contents = (unsigned char *) extsyms; } /* Get a copy of the native relocations. */ diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index 4fd1bda511..eec9642d09 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -1392,7 +1392,7 @@ sh_elf_relax_section (abfd, sec, link_info, again) else { /* Cache the symbols for elf_link_input_bfd. */ - symtab_hdr->contents = extsyms; + symtab_hdr->contents = (unsigned char *) extsyms; } free_extsyms = NULL; } diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 0dd6c091c3..ee78d1ff27 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -1572,7 +1572,7 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) else { /* Cache the symbols for elf_link_input_bfd. */ - symtab_hdr->contents = extsyms; + symtab_hdr->contents = (unsigned char *) extsyms; } } diff --git a/bfd/elflink.h b/bfd/elflink.h index b1f8311404..7cfa0fb566 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -4480,7 +4480,7 @@ elf_link_sort_relocs (abfd, info, psec) } } - qsort (rela, count, sizeof (*rela), elf_link_sort_cmp1); + qsort (rela, (size_t) count, sizeof (*rela), elf_link_sort_cmp1); for (ret = 0; ret < count && rela[ret].type == reloc_class_relative; ret++) ; for (i = ret, j = ret; i < count; i++) @@ -4489,7 +4489,7 @@ elf_link_sort_relocs (abfd, info, psec) j = i; rela[i].offset = rela[j].u.rel.r_offset; } - qsort (rela + ret, count - ret, sizeof (*rela), elf_link_sort_cmp2); + qsort (rela + ret, (size_t) count - ret, sizeof (*rela), elf_link_sort_cmp2); for (o = dynobj->sections; o != NULL; o = o->next) if ((o->flags & (SEC_HAS_CONTENTS|SEC_LINKER_CREATED)) diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index 5fa95b4d90..fbd264d2ce 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -922,7 +922,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) else { /* Cache the symbols for elf_link_input_bfd. */ - symtab_hdr->contents = extsyms; + symtab_hdr->contents = (unsigned char *) extsyms; } } diff --git a/bfd/pdp11.c b/bfd/pdp11.c index 265c159bd3..2c08497594 100644 --- a/bfd/pdp11.c +++ b/bfd/pdp11.c @@ -2247,7 +2247,7 @@ NAME(aout,slurp_reloc_table) (abfd, asect, symbols) { int x; - x = GET_WORD (abfd, relocs + each_size * counter); + x = GET_WORD (abfd, (char *) relocs + each_size * counter); if (x != 0) real_count++; }