]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
More "Make asection->id and asection->index unsigned"
authorAlan Modra <amodra@gmail.com>
Mon, 31 Aug 2015 06:33:42 +0000 (16:03 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 31 Aug 2015 06:56:10 +0000 (16:26 +0930)
Fixes regressions introduced by 7292b3ac.

* elflink.c (elf_sort_symbol): Use correctly sized type for
calculating signed section->id difference.
(elf_link_add_object_symbols): Likewise.
* pef.c (bfd_pef_scan_start_address): Warning fix.
* vms-alpha.c (vms_new_section_hook): Likewise.

bfd/ChangeLog
bfd/elflink.c
bfd/pef.c
bfd/vms-alpha.c

index 713073ab4e3090892c16bb8cb5ba8c30cc1312bb..44f5d78f7df48d9f07cb0067628a8bbe430ac38a 100644 (file)
@@ -1,3 +1,11 @@
+2015-08-31  Alan Modra  <amodra@gmail.com>
+
+       * elflink.c (elf_sort_symbol): Use correctly sized type for
+       calculating signed section->id difference.
+       (elf_link_add_object_symbols): Likewise.
+       * pef.c (bfd_pef_scan_start_address): Warning fix.
+       * vms-alpha.c (vms_new_section_hook): Likewise.
+
 2015-08-31  Alan Modra  <amodra@gmail.com>
 
        * elf32-nds32.c (nds32_convert_32_to_16_alu1): Warning fix.
index 192ce15aa369df0b09d825cf1ed0a6c059e10997..4f867004097beecb84d3f6cfcbba7b31f712f5e0 100644 (file)
@@ -3247,7 +3247,7 @@ elf_sort_symbol (const void *arg1, const void *arg2)
     return vdiff > 0 ? 1 : -1;
   else
     {
-      long sdiff = h1->root.u.def.section->id - h2->root.u.def.section->id;
+      int sdiff = h1->root.u.def.section->id - h2->root.u.def.section->id;
       if (sdiff != 0)
        return sdiff > 0 ? 1 : -1;
     }
@@ -4830,7 +4830,7 @@ error_free_dyn:
                i = idx + 1;
              else
                {
-                 long sdiff = slook->id - h->root.u.def.section->id;
+                 int sdiff = slook->id - h->root.u.def.section->id;
                  if (sdiff < 0)
                    j = idx;
                  else if (sdiff > 0)
index 18be73b7ea6132eca09b0370a060a97ace9172bf..4e7683b63bf800aec094d0feab32af4e20a11e01 100644 (file)
--- a/bfd/pef.c
+++ b/bfd/pef.c
@@ -487,7 +487,7 @@ bfd_pef_scan_start_address (bfd *abfd)
     goto end;
 
   for (section = abfd->sections; section != NULL; section = section->next)
-    if ((section->index + 1) == header.main_section)
+    if ((long) (section->index + 1) == header.main_section)
       break;
 
   if (section == NULL)
index a0219d8c6709048974b5e385061bff20fdfbec65..4b0b23fd7eedd9ea501eac46fe49c6b67ef522d4 100644 (file)
@@ -9013,13 +9013,13 @@ vms_new_section_hook (bfd * abfd, asection *section)
 {
   bfd_size_type amt;
 
-  vms_debug2 ((1, "vms_new_section_hook (%p, [%d]%s)\n",
+  vms_debug2 ((1, "vms_new_section_hook (%p, [%u]%s)\n",
                abfd, section->index, section->name));
 
   if (! bfd_set_section_alignment (abfd, section, 0))
     return FALSE;
 
-  vms_debug2 ((7, "%d: %s\n", section->index, section->name));
+  vms_debug2 ((7, "%u: %s\n", section->index, section->name));
 
   amt = sizeof (struct vms_section_data_struct);
   section->used_by_bfd = bfd_zalloc (abfd, amt);