Miscellaneous BFD int vs bfd_boolean fixes
authorAlan Modra <amodra@gmail.com>
Sun, 28 Mar 2021 23:12:37 +0000 (09:42 +1030)
committerAlan Modra <amodra@gmail.com>
Mon, 29 Mar 2021 00:52:21 +0000 (11:22 +1030)
nds32 hyper_relax takes values of 0, 1 and 2.  vms_write_data_block
return TRUE/FALSE not positive/negative.

* coff-z80.c (z80_is_local_label_name): Return bfd_boolean.
* elf32-z80.c (z80_is_local_label_name): Likewise.
* elf32-spu.c (spu_elf_modify_headers): Likewise.
* elf32-nds32.h (struct elf_nds32_link_hash_table <hyper_relax>):
Change type to int.
* vms-lib.c (_bfd_vms_lib_write_archive_contents): Correct test
for error return from vms_write_data_block.

bfd/ChangeLog
bfd/coff-z80.c
bfd/elf32-nds32.h
bfd/elf32-spu.c
bfd/elf32-z80.c
bfd/vms-lib.c

index 398def06eb3859431bfef6279640545aa8ba1dc8..fbfc4dbed1de9984e6302542e9ce8fa532277e75 100644 (file)
@@ -1,3 +1,13 @@
+2021-03-29  Alan Modra  <amodra@gmail.com>
+
+       * coff-z80.c (z80_is_local_label_name): Return bfd_boolean.
+       * elf32-z80.c (z80_is_local_label_name): Likewise.
+       * elf32-spu.c (spu_elf_modify_headers): Likewise.
+       * elf32-nds32.h (struct elf_nds32_link_hash_table <hyper_relax>):
+       Change type to int.
+       * vms-lib.c (_bfd_vms_lib_write_archive_contents): Correct test
+       for error return from vms_write_data_block.
+
 2021-03-29  Alan Modra  <amodra@gmail.com>
 
        * elf32-i386.c (elf_i386_finish_local_dynamic_symbol): Return int.
index 9d1d9c599cb8bc6f7c6ad4865681792fc73ab343..a47a53857736057f3e3ce88f583d52d2a121f8aa 100644 (file)
@@ -452,7 +452,7 @@ extra_case (bfd *in_abfd,
     }
 }
 
-static int
+static bfd_boolean
 z80_is_local_label_name (bfd *        abfd ATTRIBUTE_UNUSED,
                          const char * name)
 {
index e7853cf129f78609d9485d5ff53b3adc361567b2..0f496361555f6fa2d7a7f97607822d1251af3d1f 100644 (file)
@@ -126,7 +126,7 @@ struct elf_nds32_link_hash_table
   int relax_fp_as_gp;          /* --mrelax-omit-fp.  */
   int eliminate_gc_relocs;     /* --meliminate-gc-relocs.  */
   FILE *sym_ld_script;         /* --mgen-symbol-ld-script=<file>.  */
-  bfd_boolean hyper_relax;     /* Relax for symbol not in RW sections.  */
+  int hyper_relax;             /* Relax for symbol not in RW sections.  */
   int tls_desc_trampoline;     /* --m[no-]tlsdesc-trampoline.  */
   /* Disable if linking a dynamically linked executable.  */
   int load_store_relax;
index c31ab98b3100f6b719b48dbe12ea7f1cea05cb9b..1058df132893f9e5535a9fb144e9ed507b54ff92 100644 (file)
@@ -5346,7 +5346,7 @@ spu_elf_fake_sections (bfd *obfd ATTRIBUTE_UNUSED,
 
 /* Tweak phdrs before writing them out.  */
 
-static int
+static bfd_boolean
 spu_elf_modify_headers (bfd *abfd, struct bfd_link_info *info)
 {
   if (info != NULL)
index 5634fa132bb4926deb71218420d7a427453178dc..80f4ab521437bff64b84019ea8e3578cb75e5067 100644 (file)
@@ -550,7 +550,7 @@ z80_elf_object_p (bfd *abfd)
   return bfd_default_set_arch_mach (abfd, bfd_arch_z80, mach);
 }
 
-static int
+static bfd_boolean
 z80_is_local_label_name (bfd * abfd ATTRIBUTE_UNUSED,
                         const char * name)
 {
index eaac8af2a22a028c5075f96608e00976aa7e4e0f..72038b4c89e46bb42c0301833a7fb823b7b31ef1 100644 (file)
@@ -2280,7 +2280,7 @@ _bfd_vms_lib_write_archive_contents (bfd *arch)
       else
        {
          /* Write the MHD.  */
-         if (vms_write_data_block (arch, &data, &off, blk, sz, 0) < 0)
+         if (!vms_write_data_block (arch, &data, &off, blk, sz, 0))
            goto input_err;
 
          /* Write the member.  */
@@ -2289,13 +2289,13 @@ _bfd_vms_lib_write_archive_contents (bfd *arch)
              sz = bfd_bread (blk, sizeof (blk), current);
              if (sz == 0)
                break;
-             if (vms_write_data_block (arch, &data, &off, blk, sz, 0) < 0)
+             if (!vms_write_data_block (arch, &data, &off, blk, sz, 0))
                goto input_err;
            }
 
          /* Write the end of module marker.  */
-         if (vms_write_data_block (arch, &data, &off,
-                                   eotdesc, sizeof (eotdesc), 1) < 0)
+         if (!vms_write_data_block (arch, &data, &off,
+                                    eotdesc, sizeof (eotdesc), 1))
            goto input_err;
        }
     }