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/bfd.c | |
parent | faa7a26040c617a6d29f601998b99a1da882c672 (diff) | |
download | binutils-0a1b45a20eaa98d4d9026dc1fd17e79e741183af.zip binutils-0a1b45a20eaa98d4d9026dc1fd17e79e741183af.tar.gz binutils-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/bfd.c')
-rw-r--r-- | bfd/bfd.c | 118 |
1 files changed, 59 insertions, 59 deletions
@@ -372,7 +372,7 @@ CODE_FRAGMENT . return abfd->filename; .} . -.static inline bfd_boolean +.static inline bool .bfd_get_cacheable (const bfd *abfd) .{ . return abfd->cacheable; @@ -420,13 +420,13 @@ CODE_FRAGMENT . return abfd->section_count; .} . -.static inline bfd_boolean +.static inline bool .bfd_has_map (const bfd *abfd) .{ . return abfd->has_armap; .} . -.static inline bfd_boolean +.static inline bool .bfd_is_thin_archive (const bfd *abfd) .{ . return abfd->is_thin_archive; @@ -439,15 +439,15 @@ CODE_FRAGMENT .} . .{* See note beside bfd_set_section_userdata. *} -.static inline bfd_boolean -.bfd_set_cacheable (bfd * abfd, bfd_boolean val) +.static inline bool +.bfd_set_cacheable (bfd * abfd, bool val) .{ . abfd->cacheable = val; -. return TRUE; +. return true; .} . .static inline void -.bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +.bfd_set_thin_archive (bfd *abfd, bool val) .{ . abfd->is_thin_archive = val; .} @@ -582,7 +582,7 @@ CODE_FRAGMENT . abfd->sections = s; .} . -.static inline bfd_boolean +.static inline bool .bfd_section_removed_from_list (const bfd *abfd, const asection *s) .{ . return s->next ? s->next->prev != s : abfd->section_last != s; @@ -1615,7 +1615,7 @@ FUNCTION bfd_set_file_flags SYNOPSIS - bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); + bool bfd_set_file_flags (bfd *abfd, flagword flags); DESCRIPTION Set the flag word in the BFD @var{abfd} to the value @var{flags}. @@ -1630,29 +1630,29 @@ DESCRIPTION */ -bfd_boolean +bool bfd_set_file_flags (bfd *abfd, flagword flags) { if (abfd->format != bfd_object) { bfd_set_error (bfd_error_wrong_format); - return FALSE; + return false; } if (bfd_read_p (abfd)) { bfd_set_error (bfd_error_invalid_operation); - return FALSE; + return false; } abfd->flags = flags; if ((flags & bfd_applicable_file_flags (abfd)) != flags) { bfd_set_error (bfd_error_invalid_operation); - return FALSE; + return false; } - return TRUE; + return true; } void @@ -1769,7 +1769,7 @@ FUNCTION bfd_set_start_address SYNOPSIS - bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma); + bool bfd_set_start_address (bfd *abfd, bfd_vma vma); DESCRIPTION Make @var{vma} the entry point of output BFD @var{abfd}. @@ -1778,11 +1778,11 @@ RETURNS Returns <<TRUE>> on success, <<FALSE>> otherwise. */ -bfd_boolean +bool bfd_set_start_address (bfd *abfd, bfd_vma vma) { abfd->start_address = vma; - return TRUE; + return true; } /* @@ -1970,7 +1970,7 @@ FUNCTION bfd_copy_private_header_data SYNOPSIS - bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); + bool bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); DESCRIPTION Copy private BFD header information from the BFD @var{ibfd} to the @@ -1993,7 +1993,7 @@ FUNCTION bfd_copy_private_bfd_data SYNOPSIS - bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); + bool bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); DESCRIPTION Copy private BFD information from the BFD @var{ibfd} to the @@ -2014,7 +2014,7 @@ FUNCTION bfd_set_private_flags SYNOPSIS - bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); + bool bfd_set_private_flags (bfd *abfd, flagword flags); DESCRIPTION Set private BFD flag information in the BFD @var{abfd}. @@ -2132,7 +2132,7 @@ DESCRIPTION . .extern bfd_byte *bfd_get_relocated_section_contents . (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, -. bfd_boolean, asymbol **); +. bool, asymbol **); . */ @@ -2142,12 +2142,12 @@ bfd_get_relocated_section_contents (bfd *abfd, struct bfd_link_info *link_info, struct bfd_link_order *link_order, bfd_byte *data, - bfd_boolean relocatable, + bool relocatable, asymbol **symbols) { bfd *abfd2; bfd_byte *(*fn) (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, asymbol **); + bfd_byte *, bool, asymbol **); if (link_order->type == bfd_indirect_link_order) { @@ -2165,15 +2165,15 @@ bfd_get_relocated_section_contents (bfd *abfd, /* Record information about an ELF program header. */ -bfd_boolean +bool bfd_record_phdr (bfd *abfd, unsigned long type, - bfd_boolean flags_valid, + bool flags_valid, flagword flags, - bfd_boolean at_valid, + bool at_valid, bfd_vma at, /* Bytes. */ - bfd_boolean includes_filehdr, - bfd_boolean includes_phdrs, + bool includes_filehdr, + bool includes_phdrs, unsigned int count, asection **secs) { @@ -2182,13 +2182,13 @@ bfd_record_phdr (bfd *abfd, unsigned int opb = bfd_octets_per_byte (abfd, NULL); if (bfd_get_flavour (abfd) != bfd_target_elf_flavour) - return TRUE; + return true; amt = sizeof (struct elf_segment_map); amt += ((bfd_size_type) count - 1) * sizeof (asection *); m = (struct elf_segment_map *) bfd_zalloc (abfd, amt); if (m == NULL) - return FALSE; + return false; m->p_type = type; m->p_flags = flags; @@ -2205,13 +2205,13 @@ bfd_record_phdr (bfd *abfd, ; *pm = m; - return TRUE; + return true; } #ifdef BFD64 /* Return true iff this target is 32-bit. */ -static bfd_boolean +static bool is32bit (bfd *abfd) { if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) @@ -2259,7 +2259,7 @@ FUNCTION bfd_alt_mach_code SYNOPSIS - bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); + bool bfd_alt_mach_code (bfd *abfd, int alternative); DESCRIPTION @@ -2270,7 +2270,7 @@ DESCRIPTION machine codes. */ -bfd_boolean +bool bfd_alt_mach_code (bfd *abfd, int alternative) { if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) @@ -2286,25 +2286,25 @@ bfd_alt_mach_code (bfd *abfd, int alternative) case 1: code = get_elf_backend_data (abfd)->elf_machine_alt1; if (code == 0) - return FALSE; + return false; break; case 2: code = get_elf_backend_data (abfd)->elf_machine_alt2; if (code == 0) - return FALSE; + return false; break; default: - return FALSE; + return false; } elf_elfheader (abfd)->e_machine = code; - return TRUE; + return true; } - return FALSE; + return false; } /* @@ -2340,7 +2340,7 @@ FUNCTION bfd_emul_get_commonpagesize SYNOPSIS - bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); + bfd_vma bfd_emul_get_commonpagesize (const char *, bool); DESCRIPTION Returns the common page size, in bytes, as determined by @@ -2351,7 +2351,7 @@ RETURNS */ bfd_vma -bfd_emul_get_commonpagesize (const char *emul, bfd_boolean relro) +bfd_emul_get_commonpagesize (const char *emul, bool relro) { const bfd_target *target; @@ -2391,7 +2391,7 @@ bfd_demangle (bfd *abfd, const char *name, int options) char *res, *alloc; const char *pre, *suf; size_t pre_len; - bfd_boolean skip_lead; + bool skip_lead; skip_lead = (abfd != NULL && *name != '\0' @@ -2542,7 +2542,7 @@ bfd_update_compression_header (bfd *abfd, bfd_byte *contents, bfd_check_compression_header SYNOPSIS - bfd_boolean bfd_check_compression_header + bool bfd_check_compression_header (bfd *abfd, bfd_byte *contents, asection *sec, bfd_size_type *uncompressed_size, unsigned int *uncompressed_alignment_power); @@ -2557,7 +2557,7 @@ RETURNS Return TRUE if the compression header is valid. */ -bfd_boolean +bool bfd_check_compression_header (bfd *abfd, bfd_byte *contents, asection *sec, bfd_size_type *uncompressed_size, @@ -2587,11 +2587,11 @@ bfd_check_compression_header (bfd *abfd, bfd_byte *contents, { *uncompressed_size = chdr.ch_size; *uncompressed_alignment_power = bfd_log2 (chdr.ch_addralign); - return TRUE; + return true; } } - return FALSE; + return false; } /* @@ -2686,7 +2686,7 @@ FUNCTION bfd_convert_section_contents SYNOPSIS - bfd_boolean bfd_convert_section_contents + bool bfd_convert_section_contents (bfd *ibfd, asection *isec, bfd *obfd, bfd_byte **ptr, bfd_size_type *ptr_size); @@ -2698,24 +2698,24 @@ DESCRIPTION function, and the new size written to @var{ptr_size}. */ -bfd_boolean +bool bfd_convert_section_contents (bfd *ibfd, sec_ptr isec, bfd *obfd, bfd_byte **ptr, bfd_size_type *ptr_size) { bfd_byte *contents; bfd_size_type ihdr_size, ohdr_size, size; Elf_Internal_Chdr chdr; - bfd_boolean use_memmove; + bool use_memmove; /* Do nothing if either input or output aren't ELF. */ if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) - return TRUE; + return true; /* Do nothing if ELF classes of input and output are the same. */ if (get_elf_backend_data (ibfd)->s->elfclass == get_elf_backend_data (obfd)->s->elfclass) - return TRUE; + return true; /* Convert GNU properties. */ if (startswith (isec->name, NOTE_GNU_PROPERTY_SECTION_NAME)) @@ -2724,18 +2724,18 @@ bfd_convert_section_contents (bfd *ibfd, sec_ptr isec, bfd *obfd, /* Do nothing if input file will be decompressed. */ if ((ibfd->flags & BFD_DECOMPRESS)) - return TRUE; + return true; /* Do nothing if the input section isn't a SHF_COMPRESSED section. */ ihdr_size = bfd_get_compression_header_size (ibfd, isec); if (ihdr_size == 0) - return TRUE; + return true; /* PR 25221. Check for corrupt input sections. */ if (ihdr_size > bfd_get_section_limit (ibfd, isec)) /* FIXME: Issue a warning about a corrupt compression header size field ? */ - return FALSE; + return false; contents = *ptr; @@ -2751,13 +2751,13 @@ bfd_convert_section_contents (bfd *ibfd, sec_ptr isec, bfd *obfd, ohdr_size = sizeof (Elf64_External_Chdr); - use_memmove = FALSE; + use_memmove = false; } else if (ihdr_size != sizeof (Elf64_External_Chdr)) { /* FIXME: Issue a warning about a corrupt compression header size field ? */ - return FALSE; + return false; } else { @@ -2767,7 +2767,7 @@ bfd_convert_section_contents (bfd *ibfd, sec_ptr isec, bfd *obfd, chdr.ch_addralign = bfd_get_64 (ibfd, &echdr->ch_addralign); ohdr_size = sizeof (Elf32_External_Chdr); - use_memmove = TRUE; + use_memmove = true; } size = bfd_section_size (isec) - ihdr_size + ohdr_size; @@ -2775,7 +2775,7 @@ bfd_convert_section_contents (bfd *ibfd, sec_ptr isec, bfd *obfd, { contents = (bfd_byte *) bfd_malloc (size); if (contents == NULL) - return FALSE; + return false; } /* Write out the output compression header. */ @@ -2806,7 +2806,7 @@ bfd_convert_section_contents (bfd *ibfd, sec_ptr isec, bfd *obfd, } *ptr_size = size; - return TRUE; + return true; } /* Get the linker information. */ |