diff options
author | Alan Modra <amodra@gmail.com> | 2021-03-31 10:30:54 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-03-31 10:49:23 +1030 |
commit | 0a1b45a20eaa98d4d9026dc1fd17e79e741183af (patch) | |
tree | 059b2b296b4d60784a82cd6a52dae47dcac4d66a /bfd/coffgen.c | |
parent | faa7a26040c617a6d29f601998b99a1da882c672 (diff) | |
download | gdb-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/coffgen.c')
-rw-r--r-- | bfd/coffgen.c | 253 |
1 files changed, 127 insertions, 126 deletions
diff --git a/bfd/coffgen.c b/bfd/coffgen.c index f493978..4e14243 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -46,14 +46,14 @@ /* Take a section header read from a coff file (in HOST byte order), and make a BFD "section" out of it. This is used by ECOFF. */ -static bfd_boolean +static bool make_a_section_from_file (bfd *abfd, struct internal_scnhdr *hdr, unsigned int target_index) { asection *return_section; char *name; - bfd_boolean result = TRUE; + bool result = true; flagword flags; name = NULL; @@ -76,7 +76,7 @@ make_a_section_from_file (bfd *abfd, expect them to be off by default. This won't directly affect the format of any output BFD created from this one, but the information can be used to decide what to do. */ - bfd_coff_set_long_section_names (abfd, TRUE); + bfd_coff_set_long_section_names (abfd, true); memcpy (buf, hdr->s_name + 1, SCNNMLEN - 1); buf[SCNNMLEN - 1] = '\0'; strindex = strtol (buf, &p, 10); @@ -84,14 +84,14 @@ make_a_section_from_file (bfd *abfd, { strings = _bfd_coff_read_string_table (abfd); if (strings == NULL) - return FALSE; + return false; if ((bfd_size_type)(strindex + 2) >= obj_coff_strings_len (abfd)) - return FALSE; + return false; strings += strindex; name = (char *) bfd_alloc (abfd, (bfd_size_type) strlen (strings) + 1 + 1); if (name == NULL) - return FALSE; + return false; strcpy (name, strings); } } @@ -102,14 +102,14 @@ make_a_section_from_file (bfd *abfd, name = (char *) bfd_alloc (abfd, (bfd_size_type) sizeof (hdr->s_name) + 1 + 1); if (name == NULL) - return FALSE; + return false; strncpy (name, (char *) &hdr->s_name[0], sizeof (hdr->s_name)); name[sizeof (hdr->s_name)] = 0; } return_section = bfd_make_section_anyway (abfd, name); if (return_section == NULL) - return FALSE; + return false; return_section->vma = hdr->s_vaddr; return_section->lma = hdr->s_paddr; @@ -129,7 +129,7 @@ make_a_section_from_file (bfd *abfd, if (! bfd_coff_styp_to_sec_flags_hook (abfd, hdr, name, return_section, & flags)) - result = FALSE; + result = false; return_section->flags = flags; @@ -178,7 +178,7 @@ make_a_section_from_file (bfd *abfd, /* xgettext: c-format */ (_("%pB: unable to initialize compress status for section %s"), abfd, name); - return FALSE; + return false; } if (return_section->compress_status == COMPRESS_SECTION_DONE) { @@ -188,7 +188,7 @@ make_a_section_from_file (bfd *abfd, new_name = bfd_alloc (abfd, len + 2); if (new_name == NULL) - return FALSE; + return false; new_name[0] = '.'; new_name[1] = 'z'; memcpy (new_name + 2, name + 1, len); @@ -202,7 +202,7 @@ make_a_section_from_file (bfd *abfd, /* xgettext: c-format */ (_("%pB: unable to initialize decompress status for section %s"), abfd, name); - return FALSE; + return false; } if (name[1] == 'z') { @@ -210,7 +210,7 @@ make_a_section_from_file (bfd *abfd, new_name = bfd_alloc (abfd, len); if (new_name == NULL) - return FALSE; + return false; new_name[0] = '.'; memcpy (new_name + 1, name + 2, len - 1); } @@ -486,9 +486,9 @@ _bfd_coff_internal_syment_name (bfd *abfd, struct internal_reloc * _bfd_coff_read_internal_relocs (bfd *abfd, asection *sec, - bfd_boolean cache, + bool cache, bfd_byte *external_relocs, - bfd_boolean require_internal, + bool require_internal, struct internal_reloc *internal_relocs) { bfd_size_type relsz; @@ -685,7 +685,7 @@ fixup_symbol_value (bfd *abfd, chain, and that the last one points to the first external symbol. We do that here too. */ -bfd_boolean +bool coff_renumber_symbols (bfd *bfd_ptr, int *first_undef) { unsigned int symbol_count = bfd_get_symcount (bfd_ptr); @@ -712,7 +712,7 @@ coff_renumber_symbols (bfd *bfd_ptr, int *first_undef) amt = sizeof (asymbol *) * ((bfd_size_type) symbol_count + 1); newsyms = (asymbol **) bfd_alloc (bfd_ptr, amt); if (!newsyms) - return FALSE; + return false; bfd_ptr->outsymbols = newsyms; for (i = 0; i < symbol_count; i++) if ((symbol_ptr_ptr[i]->flags & BSF_NOT_AT_END) != 0 @@ -774,7 +774,7 @@ coff_renumber_symbols (bfd *bfd_ptr, int *first_undef) obj_conv_table_size (bfd_ptr) = native_index; - return TRUE; + return true; } /* Run thorough the symbol table again, and fix it so that all @@ -968,7 +968,7 @@ coff_fix_symbol_name (bfd *abfd, /* Write a symbol out to a COFF file. */ -static bfd_boolean +static bool coff_write_symbol (bfd *abfd, asymbol *symbol, combined_entry_type *native, @@ -1011,10 +1011,10 @@ coff_write_symbol (bfd *abfd, symesz = bfd_coff_symesz (abfd); buf = bfd_alloc (abfd, symesz); if (!buf) - return FALSE; + return false; bfd_coff_swap_sym_out (abfd, &native->u.syment, buf); if (bfd_bwrite (buf, symesz, abfd) != symesz) - return FALSE; + return false; bfd_release (abfd, buf); if (native->u.syment.n_numaux > 0) @@ -1025,7 +1025,7 @@ coff_write_symbol (bfd *abfd, auxesz = bfd_coff_auxesz (abfd); buf = bfd_alloc (abfd, auxesz); if (!buf) - return FALSE; + return false; for (j = 0; j < native->u.syment.n_numaux; j++) { BFD_ASSERT (! (native + j + 1)->is_sym); @@ -1035,7 +1035,7 @@ coff_write_symbol (bfd *abfd, native->u.syment.n_numaux, buf); if (bfd_bwrite (buf, auxesz, abfd) != auxesz) - return FALSE; + return false; } bfd_release (abfd, buf); } @@ -1044,14 +1044,14 @@ coff_write_symbol (bfd *abfd, set_index (symbol, *written); *written += numaux + 1; - return TRUE; + return true; } /* Write out a symbol to a COFF file that does not come from a COFF file originally. This symbol may have been created by the linker, or we may be linking a non COFF file to a COFF file. */ -bfd_boolean +bool coff_write_alien_symbol (bfd *abfd, asymbol *symbol, struct internal_syment *isym, @@ -1067,7 +1067,7 @@ coff_write_alien_symbol (bfd *abfd, ? symbol->section->output_section : symbol->section; struct bfd_link_info *link_info = coff_data (abfd)->link_info; - bfd_boolean ret; + bool ret; if ((!link_info || link_info->strip_discarded) && !bfd_is_abs_section (symbol->section) @@ -1076,11 +1076,11 @@ coff_write_alien_symbol (bfd *abfd, symbol->name = ""; if (isym != NULL) memset (isym, 0, sizeof (*isym)); - return TRUE; + return true; } native = dummy; - native->is_sym = TRUE; - native[1].is_sym = FALSE; + native->is_sym = true; + native[1].is_sym = false; native->u.syment.n_type = T_NULL; native->u.syment.n_flags = 0; native->u.syment.n_numaux = 0; @@ -1108,7 +1108,7 @@ coff_write_alien_symbol (bfd *abfd, symbol->name = ""; if (isym != NULL) memset (isym, 0, sizeof (*isym)); - return TRUE; + return true; } else { @@ -1148,7 +1148,7 @@ coff_write_alien_symbol (bfd *abfd, /* Write a native symbol to a COFF file. */ -static bfd_boolean +static bool coff_write_native_symbol (bfd *abfd, coff_symbol_type *symbol, bfd_vma *written, @@ -1165,7 +1165,7 @@ coff_write_native_symbol (bfd *abfd, && symbol->symbol.section->output_section == bfd_abs_section_ptr) { symbol->symbol.name = ""; - return TRUE; + return true; } BFD_ASSERT (native->is_sym); @@ -1194,7 +1194,7 @@ coff_write_native_symbol (bfd *abfd, + symbol->symbol.section->output_offset); count++; } - symbol->done_lineno = TRUE; + symbol->done_lineno = true; if (! bfd_is_const_section (symbol->symbol.section->output_section)) symbol->symbol.section->output_section->moving_line_filepos += @@ -1214,7 +1214,7 @@ null_error_handler (const char *fmt ATTRIBUTE_UNUSED, /* Write out the COFF symbols. */ -bfd_boolean +bool coff_write_symbols (bfd *abfd) { bfd_size_type string_size; @@ -1249,7 +1249,7 @@ coff_write_symbols (bfd *abfd) /* Seek to the right place. */ if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0) - return FALSE; + return false; /* Output all the symbols we have. */ written = 0; @@ -1264,7 +1264,7 @@ coff_write_symbols (bfd *abfd) if (!coff_write_alien_symbol (abfd, symbol, NULL, NULL, &written, &string_size, &debug_string_section, &debug_string_size)) - return FALSE; + return false; } else { @@ -1309,7 +1309,7 @@ coff_write_symbols (bfd *abfd) if (!coff_write_native_symbol (abfd, c_symbol, &written, &string_size, &debug_string_section, &debug_string_size)) - return FALSE; + return false; } } @@ -1328,7 +1328,7 @@ coff_write_symbols (bfd *abfd) #endif if (bfd_bwrite ((void *) buffer, (bfd_size_type) sizeof (buffer), abfd) != sizeof (buffer)) - return FALSE; + return false; /* Handle long section names. This code must handle section names just as they are handled in coff_write_object_contents. */ @@ -1345,7 +1345,7 @@ coff_write_symbols (bfd *abfd) { if (bfd_bwrite (o->name, (bfd_size_type) (len + 1), abfd) != len + 1) - return FALSE; + return false; } } } @@ -1387,7 +1387,7 @@ coff_write_symbols (bfd *abfd) if (bfd_coff_force_symnames_in_strings (abfd)) { if (bfd_bwrite (".file", (bfd_size_type) 6, abfd) != 6) - return FALSE; + return false; } maxlen = bfd_coff_filnmlen (abfd); } @@ -1398,7 +1398,7 @@ coff_write_symbols (bfd *abfd) { if (bfd_bwrite ((void *) (q->name), (bfd_size_type) name_length + 1, abfd) != name_length + 1) - return FALSE; + return false; } } } @@ -1417,7 +1417,7 @@ coff_write_symbols (bfd *abfd) #endif if (bfd_bwrite ((void *) buffer, (bfd_size_type) STRING_SIZE_SIZE, abfd) != STRING_SIZE_SIZE) - return FALSE; + return false; } /* Make sure the .debug section was created to be the correct size. @@ -1431,10 +1431,10 @@ coff_write_symbols (bfd *abfd) 1 << debug_string_section->alignment_power) == debug_string_section->size))); - return TRUE; + return true; } -bfd_boolean +bool coff_write_linenumbers (bfd *abfd) { asection *s; @@ -1444,14 +1444,14 @@ coff_write_linenumbers (bfd *abfd) linesz = bfd_coff_linesz (abfd); buff = bfd_alloc (abfd, linesz); if (!buff) - return FALSE; + return false; for (s = abfd->sections; s != (asection *) NULL; s = s->next) { if (s->lineno_count) { asymbol **q = abfd->outsymbols; if (bfd_seek (abfd, s->line_filepos, SEEK_SET) != 0) - return FALSE; + return false; /* Find all the linenumbers in this section. */ while (*q) { @@ -1472,7 +1472,7 @@ coff_write_linenumbers (bfd *abfd) bfd_coff_swap_lineno_out (abfd, &out, buff); if (bfd_bwrite (buff, (bfd_size_type) linesz, abfd) != linesz) - return FALSE; + return false; l++; while (l->line_number) { @@ -1481,7 +1481,7 @@ coff_write_linenumbers (bfd *abfd) bfd_coff_swap_lineno_out (abfd, &out, buff); if (bfd_bwrite (buff, (bfd_size_type) linesz, abfd) != linesz) - return FALSE; + return false; l++; } } @@ -1491,7 +1491,7 @@ coff_write_linenumbers (bfd *abfd) } } bfd_release (abfd, buff); - return TRUE; + return true; } alent * @@ -1621,7 +1621,7 @@ copy_name (bfd *abfd, char *name, size_t maxlen) /* Read in the external symbols. */ -bfd_boolean +bool _bfd_coff_get_external_symbols (bfd *abfd) { size_t symesz; @@ -1629,20 +1629,20 @@ _bfd_coff_get_external_symbols (bfd *abfd) void * syms; if (obj_coff_external_syms (abfd) != NULL) - return TRUE; + return true; symesz = bfd_coff_symesz (abfd); if (_bfd_mul_overflow (obj_raw_syment_count (abfd), symesz, &size)) { bfd_set_error (bfd_error_file_truncated); - return FALSE; + return false; } if (size == 0) - return TRUE; + return true; if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0) - return FALSE; + return false; syms = _bfd_malloc_and_read (abfd, size, size); obj_coff_external_syms (abfd) = syms; return syms != NULL; @@ -1732,11 +1732,11 @@ _bfd_coff_read_string_table (bfd *abfd) /* Free up the external symbols and strings read from a COFF file. */ -bfd_boolean +bool _bfd_coff_free_symbols (bfd *abfd) { if (! bfd_family_coff (abfd)) - return FALSE; + return false; if (obj_coff_external_syms (abfd) != NULL && ! obj_coff_keep_syms (abfd)) @@ -1753,7 +1753,7 @@ _bfd_coff_free_symbols (bfd *abfd) obj_coff_strings_len (abfd) = 0; } - return TRUE; + return true; } /* Read a symbol table into freshly bfd_allocated memory, swap it, and @@ -1811,7 +1811,7 @@ coff_get_normalized_symtab (bfd *abfd) bfd_coff_swap_sym_in (abfd, (void *) raw_src, (void *) & internal_ptr->u.syment); symbol_ptr = internal_ptr; - internal_ptr->is_sym = TRUE; + internal_ptr->is_sym = true; /* PR 17512: Prevent buffer overrun. */ if (symbol_ptr->u.syment.n_numaux > ((raw_end - 1) - raw_src) / symesz) @@ -1833,7 +1833,7 @@ coff_get_normalized_symtab (bfd *abfd) (int) i, symbol_ptr->u.syment.n_numaux, &(internal_ptr->u.auxent)); - internal_ptr->is_sym = FALSE; + internal_ptr->is_sym = false; coff_pointerize_aux (abfd, internal, symbol_ptr, i, internal_ptr, internal_end); } @@ -1999,7 +1999,7 @@ coff_make_empty_symbol (bfd *abfd) new_symbol->symbol.section = 0; new_symbol->native = NULL; new_symbol->lineno = NULL; - new_symbol->done_lineno = FALSE; + new_symbol->done_lineno = false; new_symbol->symbol.the_bfd = abfd; return & new_symbol->symbol; @@ -2023,11 +2023,11 @@ coff_bfd_make_debug_symbol (bfd *abfd, new_symbol->native = (combined_entry_type *) bfd_zalloc (abfd, amt); if (!new_symbol->native) return NULL; - new_symbol->native->is_sym = TRUE; + new_symbol->native->is_sym = true; new_symbol->symbol.section = bfd_abs_section_ptr; new_symbol->symbol.flags = BSF_DEBUGGING; new_symbol->lineno = NULL; - new_symbol->done_lineno = FALSE; + new_symbol->done_lineno = false; new_symbol->symbol.the_bfd = abfd; return & new_symbol->symbol; @@ -2207,7 +2207,7 @@ coff_print_symbol (bfd *abfd, function for the is_local_label_name entry point, but some may override it. */ -bfd_boolean +bool _bfd_coff_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED, const char *name) { @@ -2218,7 +2218,7 @@ _bfd_coff_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED, section, calculate and return the name of the source file and the line nearest to the wanted location. */ -bfd_boolean +bool coff_find_nearest_line_with_names (bfd *abfd, asymbol **symbols, asection *section, @@ -2228,7 +2228,7 @@ coff_find_nearest_line_with_names (bfd *abfd, unsigned int *line_ptr, const struct dwarf_debug_section *debug_sections) { - bfd_boolean found; + bool found; unsigned int i; unsigned int line_base; coff_data_type *cof = coff_data (abfd); @@ -2245,17 +2245,17 @@ coff_find_nearest_line_with_names (bfd *abfd, &found, filename_ptr, functionname_ptr, line_ptr, &coff_data(abfd)->line_info)) - return FALSE; + return false; if (found) - return TRUE; + return true; /* Also try examining DWARF2 debugging information. */ if (_bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset, filename_ptr, functionname_ptr, line_ptr, NULL, debug_sections, &coff_data(abfd)->dwarf2_find_line_info)) - return TRUE; + return true; sec_data = coff_section_data (abfd, section); @@ -2284,7 +2284,7 @@ coff_find_nearest_line_with_names (bfd *abfd, if (sec_data) { - sec_data->saved_bias = TRUE; + sec_data->saved_bias = true; sec_data->bias = bias; } } @@ -2295,7 +2295,7 @@ coff_find_nearest_line_with_names (bfd *abfd, filename_ptr, functionname_ptr, line_ptr, NULL, debug_sections, &coff_data(abfd)->dwarf2_find_line_info)) - return TRUE; + return true; } *filename_ptr = 0; @@ -2304,15 +2304,15 @@ coff_find_nearest_line_with_names (bfd *abfd, /* Don't try and find line numbers in a non coff file. */ if (!bfd_family_coff (abfd)) - return FALSE; + return false; if (cof == NULL) - return FALSE; + return false; /* Find the first C_FILE symbol. */ p = cof->raw_syments; if (!p) - return FALSE; + return false; pend = p + cof->raw_syment_count; while (p < pend) @@ -2389,7 +2389,7 @@ coff_find_nearest_line_with_names (bfd *abfd, { *functionname_ptr = NULL; *line_ptr = 0; - return TRUE; + return true; } /* Now wander though the raw linenumbers of the section. @@ -2493,10 +2493,10 @@ coff_find_nearest_line_with_names (bfd *abfd, sec_data->line_base = line_base; } - return TRUE; + return true; } -bfd_boolean +bool coff_find_nearest_line (bfd *abfd, asymbol **symbols, asection *section, @@ -2513,13 +2513,13 @@ coff_find_nearest_line (bfd *abfd, line_ptr, dwarf_debug_sections); } -bfd_boolean +bool coff_find_inliner_info (bfd *abfd, const char **filename_ptr, const char **functionname_ptr, unsigned int *line_ptr) { - bfd_boolean found; + bool found; found = _bfd_dwarf2_find_inliner_info (abfd, filename_ptr, functionname_ptr, line_ptr, @@ -2543,7 +2543,7 @@ coff_sizeof_headers (bfd *abfd, struct bfd_link_info *info) /* Change the class of a coff symbol held by BFD. */ -bfd_boolean +bool bfd_coff_set_symbol_class (bfd * abfd, asymbol * symbol, unsigned int symbol_class) @@ -2554,7 +2554,7 @@ bfd_coff_set_symbol_class (bfd * abfd, if (csym == NULL) { bfd_set_error (bfd_error_invalid_operation); - return FALSE; + return false; } else if (csym->native == NULL) { @@ -2568,9 +2568,9 @@ bfd_coff_set_symbol_class (bfd * abfd, native = (combined_entry_type *) bfd_zalloc (abfd, amt); if (native == NULL) - return FALSE; + return false; - native->is_sym = TRUE; + native->is_sym = true; native->u.syment.n_type = T_NULL; native->u.syment.n_sclass = symbol_class; @@ -2603,10 +2603,10 @@ bfd_coff_set_symbol_class (bfd * abfd, else csym->native->u.syment.n_sclass = symbol_class; - return TRUE; + return true; } -bfd_boolean +bool _bfd_coff_section_already_linked (bfd *abfd, asection *sec, struct bfd_link_info *info) @@ -2618,15 +2618,15 @@ _bfd_coff_section_already_linked (bfd *abfd, struct coff_comdat_info *s_comdat; if (sec->output_section == bfd_abs_section_ptr) - return FALSE; + return false; flags = sec->flags; if ((flags & SEC_LINK_ONCE) == 0) - return FALSE; + return false; /* The COFF backend linker doesn't support group sections. */ if ((flags & SEC_GROUP) != 0) - return FALSE; + return false; name = bfd_section_name (sec); s_comdat = bfd_coff_get_comdat_section (abfd, sec); @@ -2674,12 +2674,12 @@ _bfd_coff_section_already_linked (bfd *abfd, /* This is the first section with this name. Record it. */ if (!bfd_section_already_linked_table_insert (already_linked_list, sec)) info->callbacks->einfo (_("%F%P: already_linked_table: %E\n")); - return FALSE; + return false; } /* Initialize COOKIE for input bfd ABFD. */ -static bfd_boolean +static bool init_reloc_cookie (struct coff_reloc_cookie *cookie, struct bfd_link_info *info ATTRIBUTE_UNUSED, bfd *abfd) @@ -2692,7 +2692,7 @@ init_reloc_cookie (struct coff_reloc_cookie *cookie, cookie->symbols = obj_symbols (abfd); - return TRUE; + return true; } /* Free the memory allocated by init_reloc_cookie, if appropriate. */ @@ -2707,7 +2707,7 @@ fini_reloc_cookie (struct coff_reloc_cookie *cookie ATTRIBUTE_UNUSED, /* Initialize the relocation information in COOKIE for input section SEC of input bfd ABFD. */ -static bfd_boolean +static bool init_reloc_cookie_rels (struct coff_reloc_cookie *cookie, struct bfd_link_info *info ATTRIBUTE_UNUSED, bfd *abfd, @@ -2718,17 +2718,18 @@ init_reloc_cookie_rels (struct coff_reloc_cookie *cookie, cookie->rels = NULL; cookie->relend = NULL; cookie->rel = NULL; - return TRUE; + return true; } - cookie->rels = _bfd_coff_read_internal_relocs (abfd, sec, FALSE, NULL, 0, NULL); + cookie->rels = _bfd_coff_read_internal_relocs (abfd, sec, false, NULL, + 0, NULL); if (cookie->rels == NULL) - return FALSE; + return false; cookie->rel = cookie->rels; cookie->relend = (cookie->rels + sec->reloc_count); - return TRUE; + return true; } /* Free the memory allocated by init_reloc_cookie_rels, @@ -2750,20 +2751,20 @@ fini_reloc_cookie_rels (struct coff_reloc_cookie *cookie, /* Initialize the whole of COOKIE for input section SEC. */ -static bfd_boolean +static bool init_reloc_cookie_for_section (struct coff_reloc_cookie *cookie, struct bfd_link_info *info, asection *sec) { if (!init_reloc_cookie (cookie, info, sec->owner)) - return FALSE; + return false; if (!init_reloc_cookie_rels (cookie, info, sec->owner, sec)) { fini_reloc_cookie (cookie, sec->owner); - return FALSE; + return false; } - return TRUE; + return true; } /* Free the memory allocated by init_reloc_cookie_for_section, @@ -2846,14 +2847,14 @@ _bfd_coff_gc_mark_rsec (struct bfd_link_info *info, asection *sec, + obj_convert (sec->owner)[cookie->rel->r_symndx])->native->u.syment); } -static bfd_boolean _bfd_coff_gc_mark +static bool _bfd_coff_gc_mark (struct bfd_link_info *, asection *, coff_gc_mark_hook_fn); /* COOKIE->rel describes a relocation against section SEC, which is a section we've decided to keep. Mark the section that contains the relocation symbol. */ -static bfd_boolean +static bool _bfd_coff_gc_mark_reloc (struct bfd_link_info *info, asection *sec, coff_gc_mark_hook_fn gc_mark_hook, @@ -2867,21 +2868,21 @@ _bfd_coff_gc_mark_reloc (struct bfd_link_info *info, if (bfd_get_flavour (rsec->owner) != bfd_target_coff_flavour) rsec->gc_mark = 1; else if (!_bfd_coff_gc_mark (info, rsec, gc_mark_hook)) - return FALSE; + return false; } - return TRUE; + return true; } /* The mark phase of garbage collection. For a given section, mark it and any sections in this section's group, and all the sections which define symbols to which it refers. */ -static bfd_boolean +static bool _bfd_coff_gc_mark (struct bfd_link_info *info, asection *sec, coff_gc_mark_hook_fn gc_mark_hook) { - bfd_boolean ret = TRUE; + bool ret = true; sec->gc_mark = 1; @@ -2892,14 +2893,14 @@ _bfd_coff_gc_mark (struct bfd_link_info *info, struct coff_reloc_cookie cookie; if (!init_reloc_cookie_for_section (&cookie, info, sec)) - ret = FALSE; + ret = false; else { for (; cookie.rel < cookie.relend; cookie.rel++) { if (!_bfd_coff_gc_mark_reloc (info, sec, gc_mark_hook, &cookie)) { - ret = FALSE; + ret = false; break; } } @@ -2910,7 +2911,7 @@ _bfd_coff_gc_mark (struct bfd_link_info *info, return ret; } -static bfd_boolean +static bool _bfd_coff_gc_mark_extra_sections (struct bfd_link_info *info, coff_gc_mark_hook_fn mark_hook ATTRIBUTE_UNUSED) { @@ -2919,20 +2920,20 @@ _bfd_coff_gc_mark_extra_sections (struct bfd_link_info *info, for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { asection *isec; - bfd_boolean some_kept; + bool some_kept; if (bfd_get_flavour (ibfd) != bfd_target_coff_flavour) continue; /* Ensure all linker created sections are kept, and see whether any other section is already marked. */ - some_kept = FALSE; + some_kept = false; for (isec = ibfd->sections; isec != NULL; isec = isec->next) { if ((isec->flags & SEC_LINKER_CREATED) != 0) isec->gc_mark = 1; else if (isec->gc_mark) - some_kept = TRUE; + some_kept = true; } /* If no section in this file will be kept, then we can @@ -2947,12 +2948,12 @@ _bfd_coff_gc_mark_extra_sections (struct bfd_link_info *info, || (isec->flags & (SEC_ALLOC | SEC_LOAD | SEC_RELOC)) == 0) isec->gc_mark = 1; } - return TRUE; + return true; } /* Sweep symbols in swept sections. Called via coff_link_hash_traverse. */ -static bfd_boolean +static bool coff_gc_sweep_symbol (struct coff_link_hash_entry *h, void *data ATTRIBUTE_UNUSED) { @@ -2969,15 +2970,15 @@ coff_gc_sweep_symbol (struct coff_link_hash_entry *h, h->symbol_class = C_HIDDEN; } - return TRUE; + return true; } /* The sweep phase of garbage collection. Remove all garbage sections. */ -typedef bfd_boolean (*gc_sweep_hook_fn) +typedef bool (*gc_sweep_hook_fn) (bfd *, struct bfd_link_info *, asection *, const struct internal_reloc *); -static bfd_boolean +static bool coff_gc_sweep (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info) { bfd *sub; @@ -3026,13 +3027,13 @@ coff_gc_sweep (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info) && !bfd_is_abs_section (o->output_section)) { struct internal_reloc *internal_relocs; - bfd_boolean r; + bool r; internal_relocs = _bfd_coff_link_read_relocs (o->owner, o, NULL, NULL, info->keep_memory); if (internal_relocs == NULL) - return FALSE; + return false; r = (*gc_sweep_hook) (o->owner, info, o, internal_relocs); @@ -3040,7 +3041,7 @@ coff_gc_sweep (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info) free (internal_relocs); if (!r) - return FALSE; + return false; } #endif } @@ -3051,7 +3052,7 @@ coff_gc_sweep (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info) coff_link_hash_traverse (coff_hash_table (info), coff_gc_sweep_symbol, NULL); - return TRUE; + return true; } /* Keep all sections containing symbols undefined on the command-line, @@ -3067,7 +3068,7 @@ _bfd_coff_gc_keep (struct bfd_link_info *info) struct coff_link_hash_entry *h; h = coff_link_hash_lookup (coff_hash_table (info), sym->name, - FALSE, FALSE, FALSE); + false, false, false); if (h != NULL && (h->root.type == bfd_link_hash_defined @@ -3079,7 +3080,7 @@ _bfd_coff_gc_keep (struct bfd_link_info *info) /* Do mark and sweep of unused sections. */ -bfd_boolean +bool bfd_coff_gc_sections (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info) { bfd *sub; @@ -3092,7 +3093,7 @@ bfd_coff_gc_sections (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info) || !is_coff_hash_table (info->hash)) { _bfd_error_handler(_("warning: gc-sections option ignored")); - return TRUE; + return true; } #endif @@ -3115,7 +3116,7 @@ bfd_coff_gc_sections (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info) && !o->gc_mark) { if (!_bfd_coff_gc_mark (info, o, _bfd_coff_gc_mark_hook)) - return FALSE; + return false; } } } @@ -3138,7 +3139,7 @@ bfd_coff_group_name (bfd *abfd, const asection *sec) return NULL; } -bfd_boolean +bool _bfd_coff_close_and_cleanup (bfd *abfd) { struct coff_tdata *tdata = coff_data (abfd); @@ -3152,7 +3153,7 @@ _bfd_coff_close_and_cleanup (bfd *abfd) if (bfd_get_format (abfd) == bfd_object && bfd_family_coff (abfd) && !_bfd_coff_free_symbols (abfd)) - return FALSE; + return false; if (bfd_get_format (abfd) == bfd_object || bfd_get_format (abfd) == bfd_core) |