aboutsummaryrefslogtreecommitdiff
path: root/bfd/vms-lib.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-03-31 10:30:54 +1030
committerAlan Modra <amodra@gmail.com>2021-03-31 10:49:23 +1030
commit0a1b45a20eaa98d4d9026dc1fd17e79e741183af (patch)
tree059b2b296b4d60784a82cd6a52dae47dcac4d66a /bfd/vms-lib.c
parentfaa7a26040c617a6d29f601998b99a1da882c672 (diff)
downloadgdb-0a1b45a20eaa98d4d9026dc1fd17e79e741183af.zip
gdb-0a1b45a20eaa98d4d9026dc1fd17e79e741183af.tar.gz
gdb-0a1b45a20eaa98d4d9026dc1fd17e79e741183af.tar.bz2
Use bool in bfd
* sysdep.h: POISON_BFD_BOOLEAN: Define. * aix5ppc-core.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aoutx.h, * arc-got.h, * archive.c, * archive64.c, * archures.c, * bfd-in.h, * bfd.c, * bfdwin.c, * binary.c, * cache.c, * coff-alpha.c, * coff-arm.c, * coff-arm.h, * coff-bfd.c, * coff-bfd.h, * coff-go32.c, * coff-i386.c, * coff-ia64.c, * coff-mcore.c, * coff-mips.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic30.c, * coff-tic4x.c, * coff-tic54x.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * compress.c, * corefile.c, * cpu-aarch64.c, * cpu-aarch64.h, * cpu-alpha.c, * cpu-arc.c, * cpu-arm.c, * cpu-arm.h, * cpu-avr.c, * cpu-bfin.c, * cpu-bpf.c, * cpu-cr16.c, * cpu-cris.c, * cpu-crx.c, * cpu-csky.c, * cpu-d10v.c, * cpu-d30v.c, * cpu-dlx.c, * cpu-epiphany.c, * cpu-fr30.c, * cpu-frv.c, * cpu-ft32.c, * cpu-h8300.c, * cpu-hppa.c, * cpu-i386.c, * cpu-ia64.c, * cpu-iamcu.c, * cpu-ip2k.c, * cpu-iq2000.c, * cpu-k1om.c, * cpu-l1om.c, * cpu-lm32.c, * cpu-m10200.c, * cpu-m10300.c, * cpu-m32c.c, * cpu-m32r.c, * cpu-m68hc11.c, * cpu-m68hc12.c, * cpu-m68k.c, * cpu-m9s12x.c, * cpu-m9s12xg.c, * cpu-mcore.c, * cpu-mep.c, * cpu-metag.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-mmix.c, * cpu-moxie.c, * cpu-msp430.c, * cpu-mt.c, * cpu-nds32.c, * cpu-nfp.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-pdp11.c, * cpu-pj.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-riscv.c, * cpu-rl78.c, * cpu-rs6000.c, * cpu-rx.c, * cpu-s12z.c, * cpu-s390.c, * cpu-score.c, * cpu-sh.c, * cpu-sparc.c, * cpu-spu.c, * cpu-tic30.c, * cpu-tic4x.c, * cpu-tic54x.c, * cpu-tic6x.c, * cpu-tilegx.c, * cpu-tilepro.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-vax.c, * cpu-visium.c, * cpu-wasm32.c, * cpu-xc16x.c, * cpu-xgate.c, * cpu-xstormy16.c, * cpu-xtensa.c, * cpu-z80.c, * cpu-z8k.c, * dwarf1.c, * dwarf2.c, * ecoff-bfd.h, * ecoff.c, * ecofflink.c, * elf-attrs.c, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-nacl.c, * elf-nacl.h, * elf-properties.c, * elf-s390-common.c, * elf-s390.h, * elf-strtab.c, * elf-vxworks.c, * elf-vxworks.h, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-arm.h, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-bfin.h, * elf32-cr16.c, * elf32-cr16.h, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c, * elf32-csky.h, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-gen.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-hppa.h, * elf32-i386.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m68k.h, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-metag.h, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-nios2.h, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s12z.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-relocs.h, * elf32-sh.c, * elf32-sparc.c, * elf32-spu.c, * elf32-spu.h, * elf32-tic6x.c, * elf32-tic6x.h, * elf32-tilegx.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-v850.h, * elf32-vax.c, * elf32-visium.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xstormy16.c, * elf32-xtensa.c, * elf32-z80.c, * elf64-alpha.c, * elf64-bpf.c, * elf64-gen.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-nfp.c, * elf64-ppc.c, * elf64-ppc.h, * elf64-s390.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-x86-64.c, * elfcode.h, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-mips.h, * elfxx-riscv.c, * elfxx-riscv.h, * elfxx-sparc.c, * elfxx-sparc.h, * elfxx-target.h, * elfxx-tilegx.c, * elfxx-tilegx.h, * elfxx-x86.c, * elfxx-x86.h, * format.c, * genlink.h, * hash.c, * i386aout.c, * i386lynx.c, * i386msdos.c, * ihex.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libecoff.h, * libpei.h, * libxcoff.h, * linker.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mmo.c, * netbsd.h, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-sh.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pei-arm.c, * pei-i386.c, * pei-ia64.c, * pei-mcore.c, * pei-sh.c, * pei-x86_64.c, * peicode.h, * plugin.c, * plugin.h, * ppcboot.c, * reloc.c, * reloc16.c, * rs6000-core.c, * section.c, * simple.c, * som.c, * som.h, * srec.c, * stabs.c, * syms.c, * targets.c, * tekhex.c, * verilog.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * vms.h, * wasm-module.c, * xcofflink.c, * xcofflink.h, * xsym.c, * xsym.h: Replace bfd_boolean with bool, FALSE with false, and TRUE with true throughout. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate.
Diffstat (limited to 'bfd/vms-lib.c')
-rw-r--r--bfd/vms-lib.c188
1 files changed, 94 insertions, 94 deletions
diff --git a/bfd/vms-lib.c b/bfd/vms-lib.c
index 72038b4..dc23df3 100644
--- a/bfd/vms-lib.c
+++ b/bfd/vms-lib.c
@@ -125,12 +125,12 @@ struct carsym_mem
/* If true, the table was reallocated on the heap. If false, it is still
in the BFD's objalloc. */
- bfd_boolean realloced;
+ bool realloced;
};
/* Simply add a name to the index. */
-static bfd_boolean
+static bool
vms_add_index (struct carsym_mem *cs, char *name,
unsigned int idx_vbn, unsigned int idx_off)
{
@@ -142,7 +142,7 @@ vms_add_index (struct carsym_mem *cs, char *name,
if (cs->max > -33u / 2 || cs->max >= cs->limit)
{
bfd_set_error (bfd_error_file_too_big);
- return FALSE;
+ return false;
}
cs->max = 2 * cs->max + 32;
if (cs->max > cs->limit)
@@ -150,14 +150,14 @@ vms_add_index (struct carsym_mem *cs, char *name,
if (_bfd_mul_overflow (cs->max, sizeof (struct carsym), &amt))
{
bfd_set_error (bfd_error_file_too_big);
- return FALSE;
+ return false;
}
if (!cs->realloced)
{
n = bfd_malloc (amt);
if (n == NULL)
- return FALSE;
+ return false;
memcpy (n, cs->idx, cs->nbr * sizeof (struct carsym));
/* And unfortunately we can't free cs->idx. */
}
@@ -165,21 +165,21 @@ vms_add_index (struct carsym_mem *cs, char *name,
{
n = bfd_realloc_or_free (cs->idx, amt);
if (n == NULL)
- return FALSE;
+ return false;
}
cs->idx = n;
- cs->realloced = TRUE;
+ cs->realloced = true;
}
cs->idx[cs->nbr].file_offset = (idx_vbn - 1) * VMS_BLOCK_SIZE + idx_off;
cs->idx[cs->nbr].name = name;
cs->nbr++;
- return TRUE;
+ return true;
}
/* Follow all member of a lns list (pointed by RFA) and add indexes for
NAME. Return FALSE in case of error. */
-static bfd_boolean
+static bool
vms_add_indexes_from_list (bfd *abfd, struct carsym_mem *cs, char *name,
struct vms_rfa *rfa)
{
@@ -191,18 +191,18 @@ vms_add_indexes_from_list (bfd *abfd, struct carsym_mem *cs, char *name,
{
vbn = bfd_getl32 (rfa->vbn);
if (vbn == 0)
- return TRUE;
+ return true;
/* Read the LHS. */
off = (vbn - 1) * VMS_BLOCK_SIZE + bfd_getl16 (rfa->offset);
if (bfd_seek (abfd, off, SEEK_SET) != 0
|| bfd_bread (&lns, sizeof (lns), abfd) != sizeof (lns))
- return FALSE;
+ return false;
if (!vms_add_index (cs, name,
bfd_getl32 (lns.modrfa.vbn),
bfd_getl16 (lns.modrfa.offset)))
- return FALSE;
+ return false;
rfa = &lns.nxtrfa;
}
@@ -210,7 +210,7 @@ vms_add_indexes_from_list (bfd *abfd, struct carsym_mem *cs, char *name,
/* Read block VBN from ABFD and store it into BLK. Return FALSE in case of error. */
-static bfd_boolean
+static bool
vms_read_block (bfd *abfd, unsigned int vbn, void *blk)
{
file_ptr off;
@@ -218,14 +218,14 @@ vms_read_block (bfd *abfd, unsigned int vbn, void *blk)
off = (vbn - 1) * VMS_BLOCK_SIZE;
if (bfd_seek (abfd, off, SEEK_SET) != 0
|| bfd_bread (blk, VMS_BLOCK_SIZE, abfd) != VMS_BLOCK_SIZE)
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
/* Write the content of BLK to block VBN of ABFD. Return FALSE in case of error. */
-static bfd_boolean
+static bool
vms_write_block (bfd *abfd, unsigned int vbn, void *blk)
{
file_ptr off;
@@ -233,15 +233,15 @@ vms_write_block (bfd *abfd, unsigned int vbn, void *blk)
off = (vbn - 1) * VMS_BLOCK_SIZE;
if (bfd_seek (abfd, off, SEEK_SET) != 0
|| bfd_bwrite (blk, VMS_BLOCK_SIZE, abfd) != VMS_BLOCK_SIZE)
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
/* Read index block VBN and put the entry in **IDX (which is updated).
If the entry is indirect, recurse. */
-static bfd_boolean
+static bool
vms_traverse_index (bfd *abfd, unsigned int vbn, struct carsym_mem *cs,
unsigned int recur_count)
{
@@ -254,19 +254,19 @@ vms_traverse_index (bfd *abfd, unsigned int vbn, struct carsym_mem *cs,
if (recur_count == 100)
{
bfd_set_error (bfd_error_bad_value);
- return FALSE;
+ return false;
}
/* Read the index block. */
BFD_ASSERT (sizeof (indexdef) == VMS_BLOCK_SIZE);
if (!vms_read_block (abfd, vbn, &indexdef))
- return FALSE;
+ return false;
/* Traverse it. */
p = &indexdef.keys[0];
n = bfd_getl16 (indexdef.used);
if (n > sizeof (indexdef.keys))
- return FALSE;
+ return false;
endp = p + n;
while (p < endp)
{
@@ -302,22 +302,22 @@ vms_traverse_index (bfd *abfd, unsigned int vbn, struct carsym_mem *cs,
keyname = ridx->keyname;
}
else
- return FALSE;
+ return false;
/* Illegal value. */
if (idx_vbn == 0)
- return FALSE;
+ return false;
/* Point to the next index entry. */
p = keyname + keylen;
if (p > endp)
- return FALSE;
+ return false;
if (idx_off == RFADEF__C_INDEX)
{
/* Indirect entry. Recurse. */
if (!vms_traverse_index (abfd, idx_vbn, cs, recur_count + 1))
- return FALSE;
+ return false;
}
else
{
@@ -335,14 +335,14 @@ vms_traverse_index (bfd *abfd, unsigned int vbn, struct carsym_mem *cs,
/* Sanity check. */
if (keylen != sizeof (struct vms_kbn))
- return FALSE;
+ return false;
kbn = (struct vms_kbn *)keyname;
keylen = bfd_getl16 (kbn->keylen);
name = bfd_alloc (abfd, keylen + 1);
if (name == NULL)
- return FALSE;
+ return false;
kvbn = bfd_getl32 (kbn->rfa.vbn);
koff = bfd_getl16 (kbn->rfa.offset);
@@ -352,18 +352,18 @@ vms_traverse_index (bfd *abfd, unsigned int vbn, struct carsym_mem *cs,
unsigned int klen;
if (!vms_read_block (abfd, kvbn, kblk))
- return FALSE;
+ return false;
if (koff > sizeof (kblk) - sizeof (struct vms_kbn))
- return FALSE;
+ return false;
kbn = (struct vms_kbn *)(kblk + koff);
klen = bfd_getl16 (kbn->keylen);
if (klen > sizeof (kblk) - koff)
- return FALSE;
+ return false;
kvbn = bfd_getl32 (kbn->rfa.vbn);
koff = bfd_getl16 (kbn->rfa.offset);
if (noff + klen > keylen)
- return FALSE;
+ return false;
memcpy (name + noff, kbn + 1, klen);
noff += klen;
}
@@ -371,14 +371,14 @@ vms_traverse_index (bfd *abfd, unsigned int vbn, struct carsym_mem *cs,
/* Sanity check. */
if (noff != keylen)
- return FALSE;
+ return false;
}
else
{
/* Usual key name. */
name = bfd_alloc (abfd, keylen + 1);
if (name == NULL)
- return FALSE;
+ return false;
memcpy (name, keyname, keylen);
}
@@ -392,27 +392,27 @@ vms_traverse_index (bfd *abfd, unsigned int vbn, struct carsym_mem *cs,
off = (idx_vbn - 1) * VMS_BLOCK_SIZE + idx_off;
if (bfd_seek (abfd, off, SEEK_SET) != 0
|| bfd_bread (&lhs, sizeof (lhs), abfd) != sizeof (lhs))
- return FALSE;
+ return false;
/* These extra entries may cause reallocation of CS. */
if (!vms_add_indexes_from_list (abfd, cs, name, &lhs.ng_g_rfa))
- return FALSE;
+ return false;
if (!vms_add_indexes_from_list (abfd, cs, name, &lhs.ng_wk_rfa))
- return FALSE;
+ return false;
if (!vms_add_indexes_from_list (abfd, cs, name, &lhs.g_g_rfa))
- return FALSE;
+ return false;
if (!vms_add_indexes_from_list (abfd, cs, name, &lhs.g_wk_rfa))
- return FALSE;
+ return false;
}
else
{
if (!vms_add_index (cs, name, idx_vbn, idx_off))
- return FALSE;
+ return false;
}
}
}
- return TRUE;
+ return true;
}
/* Read index #IDX, which must have NBREL entries. */
@@ -443,7 +443,7 @@ vms_lib_read_index (bfd *abfd, int idx, unsigned int *nbrel)
csm.nbr = 0;
csm.max = *nbrel;
csm.limit = -1u;
- csm.realloced = FALSE;
+ csm.realloced = false;
if (filesize != 0)
{
/* Put an upper bound based on a file full of single char keys.
@@ -691,9 +691,9 @@ _bfd_vms_lib_archive_p (bfd *abfd, enum vms_lib_kind kind)
}
/* The map is always present. Also mark shared image library. */
- abfd->has_armap = TRUE;
+ abfd->has_armap = true;
if (tdata->type == LBR__C_TYP_ESHSTB || tdata->type == LBR__C_TYP_ISHSTB)
- abfd->is_thin_archive = TRUE;
+ abfd->is_thin_archive = true;
return _bfd_no_cleanup;
@@ -729,14 +729,14 @@ _bfd_vms_lib_txt_archive_p (bfd *abfd)
/* Standard bfd function. */
-static bfd_boolean
+static bool
_bfd_vms_lib_mkarchive (bfd *abfd, enum vms_lib_kind kind)
{
struct lib_tdata *tdata;
tdata = (struct lib_tdata *) bfd_zalloc (abfd, sizeof (struct lib_tdata));
if (tdata == NULL)
- return FALSE;
+ return false;
abfd->tdata.any = (void *)tdata;
vms_get_time (&tdata->credat_hi, &tdata->credat_lo);
@@ -764,16 +764,16 @@ _bfd_vms_lib_mkarchive (bfd *abfd, enum vms_lib_kind kind)
tdata->artdata.symdefs = NULL;
tdata->cache = NULL;
- return TRUE;
+ return true;
}
-bfd_boolean
+bool
_bfd_vms_lib_alpha_mkarchive (bfd *abfd)
{
return _bfd_vms_lib_mkarchive (abfd, vms_lib_alpha);
}
-bfd_boolean
+bool
_bfd_vms_lib_ia64_mkarchive (bfd *abfd)
{
return _bfd_vms_lib_mkarchive (abfd, vms_lib_ia64);
@@ -878,7 +878,7 @@ vms_lib_btell (struct bfd *abfd)
/* Read the header of the next data block if all bytes of the current block
have been read. */
-static bfd_boolean
+static bool
vms_lib_read_block (struct bfd *abfd)
{
struct vms_lib_iovec *vec = (struct vms_lib_iovec *) abfd->iostream;
@@ -889,13 +889,13 @@ vms_lib_read_block (struct bfd *abfd)
/* Read next block. */
if (bfd_seek (abfd->my_archive, vec->next_block, SEEK_SET) != 0)
- return FALSE;
+ return false;
if (bfd_bread (hdr, sizeof (hdr), abfd->my_archive) != sizeof (hdr))
- return FALSE;
+ return false;
vec->next_block = (bfd_getl32 (hdr + 2) - 1) * VMS_BLOCK_SIZE;
vec->blk_off = sizeof (hdr);
}
- return TRUE;
+ return true;
}
/* Read NBYTES from ABFD into BUF if not NULL. If BUF is NULL, bytes are
@@ -1284,7 +1284,7 @@ static const struct bfd_iovec vms_lib_iovec = {
/* Open a library module. FILEPOS is the position of the module header. */
-static bfd_boolean
+static bool
vms_lib_bopen (bfd *el, file_ptr filepos)
{
struct vms_lib_iovec *vec;
@@ -1296,7 +1296,7 @@ vms_lib_bopen (bfd *el, file_ptr filepos)
/* Allocate and initialized the iovec. */
vec = bfd_zalloc (el, sizeof (*vec));
if (vec == NULL)
- return FALSE;
+ return false;
el->iostream = vec;
el->iovec = &vms_lib_iovec;
@@ -1308,34 +1308,34 @@ vms_lib_bopen (bfd *el, file_ptr filepos)
vec->next_block = filepos & ~(VMS_BLOCK_SIZE - 1);
vec->blk_off = DATA__LENGTH;
if (!vms_lib_read_block (el))
- return FALSE;
+ return false;
/* Prepare to read the first record. */
vec->blk_off = filepos & (VMS_BLOCK_SIZE - 1);
vec->rec_rem = 0;
if (bfd_seek (el->my_archive, filepos, SEEK_SET) != 0)
- return FALSE;
+ return false;
/* Read Record length + MHD + align byte. */
len = tdata->mhd_size;
if (vms_lib_bread_raw (el, buf, 2) != 2)
- return FALSE;
+ return false;
if (bfd_getl16 (buf) != len)
- return FALSE;
+ return false;
len = (len + 1) & ~1;
BFD_ASSERT (len <= sizeof (buf));
if (vms_lib_bread_raw (el, buf, len) != len)
- return FALSE;
+ return false;
/* Get info from mhd. */
mhd = (struct vms_mhd *)buf;
/* Check id. */
if (mhd->id != MHD__C_MHDID)
- return FALSE;
+ return false;
if (len >= MHD__C_MHDLEN + 1)
el->selective_search = (mhd->objstat & MHD__M_SELSRC) ? 1 : 0;
el->mtime = vms_rawtime_to_time_t (mhd->datim);
- el->mtime_set = TRUE;
+ el->mtime_set = true;
/* Reinit the iovec so that seek() will point to the first record after
the mhd. */
@@ -1354,7 +1354,7 @@ vms_lib_bopen (bfd *el, file_ptr filepos)
if (vec->dcx_buf == NULL)
return -1;
}
- return TRUE;
+ return true;
}
/* Get member MODIDX. Return NULL in case of error. */
@@ -1424,7 +1424,7 @@ _bfd_vms_lib_get_module (bfd *abfd, unsigned int modidx)
if (tdata->mhd_size >= offsetof (struct vms_mhd, objstat) + 1)
res->selective_search = (mhd->objstat & MHD__M_SELSRC) ? 1 : 0;
res->mtime = vms_rawtime_to_time_t (mhd->datim);
- res->mtime_set = TRUE;
+ res->mtime_set = true;
arelt->parsed_size = bfd_getl32 (mhd->modsize);
@@ -1642,7 +1642,7 @@ lib_index_cmp (const void *lv, const void *rv)
/* Get the size of an index entry. */
static unsigned int
-get_idxlen (struct lib_index *idx, bfd_boolean is_elfidx)
+get_idxlen (struct lib_index *idx, bool is_elfidx)
{
if (is_elfidx)
{
@@ -1666,10 +1666,10 @@ get_idxlen (struct lib_index *idx, bfd_boolean is_elfidx)
IS_ELFIDX is true for elfidx (ie ia64) indexes layout.
Return TRUE on success. */
-static bfd_boolean
+static bool
vms_write_index (bfd *abfd,
struct lib_index *idx, unsigned int nbr, unsigned int *vbn,
- unsigned int *topvbn, bfd_boolean is_elfidx)
+ unsigned int *topvbn, bool is_elfidx)
{
/* The index is organized as a tree. This function implements a naive
algorithm to balance the tree: it fills the leaves, and create a new
@@ -1700,7 +1700,7 @@ vms_write_index (bfd *abfd,
/* No entries. Very easy to handle. */
if (topvbn != NULL)
*topvbn = 0;
- return TRUE;
+ return true;
}
if (abfd == NULL)
@@ -1745,13 +1745,13 @@ vms_write_index (bfd *abfd,
if (kbn_vbn != 0)
{
if (!vms_write_block (abfd, kbn_vbn, kbn_blk))
- return FALSE;
+ return false;
}
else
{
kbn_blk = bfd_malloc (VMS_BLOCK_SIZE);
if (kbn_blk == NULL)
- return FALSE;
+ return false;
}
*(unsigned short *)kbn_blk = 0;
}
@@ -1863,7 +1863,7 @@ vms_write_index (bfd *abfd,
{
bfd_putl16 (blk[j].len + blk[j].lastlen, rblk[j]->used);
if (!vms_write_block (abfd, blk[j].vbn, rblk[j]))
- return FALSE;
+ return false;
}
/* Reset this block. */
@@ -1932,7 +1932,7 @@ vms_write_index (bfd *abfd,
*topvbn = blk[level - 1].vbn;
if (abfd == NULL)
- return TRUE;
+ return true;
/* Flush. */
for (j = 1; j < level; j++)
@@ -1956,7 +1956,7 @@ vms_write_index (bfd *abfd,
/* Write this block on the disk. */
bfd_putl16 (blk[j].len + blk[j].lastlen, rblk[j]->used);
if (!vms_write_block (abfd, blk[j].vbn, rblk[j]))
- return FALSE;
+ return false;
free (rblk[j]);
}
@@ -1965,16 +1965,16 @@ vms_write_index (bfd *abfd,
if (kbn_vbn != 0)
{
if (!vms_write_block (abfd, kbn_vbn, kbn_blk))
- return FALSE;
+ return false;
free (kbn_blk);
}
- return TRUE;
+ return true;
}
/* Append data to the data block DATA. Force write if PAD is true. */
-static bfd_boolean
+static bool
vms_write_data_block (bfd *arch, struct vms_datadef *data, file_ptr *off,
const unsigned char *buf, unsigned int len, int pad)
{
@@ -1998,7 +1998,7 @@ vms_write_data_block (bfd *arch, struct vms_datadef *data, file_ptr *off,
bfd_putl32 ((*off / VMS_BLOCK_SIZE) + 2, data->link);
if (bfd_bwrite (data, sizeof (*data), arch) != sizeof (*data))
- return FALSE;
+ return false;
*off += DATA__LENGTH - doff;
@@ -2006,12 +2006,12 @@ vms_write_data_block (bfd *arch, struct vms_datadef *data, file_ptr *off,
break;
}
}
- return TRUE;
+ return true;
}
/* Build the symbols index. */
-static bfd_boolean
+static bool
_bfd_vms_lib_build_map (unsigned int nbr_modules,
struct lib_index *modules,
unsigned int *res_cnt,
@@ -2095,17 +2095,17 @@ _bfd_vms_lib_build_map (unsigned int nbr_modules,
*res_cnt = map_count;
*res = map;
- return TRUE;
+ return true;
error_return:
free (syms);
free (map);
- return FALSE;
+ return false;
}
/* Do the hard work: write an archive on the disk. */
-bfd_boolean
+bool
_bfd_vms_lib_write_archive_contents (bfd *arch)
{
bfd *current;
@@ -2121,7 +2121,7 @@ _bfd_vms_lib_write_archive_contents (bfd *arch)
unsigned int vbn;
unsigned int mod_idx_vbn;
unsigned int sym_idx_vbn;
- bfd_boolean is_elfidx = tdata->kind == vms_lib_ia64;
+ bool is_elfidx = tdata->kind == vms_lib_ia64;
unsigned int max_keylen = is_elfidx ? MAX_EKEYLEN : MAX_KEYLEN;
/* Count the number of modules (and do a first sanity check). */
@@ -2148,7 +2148,7 @@ _bfd_vms_lib_write_archive_contents (bfd *arch)
BFD_ASSERT (tdata->modules == NULL);
modules = bfd_alloc (arch, nbr_modules * sizeof (struct lib_index));
if (modules == NULL)
- return FALSE;
+ return false;
for (current = arch->archive_head, i = 0;
current != NULL;
@@ -2157,7 +2157,7 @@ _bfd_vms_lib_write_archive_contents (bfd *arch)
unsigned int nl;
modules[i].abfd = current;
- modules[i].name = vms_get_module_name (bfd_get_filename (current), FALSE);
+ modules[i].name = vms_get_module_name (bfd_get_filename (current), false);
modules[i].ref = 1;
/* FIXME: silently truncate long names ? */
@@ -2168,23 +2168,23 @@ _bfd_vms_lib_write_archive_contents (bfd *arch)
/* Create the module index. */
vbn = 0;
if (!vms_write_index (NULL, modules, nbr_modules, &vbn, NULL, is_elfidx))
- return FALSE;
+ return false;
nbr_mod_iblk = vbn;
/* Create symbol index. */
if (!_bfd_vms_lib_build_map (nbr_modules, modules, &nbr_symbols, &symbols))
- return FALSE;
+ return false;
vbn = 0;
if (!vms_write_index (NULL, symbols, nbr_symbols, &vbn, NULL, is_elfidx))
- return FALSE;
+ return false;
nbr_sym_iblk = vbn;
/* Write modules and remember their position. */
off = (1 + nbr_mod_iblk + nbr_sym_iblk) * VMS_BLOCK_SIZE;
if (bfd_seek (arch, off, SEEK_SET) != 0)
- return FALSE;
+ return false;
for (i = 0; i < nbr_modules; i++)
{
@@ -2304,10 +2304,10 @@ _bfd_vms_lib_write_archive_contents (bfd *arch)
vbn = 2;
if (!vms_write_index (arch, modules, nbr_modules, &vbn, &mod_idx_vbn,
is_elfidx))
- return FALSE;
+ return false;
if (!vms_write_index (arch, symbols, nbr_symbols, &vbn, &sym_idx_vbn,
is_elfidx))
- return FALSE;
+ return false;
/* Write libary header. */
{
@@ -2378,14 +2378,14 @@ _bfd_vms_lib_write_archive_contents (bfd *arch)
idd++;
if (!vms_write_block (arch, 1, blk))
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
input_err:
bfd_set_input_error (current, bfd_get_error ());
- return FALSE;
+ return false;
}
/* Add a target for text library. This costs almost nothing and is useful to