From: Alan Modra Date: Wed, 31 Mar 2021 00:09:51 +0000 (+1030) Subject: Use bool in ld X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f38a2680c2f04db6eac4fd87380cd3cf7bcb3bcc;p=binutils-gdb.git Use bool in ld * sysdep.h (POISON_BFD_BOOLEAN): Define. * configure.ac (elf_list_options, elf_shlib_list_options=false), (elf_plt_unwind_list_options=false): Replace FALSE with false, and TRUE with true. * emulparams/call_nop.sh, * emulparams/cet.sh, * emulparams/dynamic_undefined_weak.sh, * emulparams/elf32b4300.sh, * emulparams/elf32lm32.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32visium.sh, * emulparams/elf_x86_64.sh, * emulparams/extern_protected_data.sh, * emulparams/plt_unwind.sh, * emulparams/reloc_overflow.sh, * emulparams/static.sh, * emulparams/x86-64-lam.sh, * emultempl/aarch64elf.em, * emultempl/aix.em, * emultempl/alphaelf.em, * emultempl/armcoff.em, * emultempl/armelf.em, * emultempl/avrelf.em, * emultempl/beos.em, * emultempl/bfin.em, * emultempl/cr16elf.em, * emultempl/crxelf.em, * emultempl/cskyelf.em, * emultempl/elf.em, * emultempl/genelf.em, * emultempl/hppaelf.em, * emultempl/linux.em, * emultempl/m68hc1xelf.em, * emultempl/metagelf.em, * emultempl/mipself.em, * emultempl/mmix-elfnmmo.em, * emultempl/mmixelf.em, * emultempl/mmo.em, * emultempl/msp430.em, * emultempl/nios2elf.em, * emultempl/pdp11.em, * emultempl/pe.em, * emultempl/pep.em, * emultempl/ppc32elf.em, * emultempl/ppc64elf.em, * emultempl/rxelf.em, * emultempl/rxlinux.em, * emultempl/scoreelf.em, * emultempl/solaris2.em, * emultempl/spuelf.em, * emultempl/ticoff.em, * emultempl/v850elf.em, * emultempl/vms.em, * emultempl/xtensaelf.em, * emultempl/z80.em, * ld.h, * ldbuildid.c, * ldbuildid.h, * ldcref.c, * ldctor.c, * ldctor.h, * ldelf.c, * ldelf.h, * ldelfgen.c, * ldelfgen.h, * ldemul.c, * ldemul.h, * ldexp.c, * ldexp.h, * ldfile.c, * ldfile.h, * ldgram.y, * ldlang.c, * ldlang.h, * ldmain.c, * ldmain.h, * ldmisc.c, * ldmisc.h, * ldwrite.c, * lexsup.c, * mri.c, * pe-dll.c, * pe-dll.h, * pep-dll.h, * plugin.c, * plugin.h, * testplug.c, * testplug2.c, * testplug3.c, * testplug4.c: Replace bfd_boolean with bool, FALSE with false, and TRUE with true. * configure: Regenerate. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index dbdb4e128bf..d2c3c04745c 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,43 @@ +2021-03-31 Alan Modra + + * sysdep.h (POISON_BFD_BOOLEAN): Define. + * configure.ac (elf_list_options, elf_shlib_list_options=false), + (elf_plt_unwind_list_options=false): Replace FALSE with false, + and TRUE with true. + * emulparams/call_nop.sh, * emulparams/cet.sh, + * emulparams/dynamic_undefined_weak.sh, + * emulparams/elf32b4300.sh, * emulparams/elf32lm32.sh, + * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, + * emulparams/elf32visium.sh, * emulparams/elf_x86_64.sh, + * emulparams/extern_protected_data.sh, * emulparams/plt_unwind.sh, + * emulparams/reloc_overflow.sh, * emulparams/static.sh, + * emulparams/x86-64-lam.sh, * emultempl/aarch64elf.em, + * emultempl/aix.em, * emultempl/alphaelf.em, + * emultempl/armcoff.em, * emultempl/armelf.em, + * emultempl/avrelf.em, * emultempl/beos.em, * emultempl/bfin.em, + * emultempl/cr16elf.em, * emultempl/crxelf.em, + * emultempl/cskyelf.em, * emultempl/elf.em, * emultempl/genelf.em, + * emultempl/hppaelf.em, * emultempl/linux.em, + * emultempl/m68hc1xelf.em, * emultempl/metagelf.em, + * emultempl/mipself.em, * emultempl/mmix-elfnmmo.em, + * emultempl/mmixelf.em, * emultempl/mmo.em, * emultempl/msp430.em, + * emultempl/nios2elf.em, * emultempl/pdp11.em, * emultempl/pe.em, + * emultempl/pep.em, * emultempl/ppc32elf.em, + * emultempl/ppc64elf.em, * emultempl/rxelf.em, + * emultempl/rxlinux.em, * emultempl/scoreelf.em, + * emultempl/solaris2.em, * emultempl/spuelf.em, + * emultempl/ticoff.em, * emultempl/v850elf.em, * emultempl/vms.em, + * emultempl/xtensaelf.em, * emultempl/z80.em, * ld.h, + * ldbuildid.c, * ldbuildid.h, * ldcref.c, * ldctor.c, * ldctor.h, + * ldelf.c, * ldelf.h, * ldelfgen.c, * ldelfgen.h, * ldemul.c, + * ldemul.h, * ldexp.c, * ldexp.h, * ldfile.c, * ldfile.h, + * ldgram.y, * ldlang.c, * ldlang.h, * ldmain.c, * ldmain.h, + * ldmisc.c, * ldmisc.h, * ldwrite.c, * lexsup.c, * mri.c, + * pe-dll.c, * pe-dll.h, * pep-dll.h, * plugin.c, * plugin.h, + * testplug.c, * testplug2.c, * testplug3.c, * testplug4.c: Replace + bfd_boolean with bool, FALSE with false, and TRUE with true. + * configure: Regenerate. + 2021-03-31 Alan Modra * elf-hints-local.h: Include stdint.h in place of bfd_stdint.h. diff --git a/ld/configure b/ld/configure index 551bc720377..9eacaddab6b 100755 --- a/ld/configure +++ b/ld/configure @@ -17613,16 +17613,16 @@ _ACEOF fi fi -elf_list_options=FALSE -elf_shlib_list_options=FALSE -elf_plt_unwind_list_options=FALSE +elf_list_options=false +elf_shlib_list_options=false +elf_plt_unwind_list_options=false for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'` do if test "$targ_alias" = "all"; then all_targets=true - elf_list_options=TRUE - elf_shlib_list_options=TRUE - elf_plt_unwind_list_options=TRUE + elf_list_options=true + elf_shlib_list_options=true + elf_plt_unwind_list_options=true else # Canonicalize the secondary target names. result=`$ac_config_sub $targ_alias 2>/dev/null` @@ -17658,25 +17658,25 @@ do tdir_$i=$result" case "${i}" in *elf*) - elf_list_options=TRUE + elf_list_options=true ;; *) if $GREP "TEMPLATE_NAME=elf" ${srcdir}/emulparams/${i}.sh >/dev/null 2>/dev/null; then - elf_list_options=TRUE + elf_list_options=true fi ;; esac - if test "$elf_list_options" = "TRUE"; then + if test "$elf_list_options" = "true"; then source_sh() { . $1 } source_sh ${srcdir}/emulparams/${i}.sh if test x${GENERATE_SHLIB_SCRIPT} = xyes; then - elf_shlib_list_options=TRUE + elf_shlib_list_options=true fi if test x${PLT_UNWIND} = xyes; then - elf_plt_unwind_list_options=TRUE + elf_plt_unwind_list_options=true fi fi ;; diff --git a/ld/configure.ac b/ld/configure.ac index 767eda83413..19a5df12c95 100644 --- a/ld/configure.ac +++ b/ld/configure.ac @@ -359,16 +359,16 @@ if test x${want64} = xfalse; then fi fi -elf_list_options=FALSE -elf_shlib_list_options=FALSE -elf_plt_unwind_list_options=FALSE +elf_list_options=false +elf_shlib_list_options=false +elf_plt_unwind_list_options=false for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'` do if test "$targ_alias" = "all"; then all_targets=true - elf_list_options=TRUE - elf_shlib_list_options=TRUE - elf_plt_unwind_list_options=TRUE + elf_list_options=true + elf_shlib_list_options=true + elf_plt_unwind_list_options=true else # Canonicalize the secondary target names. result=`$ac_config_sub $targ_alias 2>/dev/null` @@ -404,25 +404,25 @@ do tdir_$i=$result" case "${i}" in *elf*) - elf_list_options=TRUE + elf_list_options=true ;; *) if $GREP "TEMPLATE_NAME=elf" ${srcdir}/emulparams/${i}.sh >/dev/null 2>/dev/null; then - elf_list_options=TRUE + elf_list_options=true fi ;; esac - if test "$elf_list_options" = "TRUE"; then + if test "$elf_list_options" = "true"; then source_sh() { . $1 } source_sh ${srcdir}/emulparams/${i}.sh if test x${GENERATE_SHLIB_SCRIPT} = xyes; then - elf_shlib_list_options=TRUE + elf_shlib_list_options=true fi if test x${PLT_UNWIND} = xyes; then - elf_plt_unwind_list_options=TRUE + elf_plt_unwind_list_options=true fi fi ;; diff --git a/ld/emulparams/call_nop.sh b/ld/emulparams/call_nop.sh index b1e2e73cbf8..2c3c305f0e8 100644 --- a/ld/emulparams/call_nop.sh +++ b/ld/emulparams/call_nop.sh @@ -7,12 +7,12 @@ PARSE_AND_LIST_ARGS_CASE_Z_CALL_NOP=' { if (strcmp (optarg + 9, "prefix-addr") == 0) { - params.call_nop_as_suffix = FALSE; + params.call_nop_as_suffix = false; params.call_nop_byte = 0x67; } else if (strcmp (optarg + 9, "suffix-nop") == 0) { - params.call_nop_as_suffix = TRUE; + params.call_nop_as_suffix = true; params.call_nop_byte = 0x90; } else if (strncmp (optarg + 9, "prefix-", 7) == 0) @@ -22,7 +22,7 @@ PARSE_AND_LIST_ARGS_CASE_Z_CALL_NOP=' if (*end) einfo (_("%F%P: invalid number for -z call-nop=prefix-: %s\n"), optarg + 16); - params.call_nop_as_suffix = FALSE; + params.call_nop_as_suffix = false; } else if (strncmp (optarg + 9, "suffix-", 7) == 0) { @@ -31,7 +31,7 @@ PARSE_AND_LIST_ARGS_CASE_Z_CALL_NOP=' if (*end) einfo (_("%F%P: invalid number for -z call-nop=suffix-: %s\n"), optarg + 16); - params.call_nop_as_suffix = TRUE; + params.call_nop_as_suffix = true; } else einfo (_("%F%P: unsupported option: -z %s\n"), optarg); diff --git a/ld/emulparams/cet.sh b/ld/emulparams/cet.sh index d9e81df6954..2c627994501 100644 --- a/ld/emulparams/cet.sh +++ b/ld/emulparams/cet.sh @@ -11,11 +11,11 @@ PARSE_AND_LIST_OPTIONS_CET=' ' PARSE_AND_LIST_ARGS_CASE_Z_CET=' else if (strcmp (optarg, "ibtplt") == 0) - params.ibtplt = TRUE; + params.ibtplt = true; else if (strcmp (optarg, "ibt") == 0) - params.ibt = TRUE; + params.ibt = true; else if (strcmp (optarg, "shstk") == 0) - params.shstk = TRUE; + params.shstk = true; else if (strncmp (optarg, "cet-report=", 11) == 0) { if (strcmp (optarg + 11, "none") == 0) diff --git a/ld/emulparams/dynamic_undefined_weak.sh b/ld/emulparams/dynamic_undefined_weak.sh index a20bbd409a6..21393d40d26 100644 --- a/ld/emulparams/dynamic_undefined_weak.sh +++ b/ld/emulparams/dynamic_undefined_weak.sh @@ -6,9 +6,9 @@ PARSE_AND_LIST_OPTIONS_DYNAMIC_UNDEFINED_WEAK=' PARSE_AND_LIST_ARGS_CASE_Z_DYNAMIC_UNDEFINED_WEAK=' else if (strcmp (optarg, "dynamic-undefined-weak") == 0) - link_info.dynamic_undefined_weak = TRUE; + link_info.dynamic_undefined_weak = true; else if (strcmp (optarg, "nodynamic-undefined-weak") == 0) - link_info.dynamic_undefined_weak = FALSE; + link_info.dynamic_undefined_weak = false; ' PARSE_AND_LIST_OPTIONS="$PARSE_AND_LIST_OPTIONS $PARSE_AND_LIST_OPTIONS_DYNAMIC_UNDEFINED_WEAK" diff --git a/ld/emulparams/elf32b4300.sh b/ld/emulparams/elf32b4300.sh index f35153336aa..4b1921c2297 100644 --- a/ld/emulparams/elf32b4300.sh +++ b/ld/emulparams/elf32b4300.sh @@ -6,4 +6,4 @@ source_sh ${srcdir}/emulparams/elf32bmip.sh TEXT_START_ADDR=0xa0020000 unset SHLIB_TEXT_START_ADDR EXECUTABLE_SYMBOLS='_DYNAMIC_LINK = 0;' -DYNAMIC_LINK=FALSE +DYNAMIC_LINK=false diff --git a/ld/emulparams/elf32lm32.sh b/ld/emulparams/elf32lm32.sh index 0db2a4f8dfb..fde662907c7 100644 --- a/ld/emulparams/elf32lm32.sh +++ b/ld/emulparams/elf32lm32.sh @@ -6,5 +6,5 @@ MAXPAGESIZE=0x1000 EMBEDDED=yes TEMPLATE_NAME=elf TEXT_START_ADDR=0x0000 -DYNAMIC_LINK=FALSE +DYNAMIC_LINK=false ALIGNMENT=4 diff --git a/ld/emulparams/elf32lr5900.sh b/ld/emulparams/elf32lr5900.sh index a06a666695a..7b725693de9 100644 --- a/ld/emulparams/elf32lr5900.sh +++ b/ld/emulparams/elf32lr5900.sh @@ -9,7 +9,7 @@ ARCH=mips:5900 MACHINE= MAXPAGESIZE=128 EMBEDDED=yes -DYNAMIC_LINK=FALSE +DYNAMIC_LINK=false unset DATA_ADDR SHLIB_TEXT_START_ADDR=0 diff --git a/ld/emulparams/elf32lr5900n32.sh b/ld/emulparams/elf32lr5900n32.sh index 56529d33421..29209dfaa6c 100644 --- a/ld/emulparams/elf32lr5900n32.sh +++ b/ld/emulparams/elf32lr5900n32.sh @@ -9,7 +9,7 @@ ARCH=mips:5900 MACHINE= MAXPAGESIZE=128 EMBEDDED=yes -DYNAMIC_LINK=FALSE +DYNAMIC_LINK=false OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)' OTHER_SECTIONS=" diff --git a/ld/emulparams/elf32visium.sh b/ld/emulparams/elf32visium.sh index f362ae3f82c..e8b879c82c9 100644 --- a/ld/emulparams/elf32visium.sh +++ b/ld/emulparams/elf32visium.sh @@ -6,4 +6,4 @@ NONPAGED_TEXT_START_ADDR=0x10000 ARCH=visium MACHINE= TEMPLATE_NAME=elf -DYNAMIC_LINK=FALSE +DYNAMIC_LINK=false diff --git a/ld/emulparams/elf_x86_64.sh b/ld/emulparams/elf_x86_64.sh index 6e31d2242cd..48d0974711b 100644 --- a/ld/emulparams/elf_x86_64.sh +++ b/ld/emulparams/elf_x86_64.sh @@ -52,7 +52,7 @@ case "$target" in ' PARSE_AND_LIST_ARGS_CASE_Z_BNDPLT=' else if (strcmp (optarg, "bndplt") == 0) - params.bndplt = TRUE; + params.bndplt = true; ' PARSE_AND_LIST_OPTIONS="$PARSE_AND_LIST_OPTIONS $PARSE_AND_LIST_OPTIONS_BNDPLT" PARSE_AND_LIST_ARGS_CASE_Z="$PARSE_AND_LIST_ARGS_CASE_Z $PARSE_AND_LIST_ARGS_CASE_Z_BNDPLT" diff --git a/ld/emulparams/extern_protected_data.sh b/ld/emulparams/extern_protected_data.sh index 65c68adb0b2..30f3d1cdee5 100644 --- a/ld/emulparams/extern_protected_data.sh +++ b/ld/emulparams/extern_protected_data.sh @@ -5,7 +5,7 @@ PARSE_AND_LIST_OPTIONS_NOEXTEN_PROTECTED_DATA=' PARSE_AND_LIST_ARGS_CASE_Z_NOEXTEN_PROTECTED_DATA=' else if (strcmp (optarg, "noextern-protected-data") == 0) - link_info.extern_protected_data = FALSE; + link_info.extern_protected_data = false; ' diff --git a/ld/emulparams/plt_unwind.sh b/ld/emulparams/plt_unwind.sh index 38d76683efa..ab16156415e 100644 --- a/ld/emulparams/plt_unwind.sh +++ b/ld/emulparams/plt_unwind.sh @@ -14,10 +14,10 @@ PARSE_AND_LIST_LONGOPTS=' PARSE_AND_LIST_ARGS_CASES=' case OPTION_LD_GENERATED_UNWIND_INFO: - link_info.no_ld_generated_unwind_info = FALSE; + link_info.no_ld_generated_unwind_info = false; break; case OPTION_NO_LD_GENERATED_UNWIND_INFO: - link_info.no_ld_generated_unwind_info = TRUE; + link_info.no_ld_generated_unwind_info = true; break; ' diff --git a/ld/emulparams/reloc_overflow.sh b/ld/emulparams/reloc_overflow.sh index 6bf0abced7c..248143711c9 100644 --- a/ld/emulparams/reloc_overflow.sh +++ b/ld/emulparams/reloc_overflow.sh @@ -4,7 +4,7 @@ PARSE_AND_LIST_OPTIONS_RELOC_OVERFLOW=' ' PARSE_AND_LIST_ARGS_CASE_Z_RELOC_OVERFLOW=' else if (strcmp (optarg, "noreloc-overflow") == 0) - params.no_reloc_overflow_check = TRUE; + params.no_reloc_overflow_check = true; ' PARSE_AND_LIST_OPTIONS="$PARSE_AND_LIST_OPTIONS $PARSE_AND_LIST_OPTIONS_RELOC_OVERFLOW" diff --git a/ld/emulparams/static.sh b/ld/emulparams/static.sh index 410839b8a56..295251e38e9 100644 --- a/ld/emulparams/static.sh +++ b/ld/emulparams/static.sh @@ -1,12 +1,12 @@ PARSE_AND_LIST_ARGS_CASES="$PARSE_AND_LIST_ARGS_CASES case OPTION_DYNAMIC_LINKER: - params.has_dynamic_linker = TRUE; - return FALSE; + params.has_dynamic_linker = true; + return false; case OPTION_NON_SHARED: /* Check if -static is passed at command-line before all input files. */ if (!lang_has_input_file) - params.static_before_all_inputs = TRUE; - return FALSE; + params.static_before_all_inputs = true; + return false; " diff --git a/ld/emulparams/x86-64-lam.sh b/ld/emulparams/x86-64-lam.sh index 40ddb053214..fab42ff1df2 100644 --- a/ld/emulparams/x86-64-lam.sh +++ b/ld/emulparams/x86-64-lam.sh @@ -15,7 +15,7 @@ PARSE_AND_LIST_OPTIONS_LAM=' ' PARSE_AND_LIST_ARGS_CASE_Z_LAM=' else if (strcmp (optarg, "lam-u48") == 0) - params.lam_u48 = TRUE; + params.lam_u48 = true; else if (strncmp (optarg, "lam-u48-report=", 15) == 0) { if (strcmp (optarg + 15, "none") == 0) @@ -29,7 +29,7 @@ PARSE_AND_LIST_ARGS_CASE_Z_LAM=' optarg + 15); } else if (strcmp (optarg, "lam-u57") == 0) - params.lam_u57 = TRUE; + params.lam_u57 = true; else if (strncmp (optarg, "lam-u57-report=", 15) == 0) { if (strcmp (optarg + 15, "none") == 0) diff --git a/ld/emultempl/aarch64elf.em b/ld/emultempl/aarch64elf.em index a1855607327..4e1d8f8a240 100644 --- a/ld/emultempl/aarch64elf.em +++ b/ld/emultempl/aarch64elf.em @@ -43,10 +43,10 @@ gld${EMULATION_NAME}_before_parse (void) #ifndef TARGET_ /* I.e., if not generic. */ ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown); #endif /* not TARGET_ */ - input_flags.dynamic = ${DYNAMIC_LINK-TRUE}; - config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`; - config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`; - link_info.check_relocs_after_open_input = TRUE; + input_flags.dynamic = ${DYNAMIC_LINK-true}; + config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`; + config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo true ; else echo false ; fi`; + link_info.check_relocs_after_open_input = true; EOF if test -n "$COMMONPAGESIZE"; then fragment <header.next) { @@ -136,7 +136,7 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp) after its associated input section. */ *(info->add.tail) = l->header.next; l->header.next = info->add.head; - return TRUE; + return true; } break; @@ -157,7 +157,7 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp) break; } } - return FALSE; + return false; } @@ -213,7 +213,7 @@ gldaarch64_layout_sections_again (void) /* If we have changed sizes of the stub sections, then we need to recalculate all the section offsets. This may mean we need to add even more stubs. */ - ldelf_map_segments (TRUE); + ldelf_map_segments (true); need_laying_out = -1; } diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em index bea8c1d4dc5..8ea3c165a70 100644 --- a/ld/emultempl/aix.em +++ b/ld/emultempl/aix.em @@ -58,7 +58,7 @@ fragment <filename, FOPEN_RT); if (e == NULL) - return FALSE; + return false; - ret = FALSE; + ret = false; if (getc (e) == '#' && getc (e) == '!') { @@ -669,8 +669,8 @@ gld${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry) flpp = &(*flpp)->next; *flpp = n; - ret = TRUE; - entry->flags.loaded = TRUE; + ret = true; + entry->flags.loaded = true; } fclose (e); @@ -744,12 +744,12 @@ gld${EMULATION_NAME}_before_allocation (void) /* Handle the import and export files, if any. */ for (fl = import_files; fl != NULL; fl = fl->next) - gld${EMULATION_NAME}_read_file (fl->name, TRUE); + gld${EMULATION_NAME}_read_file (fl->name, true); for (el = export_symbols; el != NULL; el = el->next) { struct bfd_link_hash_entry *h; - h = bfd_link_hash_lookup (link_info.hash, el->name, FALSE, FALSE, FALSE); + h = bfd_link_hash_lookup (link_info.hash, el->name, false, false, false); if (h == NULL) einfo (_("%F%P: bfd_link_hash_lookup of export symbol failed: %E\n")); if (!bfd_xcoff_export_symbol (link_info.output_bfd, &link_info, h)) @@ -833,8 +833,8 @@ gld${EMULATION_NAME}_before_allocation (void) /* Let the XCOFF backend set up the .loader section. */ if (!bfd_xcoff_size_dynamic_sections - (link_info.output_bfd, &link_info, libpath, entry_symbol.name, file_align, - maxstack, maxdata, gc && !unix_ld, + (link_info.output_bfd, &link_info, libpath, entry_symbol.name, + file_align, maxstack, maxdata, gc && !unix_ld, modtype, textro, flags, special_sections, rtld)) einfo (_("%F%P: failed to set dynamic section sizes: %E\n")); @@ -847,7 +847,7 @@ gld${EMULATION_NAME}_before_allocation (void) lang_statement_union_type **pls; lang_input_section_type *is; const char *oname; - bfd_boolean start; + bool start; sec = special_sections[i]; if (sec == NULL) @@ -907,32 +907,32 @@ gld${EMULATION_NAME}_before_allocation (void) case XCOFF_SPECIAL_SECTION_TEXT: /* _text */ oname = ".text"; - start = TRUE; + start = true; break; case XCOFF_SPECIAL_SECTION_ETEXT: /* _etext */ oname = ".text"; - start = FALSE; + start = false; break; case XCOFF_SPECIAL_SECTION_DATA: /* _data */ oname = ".data"; - start = TRUE; + start = true; break; case XCOFF_SPECIAL_SECTION_EDATA: /* _edata */ oname = ".data"; - start = FALSE; + start = false; break; case XCOFF_SPECIAL_SECTION_END: case XCOFF_SPECIAL_SECTION_END2: /* _end and end */ oname = ".bss"; - start = FALSE; + start = false; break; } @@ -983,7 +983,7 @@ gld${EMULATION_NAME}_before_allocation (void) { expld.phase = lang_mark_phase_enum; expld.dataseg.phase = exp_seg_none; - one_lang_size_sections_pass (NULL, FALSE); + one_lang_size_sections_pass (NULL, false); lang_reset_memory_regions (); } @@ -1129,13 +1129,13 @@ is_syscall (char *input, unsigned int *flag) this is called by the handle_option emulation routine. */ static void -gld${EMULATION_NAME}_read_file (const char *filename, bfd_boolean import) +gld${EMULATION_NAME}_read_file (const char *filename, bool import) { struct obstack *o; FILE *f; int lineno; int c; - bfd_boolean keep; + bool keep; const char *imppath; const char *impfile; const char *impmember; @@ -1151,7 +1151,7 @@ gld${EMULATION_NAME}_read_file (const char *filename, bfd_boolean import) return; } - keep = FALSE; + keep = false; imppath = NULL; impfile = NULL; @@ -1218,7 +1218,7 @@ gld${EMULATION_NAME}_read_file (const char *filename, bfd_boolean import) char *start; (void) obstack_finish (o); - keep = TRUE; + keep = true; start = s; while (!ISSPACE (*s) && *s != '(' && *s != '\0') ++s; @@ -1314,7 +1314,7 @@ gld${EMULATION_NAME}_read_file (const char *filename, bfd_boolean import) { struct export_symbol_list *n; - ldlang_add_undef (symname, TRUE); + ldlang_add_undef (symname, true); n = ((struct export_symbol_list *) xmalloc (sizeof (struct export_symbol_list))); n->next = export_symbols; @@ -1323,8 +1323,8 @@ gld${EMULATION_NAME}_read_file (const char *filename, bfd_boolean import) } else { - h = bfd_link_hash_lookup (link_info.hash, symname, FALSE, FALSE, - TRUE); + h = bfd_link_hash_lookup (link_info.hash, symname, false, false, + true); if (h == NULL || h->type == bfd_link_hash_new) { /* We can just ignore attempts to import an unreferenced @@ -1403,7 +1403,7 @@ gld${EMULATION_NAME}_find_exp_assignment (etree_type *exp) case etree_provide: case etree_provided: h = bfd_link_hash_lookup (link_info.hash, exp->assign.dst, - FALSE, FALSE, FALSE); + false, false, false); if (h == NULL) break; /* Fall through. */ @@ -1543,7 +1543,7 @@ gld${EMULATION_NAME}_set_output_arch (void) ldfile_output_machine_name = bfd_printable_name (link_info.output_bfd); } -static bfd_boolean +static bool gld${EMULATION_NAME}_open_dynamic_archive (const char *arch, search_dirs_type *search, lang_input_statement_type *entry) @@ -1551,7 +1551,7 @@ gld${EMULATION_NAME}_open_dynamic_archive (const char *arch, char *path; if (!entry->flags.maybe_archive) - return FALSE; + return false; if (entry->flags.full_name_provided) path = concat (search->name, "/", entry->filename, @@ -1563,16 +1563,16 @@ gld${EMULATION_NAME}_open_dynamic_archive (const char *arch, if (!ldfile_try_open_bfd (path, entry)) { free (path); - return FALSE; + return false; } /* Don't include the searched directory in the import path. */ bfd_xcoff_set_archive_import_path (&link_info, entry->the_bfd, path + strlen (search->name) + 1); entry->filename = path; - return TRUE; + return true; } -static bfd_boolean +static bool gld${EMULATION_NAME}_print_symbol (struct bfd_link_hash_entry *hash_entry, void *ptr) { @@ -1599,7 +1599,7 @@ gld${EMULATION_NAME}_print_symbol (struct bfd_link_hash_entry *hash_entry, minfo (" %pT\n", hash_entry->root.string); } - return TRUE; + return true; } struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = { diff --git a/ld/emultempl/alphaelf.em b/ld/emultempl/alphaelf.em index 7fed9968dd7..0e2416cd69f 100644 --- a/ld/emultempl/alphaelf.em +++ b/ld/emultempl/alphaelf.em @@ -28,9 +28,9 @@ fragment < Set the entry point to be Thumb symbol \n")); } -static bfd_boolean +static bool gld${EMULATION_NAME}_handle_option (int optc) { switch (optc) { default: - return FALSE; + return false; case OPTION_SUPPORT_OLD_CODE: support_old_code = 1; @@ -91,7 +91,7 @@ gld${EMULATION_NAME}_handle_option (int optc) break; } - return TRUE; + return true; } static void @@ -164,7 +164,7 @@ gld${EMULATION_NAME}_finish (void) struct bfd_link_hash_entry * h; h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol, - FALSE, FALSE, TRUE); + false, false, true); if (h != (struct bfd_link_hash_entry *) NULL && (h->type == bfd_link_hash_defined diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em index a4cf93b493d..bcb60d252ce 100644 --- a/ld/emultempl/armelf.em +++ b/ld/emultempl/armelf.em @@ -56,10 +56,10 @@ gld${EMULATION_NAME}_before_parse (void) #ifndef TARGET_ /* I.e., if not generic. */ ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown); #endif /* not TARGET_ */ - input_flags.dynamic = ${DYNAMIC_LINK-TRUE}; - config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`; - config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`; - link_info.check_relocs_after_open_input = TRUE; + input_flags.dynamic = ${DYNAMIC_LINK-true}; + config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`; + config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo true ; else echo false ; fi`; + link_info.check_relocs_after_open_input = true; EOF if test -n "$COMMONPAGESIZE"; then fragment <header.next) { @@ -191,7 +191,7 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp) after its associated input section. */ *(info->add.tail) = l->header.next; l->header.next = info->add.head; - return TRUE; + return true; } break; @@ -212,7 +212,7 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp) break; } } - return FALSE; + return false; } @@ -284,7 +284,7 @@ gldarm_layout_sections_again (void) /* If we have changed sizes of the stub sections, then we need to recalculate all the section offsets. This may mean we need to add even more stubs. */ - ldelf_map_segments (TRUE); + ldelf_map_segments (true); need_laying_out = -1; } @@ -457,7 +457,7 @@ gld${EMULATION_NAME}_finish (void) if (params.thumb_entry_symbol) { h = bfd_link_hash_lookup (link_info.hash, params.thumb_entry_symbol, - FALSE, FALSE, TRUE); + false, false, true); } else { @@ -467,7 +467,7 @@ gld${EMULATION_NAME}_finish (void) return; h = bfd_link_hash_lookup (link_info.hash, entry_symbol.name, - FALSE, FALSE, TRUE); + false, false, true); eh = (struct elf_link_hash_entry *)h; if (!h || ARM_GET_SYM_BRANCH_TYPE (eh->target_internal) != ST_BRANCH_TO_THUMB) diff --git a/ld/emultempl/avrelf.em b/ld/emultempl/avrelf.em index 56256a13bb3..eb01c8f2e0a 100644 --- a/ld/emultempl/avrelf.em +++ b/ld/emultempl/avrelf.em @@ -39,10 +39,10 @@ static asection *avr_stub_section; /* Variables set by the command-line parameters and transferred to the bfd without use of global shared variables. */ -static bfd_boolean avr_no_stubs = FALSE; -static bfd_boolean avr_debug_relax = FALSE; -static bfd_boolean avr_debug_stubs = FALSE; -static bfd_boolean avr_replace_call_ret_sequences = TRUE; +static bool avr_no_stubs = false; +static bool avr_debug_relax = false; +static bool avr_debug_stubs = false; +static bool avr_replace_call_ret_sequences = true; static bfd_vma avr_pc_wrap_around = 0x10000000; /* Transfers information to the bfd frontend. */ @@ -73,7 +73,7 @@ avr_elf_${EMULATION_NAME}_before_allocation (void) if (bfd_get_flavour (link_info.output_bfd) != bfd_target_elf_flavour) { - avr_no_stubs = TRUE; + avr_no_stubs = true; return; } @@ -81,14 +81,14 @@ avr_elf_${EMULATION_NAME}_before_allocation (void) if (strcmp ("${EMULATION_NAME}", "avr6") != 0 && strcmp ("${EMULATION_NAME}", "avrxmega6") != 0 && strcmp ("${EMULATION_NAME}", "avrxmega7") != 0) - avr_no_stubs = TRUE; + avr_no_stubs = true; avr_elf_set_global_bfd_parameters (); /* If generating a relocatable output file, then we don't have to generate the trampolines. */ if (bfd_link_relocatable (&link_info)) - avr_no_stubs = TRUE; + avr_no_stubs = true; if (avr_no_stubs) return; @@ -102,7 +102,7 @@ avr_elf_${EMULATION_NAME}_before_allocation (void) return; /* Call into the BFD backend to do the real "stub"-work. */ - if (! elf32_avr_size_stubs (link_info.output_bfd, &link_info, TRUE)) + if (! elf32_avr_size_stubs (link_info.output_bfd, &link_info, true)) einfo (_("%X%P: can not size stub section: %E\n")); } @@ -165,7 +165,7 @@ avr_elf_after_allocation (void) { /* If relaxing, elf32_avr_size_stubs will be called from elf32_avr_relax_section. */ - if (!elf32_avr_size_stubs (link_info.output_bfd, &link_info, TRUE)) + if (!elf32_avr_size_stubs (link_info.output_bfd, &link_info, true)) einfo (_("%X%P: can not size stub section: %E\n")); } @@ -184,7 +184,7 @@ avr_elf_before_parse (void) { /* Don't create a demand-paged executable, since this feature isn't meaningful in AVR. */ - config.magic_demand_paged = FALSE; + config.magic_demand_paged = false; gld${EMULATION_NAME}_before_parse (); } @@ -193,11 +193,11 @@ static void avr_finish (void) { bfd *abfd; - bfd_boolean avr_link_relax; + bool avr_link_relax; if (bfd_link_relocatable (&link_info)) { - avr_link_relax = TRUE; + avr_link_relax = true; for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link.next) { /* Don't let the linker stubs prevent the final object being @@ -206,7 +206,7 @@ avr_finish (void) & EF_AVR_LINKRELAX_PREPARED) == 0 && abfd != stub_file->the_bfd) { - avr_link_relax = FALSE; + avr_link_relax = false; break; } } @@ -296,26 +296,26 @@ PARSE_AND_LIST_ARGS_CASES=' else if ((!strcmp (optarg,"64k")) || (!strcmp (optarg,"64K"))) avr_pc_wrap_around = 0x10000; else - return FALSE; + return false; } break; case OPTION_DEBUG_STUBS: - avr_debug_stubs = TRUE; + avr_debug_stubs = true; break; case OPTION_DEBUG_RELAX: - avr_debug_relax = TRUE; + avr_debug_relax = true; break; case OPTION_NO_STUBS: - avr_no_stubs = TRUE; + avr_no_stubs = true; break; case OPTION_NO_CALL_RET_REPLACEMENT: { /* This variable is defined in the bfd library. */ - avr_replace_call_ret_sequences = FALSE; + avr_replace_call_ret_sequences = false; } break; ' diff --git a/ld/emultempl/beos.em b/ld/emultempl/beos.em index d984d3dd198..2de34482e91 100644 --- a/ld/emultempl/beos.em +++ b/ld/emultempl/beos.em @@ -260,13 +260,13 @@ set_pe_stack_heap (char *resname, char *comname) } -static bfd_boolean +static bool gld${EMULATION_NAME}_handle_option (int optc) { switch (optc) { default: - return FALSE; + return false; case OPTION_BASE_FILE: link_info.base_file = fopen (optarg, FOPEN_WB); @@ -315,7 +315,7 @@ gld${EMULATION_NAME}_handle_option (int optc) set_pe_value ("__image_base__"); break; } - return TRUE; + return true; } /* Assign values to the special symbols before the linker script is @@ -349,7 +349,7 @@ gld_${EMULATION_NAME}_set_symbols (void) { long val = init[j].value; lang_add_assignment (exp_assign (init[j].symbol, exp_intop (val), - FALSE)); + false)); if (init[j].size == sizeof(short)) *(short *)init[j].ptr = val; else if (init[j].size == sizeof(int)) @@ -678,7 +678,7 @@ gld${EMULATION_NAME}_place_orphan (asection *s, output_secname = xstrdup (secname); ps = strchr (output_secname + 1, '\$'); *ps = 0; - os = lang_output_section_statement_lookup (output_secname, constraint, TRUE); + os = lang_output_section_statement_lookup (output_secname, constraint, true); /* Find the '\$' wild statement for this section. We currently require the linker script to explicitly mention "*(.foo\$)". */ diff --git a/ld/emultempl/bfin.em b/ld/emultempl/bfin.em index 54325e2c9a9..dfe4b665a20 100644 --- a/ld/emultempl/bfin.em +++ b/ld/emultempl/bfin.em @@ -28,10 +28,10 @@ fragment <header.next, l = *lp) switch (l->header.type) @@ -89,7 +89,7 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp) after its associated input section. */ *(info->add.tail) = l->header.next; l->header.next = info->add.head; - return TRUE; + return true; } break; @@ -110,7 +110,7 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp) break; } - return FALSE; + return false; } EOF @@ -121,7 +121,7 @@ fragment <header.next) { @@ -142,7 +142,7 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp) before its associated input section. */ *lp = info->add.head; *(info->add.tail) = l; - return TRUE; + return true; } break; @@ -163,7 +163,7 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp) break; } } - return FALSE; + return false; } @@ -215,7 +215,7 @@ hppaelf_layout_sections_again (void) /* If we have changed sizes of the stub sections, then we need to recalculate all the section offsets. This may mean we need to add even more stubs. */ - ldelf_map_segments (TRUE); + ldelf_map_segments (true); need_laying_out = -1; } diff --git a/ld/emultempl/linux.em b/ld/emultempl/linux.em index c16bc683dd8..e4d87bc69e0 100644 --- a/ld/emultempl/linux.em +++ b/ld/emultempl/linux.em @@ -49,9 +49,9 @@ static void gld${EMULATION_NAME}_before_parse (void) { ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`); - input_flags.dynamic = TRUE; - config.has_shared = TRUE; - link_info.check_relocs_after_open_input = TRUE; + input_flags.dynamic = true; + config.has_shared = true; + link_info.check_relocs_after_open_input = true; EOF if test -n "$COMMONPAGESIZE"; then fragment <flags.maybe_archive || entry->flags.full_name_provided) - return FALSE; + return false; string = (char *) xmalloc (strlen (search->name) + strlen (entry->filename) @@ -83,12 +83,12 @@ gld${EMULATION_NAME}_open_dynamic_archive if (! ldfile_try_open_bfd (string, entry)) { free (string); - return FALSE; + return false; } entry->filename = string; - return TRUE; + return true; } /* This is called by the create_output_section_statements routine via diff --git a/ld/emultempl/m68hc1xelf.em b/ld/emultempl/m68hc1xelf.em index 212db7c4e10..480d1b7d8f3 100644 --- a/ld/emultempl/m68hc1xelf.em +++ b/ld/emultempl/m68hc1xelf.em @@ -105,7 +105,7 @@ m68hc11_elf_${EMULATION_NAME}_before_allocation (void) But for 68HC11 this is board specific. The definition of such memory region allows one to control how this paged memory is accessed. */ - region = lang_memory_region_lookup (bank_window_name, FALSE); + region = lang_memory_region_lookup (bank_window_name, false); /* Check the length to see if it was defined in the script. */ if (region->length != 0) @@ -175,11 +175,11 @@ struct hook_stub_info /* Traverse the linker tree to find the spot where the stub goes. */ -static bfd_boolean +static bool hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp) { lang_statement_union_type *l; - bfd_boolean ret; + bool ret; for (; (l = *lp) != NULL; lp = &l->header.next) { @@ -219,7 +219,7 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp) before its associated input section. */ *lp = info->add.head; *(info->add.tail) = l; - return TRUE; + return true; } break; @@ -240,7 +240,7 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp) break; } } - return FALSE; + return false; } diff --git a/ld/emultempl/metagelf.em b/ld/emultempl/metagelf.em index 41ada3fbebb..96bffbc8a9e 100644 --- a/ld/emultempl/metagelf.em +++ b/ld/emultempl/metagelf.em @@ -76,11 +76,11 @@ struct hook_stub_info /* Traverse the linker tree to find the spot where the stub goes. */ -static bfd_boolean +static bool hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp) { lang_statement_union_type *l; - bfd_boolean ret; + bool ret; for (; (l = *lp) != NULL; lp = &l->header.next) { @@ -118,7 +118,7 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp) before its associated input section. */ *lp = info->add.head; *(info->add.tail) = l; - return TRUE; + return true; } break; @@ -139,7 +139,7 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp) break; } } - return FALSE; + return false; } @@ -191,7 +191,7 @@ metagelf_layout_sections_again (void) /* If we have changed sizes of the stub sections, then we need to recalculate all the section offsets. This may mean we need to add even more stubs. */ - ldelf_map_segments (TRUE); + ldelf_map_segments (true); need_laying_out = -1; } diff --git a/ld/emultempl/mipself.em b/ld/emultempl/mipself.em index e27e53cf556..8f28fcd22ee 100644 --- a/ld/emultempl/mipself.em +++ b/ld/emultempl/mipself.em @@ -20,10 +20,10 @@ case ${target} in *-*-*gnu*) - gnu_target=TRUE + gnu_target=true ;; *) - gnu_target=FALSE + gnu_target=false ;; esac @@ -42,9 +42,9 @@ fragment <header.next) { @@ -97,7 +97,7 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp) before its associated input section. */ *lp = info->add.head; *(info->add.tail) = l; - return TRUE; + return true; } break; @@ -118,7 +118,7 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp) break; } } - return FALSE; + return false; } /* Create a new stub section called STUB_SEC_NAME and arrange for it to @@ -278,27 +278,27 @@ PARSE_AND_LIST_OPTIONS=' PARSE_AND_LIST_ARGS_CASES=' case OPTION_INSN32: - insn32 = TRUE; + insn32 = true; break; case OPTION_NO_INSN32: - insn32 = FALSE; + insn32 = false; break; case OPTION_IGNORE_BRANCH_ISA: - ignore_branch_isa = TRUE; + ignore_branch_isa = true; break; case OPTION_NO_IGNORE_BRANCH_ISA: - ignore_branch_isa = FALSE; + ignore_branch_isa = false; break; case OPTION_COMPACT_BRANCHES: - compact_branches = TRUE; + compact_branches = true; break; case OPTION_NO_COMPACT_BRANCHES: - compact_branches = FALSE; + compact_branches = false; break; ' diff --git a/ld/emultempl/mmix-elfnmmo.em b/ld/emultempl/mmix-elfnmmo.em index f8202238e2d..a88fc5a6596 100644 --- a/ld/emultempl/mmix-elfnmmo.em +++ b/ld/emultempl/mmix-elfnmmo.em @@ -30,7 +30,7 @@ static void gld${EMULATION_NAME}_before_parse (void); static void mmix_before_parse (void) { - link_info.check_relocs_after_open_input = TRUE; + link_info.check_relocs_after_open_input = true; gld${EMULATION_NAME}_before_parse (); } diff --git a/ld/emultempl/mmixelf.em b/ld/emultempl/mmixelf.em index 23a501e3962..44c82872448 100644 --- a/ld/emultempl/mmixelf.em +++ b/ld/emultempl/mmixelf.em @@ -37,9 +37,9 @@ elfmmix_before_parse (void) page in the linked file, which is non-intuitive. If there's ever a full system with shared libraries and demand paging, you will want to exclude this file. */ - config.magic_demand_paged = FALSE; + config.magic_demand_paged = false; - config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`; + config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo true ; else echo false ; fi`; } EOF diff --git a/ld/emultempl/mmo.em b/ld/emultempl/mmo.em index fa0b19ae646..a3a229954a7 100644 --- a/ld/emultempl/mmo.em +++ b/ld/emultempl/mmo.em @@ -202,7 +202,7 @@ static void gld${EMULATION_NAME}_after_allocation (void) { bfd_map_over_sections (link_info.output_bfd, mmo_wipe_sec_reloc_flag, NULL); - ldelf_map_segments (FALSE); + ldelf_map_segments (false); } /* To get on-demand global register allocation right, we need to parse the diff --git a/ld/emultempl/msp430.em b/ld/emultempl/msp430.em index 7e364afda81..c09db93f6f7 100644 --- a/ld/emultempl/msp430.em +++ b/ld/emultempl/msp430.em @@ -61,7 +61,7 @@ enum { ROM, RAM }; static int data_region = REGION_NONE; static int code_region = REGION_NONE; -static bfd_boolean disable_sec_transformation = FALSE; +static bool disable_sec_transformation = false; #define MAX_PREFIX_LENGTH 7 @@ -228,21 +228,21 @@ scan_children (lang_statement_union_type * l) static void warn_no_output_section (const char *name) { - static bfd_boolean warned[2][4] = {{FALSE, FALSE, FALSE, FALSE}, - {FALSE, FALSE, FALSE, FALSE}}; + static bool warned[2][4] = {{false, false, false, false}, + {false, false, false, false}}; int i = WARN_LOWER; if (strncmp (name, ".upper.", 7) == 0) i = WARN_UPPER; if (!warned[i][WARN_TEXT] && strcmp (name + 6, ".text") == 0) - warned[i][WARN_TEXT] = TRUE; + warned[i][WARN_TEXT] = true; else if (!warned[i][WARN_DATA] && strcmp (name + 6, ".data") == 0) - warned[i][WARN_DATA] = TRUE; + warned[i][WARN_DATA] = true; else if (!warned[i][WARN_BSS] && strcmp (name + 6, ".bss") == 0) - warned[i][WARN_BSS] = TRUE; + warned[i][WARN_BSS] = true; else if (!warned[i][WARN_RODATA] && strcmp (name + 6, ".rodata") == 0) - warned[i][WARN_RODATA] = TRUE; + warned[i][WARN_RODATA] = true; else return; einfo ("%P: warning: no input section rule matches %s in linker script\n", @@ -336,7 +336,7 @@ fi fragment <tail == (lang_statement_union_type **) curr) old_list->tail = (lang_statement_union_type **) prev; - return TRUE; + return true; } break; case lang_wild_statement_enum: if (change_output_section (&(curr->wild_statement.children.head), s, new_os, old_os)) - return TRUE; + return true; break; default: break; @@ -385,7 +385,7 @@ change_output_section (lang_statement_union_type **head, prev = curr; curr = curr->header.next; } - return FALSE; + return false; } static void @@ -483,7 +483,7 @@ gld${EMULATION_NAME}_list_options (FILE * file) add the {either,lower,upper,none} prefixes\n")); } -static bfd_boolean +static bool gld${EMULATION_NAME}_handle_option (int optc) { switch (optc) @@ -501,13 +501,13 @@ gld${EMULATION_NAME}_handle_option (int optc) { einfo (_("%P: --code-region requires an argument: " "{upper,lower,either,none}\n")); - return FALSE; + return false; } else { einfo (_("%P: error: unrecognized argument to --code-region= option: " "\"%s\"\n"), optarg); - return FALSE; + return false; } break; @@ -524,24 +524,24 @@ gld${EMULATION_NAME}_handle_option (int optc) { einfo (_("%P: --data-region requires an argument: " "{upper,lower,either,none}\n")); - return FALSE; + return false; } else { einfo (_("%P: error: unrecognized argument to --data-region= option: " "\"%s\"\n"), optarg); - return FALSE; + return false; } break; case OPTION_DISABLE_TRANS: - disable_sec_transformation = TRUE; + disable_sec_transformation = true; break; default: - return FALSE; + return false; } - return TRUE; + return true; } static void @@ -730,7 +730,7 @@ intermediate_relax_sections (void) while (i--) { - bfd_boolean relax_again; + bool relax_again; link_info.relax_trip = -1; do @@ -741,8 +741,8 @@ intermediate_relax_sections (void) lang_reset_memory_regions (); - relax_again = FALSE; - lang_size_sections (&relax_again, FALSE); + relax_again = false; + lang_size_sections (&relax_again, false); } while (relax_again); @@ -840,12 +840,12 @@ input_section_exists (lang_statement_union_type * l, const char * name) if ((l->input_section.section->flags & SEC_ALLOC) && l->input_section.section->size > 0 && !strcmp (l->input_section.section->name, name)) - return TRUE; + return true; break; case lang_wild_statement_enum: if (input_section_exists (l->wild_statement.children.head, name)) - return TRUE; + return true; break; default: @@ -853,7 +853,7 @@ input_section_exists (lang_statement_union_type * l, const char * name) } l = l->header.next; } - return FALSE; + return false; } /* Some MSP430 linker scripts do not include ALIGN directives to ensure @@ -889,7 +889,7 @@ check_array_section_alignment (void) || (rodata2_sec && input_section_exists (rodata2_sec->children.head, array_names[i][0]))) && (sym = bfd_link_hash_lookup (link_info.hash, array_names[i][1], - FALSE, FALSE, TRUE)) + false, false, true)) && sym->type == bfd_link_hash_defined && sym->u.def.value % 2) { diff --git a/ld/emultempl/nios2elf.em b/ld/emultempl/nios2elf.em index fcc27561140..d0d5cc02a00 100644 --- a/ld/emultempl/nios2elf.em +++ b/ld/emultempl/nios2elf.em @@ -81,12 +81,12 @@ struct hook_stub_info /* Traverse the linker tree to find the spot where the stub goes. */ -static bfd_boolean +static bool hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp, - bfd_boolean afterp) + bool afterp) { lang_statement_union_type *l; - bfd_boolean ret; + bool ret; for (; (l = *lp) != NULL; lp = &l->header.next) { @@ -133,7 +133,7 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp, *lp = info->add.head; *(info->add.tail) = l; } - return TRUE; + return true; } break; @@ -154,7 +154,7 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp, break; } } - return FALSE; + return false; } /* Call-back for elf32_nios2_size_stubs. */ @@ -164,7 +164,7 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp, static asection * nios2elf_add_stub_section (const char *stub_sec_name, asection *input_section, - bfd_boolean afterp) + bool afterp) { asection *stub_sec; flagword flags; @@ -208,7 +208,7 @@ nios2elf_layout_sections_again (void) /* If we have changed sizes of the stub sections, then we need to recalculate all the section offsets. This may mean we need to add even more stubs. */ - ldelf_map_segments (TRUE); + ldelf_map_segments (true); need_laying_out = -1; } diff --git a/ld/emultempl/pdp11.em b/ld/emultempl/pdp11.em index 6a3cacb3703..2ed1e61eb43 100644 --- a/ld/emultempl/pdp11.em +++ b/ld/emultempl/pdp11.em @@ -28,8 +28,8 @@ gld${EMULATION_NAME}_before_parse (void) { ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown); /* for PDP11 Unix compatibility, default to --omagic */ - config.magic_demand_paged = FALSE; - config.text_read_only = FALSE; + config.magic_demand_paged = false; + config.text_read_only = false; } /* PDP11 specific options. */ @@ -67,13 +67,13 @@ gld${EMULATION_NAME}_list_options (FILE *file) fprintf (file, _(" --no-omagic Equivalent to --nmagic\n")); } -static bfd_boolean +static bool gld${EMULATION_NAME}_handle_option (int optc) { switch (optc) { default: - return FALSE; + return false; case 'z': case OPTION_IMAGIC: @@ -84,7 +84,7 @@ gld${EMULATION_NAME}_handle_option (int optc) break; } - return TRUE; + return true; } /* We need a special case to prepare an additional linker script for option diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index ea11a02e7c8..c5aed5f126a 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -133,7 +133,7 @@ static int support_old_code = 0; static char * thumb_entry_symbol = NULL; static lang_assignment_statement_type *image_base_statement = 0; static unsigned short pe_dll_characteristics = DEFAULT_DLL_CHARACTERISTICS; -static bfd_boolean insert_timestamp = TRUE; +static bool insert_timestamp = true; static const char *emit_build_id; #ifdef DLL_SUPPORT @@ -167,7 +167,7 @@ gld_${EMULATION_NAME}_before_parse (void) ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`); output_filename = "${EXECUTABLE_NAME:-a.exe}"; #ifdef DLL_SUPPORT - input_flags.dynamic = TRUE; + input_flags.dynamic = true; config.has_shared = 1; EOF @@ -395,7 +395,7 @@ typedef struct /* FALSE for an assembly level symbol and TRUE for a C visible symbol. C visible symbols can be prefixed by underscore dependent to target's settings. */ - bfd_boolean is_c_symbol; + bool is_c_symbol; } definfo; /* Get symbol name dependent to kind and C visible state of @@ -414,31 +414,31 @@ static definfo init[] = { /* imagebase must be first */ #define IMAGEBASEOFF 0 - D(ImageBase,"__image_base__", NT_EXE_IMAGE_BASE, FALSE), + D(ImageBase,"__image_base__", NT_EXE_IMAGE_BASE, false), #define DLLOFF 1 - {&dll, sizeof(dll), 0, "__dll__", 0, FALSE}, + {&dll, sizeof(dll), 0, "__dll__", 0, false}, #define MSIMAGEBASEOFF 2 - D(ImageBase, "___ImageBase", NT_EXE_IMAGE_BASE, TRUE), - D(SectionAlignment,"__section_alignment__", PE_DEF_SECTION_ALIGNMENT, FALSE), - D(FileAlignment,"__file_alignment__", PE_DEF_FILE_ALIGNMENT, FALSE), - D(MajorOperatingSystemVersion,"__major_os_version__", 4, FALSE), - D(MinorOperatingSystemVersion,"__minor_os_version__", 0, FALSE), - D(MajorImageVersion,"__major_image_version__", 1, FALSE), - D(MinorImageVersion,"__minor_image_version__", 0, FALSE), + D(ImageBase, "___ImageBase", NT_EXE_IMAGE_BASE, true), + D(SectionAlignment,"__section_alignment__", PE_DEF_SECTION_ALIGNMENT, false), + D(FileAlignment,"__file_alignment__", PE_DEF_FILE_ALIGNMENT, false), + D(MajorOperatingSystemVersion,"__major_os_version__", 4, false), + D(MinorOperatingSystemVersion,"__minor_os_version__", 0, false), + D(MajorImageVersion,"__major_image_version__", 1, false), + D(MinorImageVersion,"__minor_image_version__", 0, false), #if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_wince_pe) - D(MajorSubsystemVersion,"__major_subsystem_version__", 3, FALSE), + D(MajorSubsystemVersion,"__major_subsystem_version__", 3, false), #else - D(MajorSubsystemVersion,"__major_subsystem_version__", 4, FALSE), + D(MajorSubsystemVersion,"__major_subsystem_version__", 4, false), #endif - D(MinorSubsystemVersion,"__minor_subsystem_version__", 0, FALSE), - D(Subsystem,"__subsystem__", ${SUBSYSTEM}, FALSE), - D(SizeOfStackReserve,"__size_of_stack_reserve__", 0x200000, FALSE), - D(SizeOfStackCommit,"__size_of_stack_commit__", 0x1000, FALSE), - D(SizeOfHeapReserve,"__size_of_heap_reserve__", 0x100000, FALSE), - D(SizeOfHeapCommit,"__size_of_heap_commit__", 0x1000, FALSE), - D(LoaderFlags,"__loader_flags__", 0x0, FALSE), - D(DllCharacteristics, "__dll_characteristics__", DEFAULT_DLL_CHARACTERISTICS, FALSE), - { NULL, 0, 0, NULL, 0 , FALSE} + D(MinorSubsystemVersion,"__minor_subsystem_version__", 0, false), + D(Subsystem,"__subsystem__", ${SUBSYSTEM}, false), + D(SizeOfStackReserve,"__size_of_stack_reserve__", 0x200000, false), + D(SizeOfStackCommit,"__size_of_stack_commit__", 0x1000, false), + D(SizeOfHeapReserve,"__size_of_heap_reserve__", 0x100000, false), + D(SizeOfHeapCommit,"__size_of_heap_commit__", 0x1000, false), + D(LoaderFlags,"__loader_flags__", 0x0, false), + D(DllCharacteristics, "__dll_characteristics__", DEFAULT_DLL_CHARACTERISTICS, false), + { NULL, 0, 0, NULL, 0 , false} }; @@ -716,13 +716,13 @@ set_pe_stack_heap (char *resname, char *comname) #define DEFAULT_BUILD_ID_STYLE "md5" -static bfd_boolean +static bool gld${EMULATION_NAME}_handle_option (int optc) { switch (optc) { default: - return FALSE; + return false; case OPTION_BASE_FILE: link_info.base_file = fopen (optarg, FOPEN_WB); @@ -777,7 +777,7 @@ gld${EMULATION_NAME}_handle_option (int optc) thumb_entry_symbol = optarg; break; case OPTION_USE_NUL_PREFIXED_IMPORT_TABLES: - pe_use_nul_prefixed_import_tables = TRUE; + pe_use_nul_prefixed_import_tables = true; break; case OPTION_NO_LEADING_UNDERSCORE: pe_leading_underscore = 0; @@ -786,10 +786,10 @@ gld${EMULATION_NAME}_handle_option (int optc) pe_leading_underscore = 1; break; case OPTION_INSERT_TIMESTAMP: - insert_timestamp = TRUE; + insert_timestamp = true; break; case OPTION_NO_INSERT_TIMESTAMP: - insert_timestamp = FALSE; + insert_timestamp = false; break; #ifdef DLL_SUPPORT case OPTION_OUT_DEF: @@ -949,7 +949,7 @@ gld${EMULATION_NAME}_handle_option (int optc) /* Set DLLCharacteristics bits */ set_pe_name ("__dll_characteristics__", pe_dll_characteristics); - return TRUE; + return true; } @@ -1031,7 +1031,7 @@ gld_${EMULATION_NAME}_set_symbols (void) lang_assignment_statement_type *rv; rv = lang_add_assignment (exp_assign (GET_INIT_SYMBOL_NAME (j), - exp_intop (val), FALSE)); + exp_intop (val), false)); if (init[j].size == sizeof (short)) *(short *) init[j].ptr = val; else if (init[j].size == sizeof (int)) @@ -1074,7 +1074,7 @@ gld_${EMULATION_NAME}_after_parse (void) #ifdef DLL_SUPPORT static struct bfd_link_hash_entry *pe_undef_found_sym; -static bfd_boolean +static bool pe_undef_cdecl_match (struct bfd_link_hash_entry *h, void *inf) { int sl; @@ -1089,9 +1089,9 @@ pe_undef_cdecl_match (struct bfd_link_hash_entry *h, void *inf) && h->root.string[sl] == '@') { pe_undef_found_sym = h; - return FALSE; + return false; } - return TRUE; + return true; } /* Change UNDEF to a defined symbol, taking data from SYM. */ @@ -1100,7 +1100,7 @@ static void change_undef (struct bfd_link_hash_entry * undef, struct bfd_link_hash_entry * sym) { - static bfd_boolean gave_warning_message = FALSE; + static bool gave_warning_message = false; undef->type = bfd_link_hash_defined; undef->u.def.value = sym->u.def.value; @@ -1115,7 +1115,7 @@ change_undef (struct bfd_link_hash_entry * undef, { einfo (_("Use --enable-stdcall-fixup to disable these warnings\n")); einfo (_("Use --disable-stdcall-fixup to disable these fixups\n")); - gave_warning_message = TRUE; + gave_warning_message = true; } } @@ -1153,7 +1153,7 @@ pe_fixup_stdcalls (void) *cname = '_'; if (at) * strchr (cname, '@') = 0; - sym = bfd_link_hash_lookup (link_info.hash, cname, FALSE, FALSE, TRUE); + sym = bfd_link_hash_lookup (link_info.hash, cname, false, false, true); if (sym && sym->type == bfd_link_hash_defined) change_undef (undef, sym); @@ -1190,12 +1190,12 @@ make_import_fixup (arelent *rel, asection *s, char *name, const char *symname) pe_create_import_fixup (rel, s, _addend, name, symname); } -static bfd_boolean +static bool pr_sym (struct bfd_hash_entry *h, void *inf ATTRIBUTE_UNUSED) { printf ("+%s\n", h->string); - return TRUE; + return true; } #endif /* DLL_SUPPORT */ @@ -1207,7 +1207,7 @@ debug_section_p (bfd *abfd ATTRIBUTE_UNUSED, asection *sect, void *obj) *found = 1; } -static bfd_boolean +static bool pecoff_checksum_contents (bfd *abfd, void (*process) (const void *, size_t, void *), void *arg) @@ -1232,10 +1232,10 @@ pecoff_checksum_contents (bfd *abfd, filepos += 1; } - return TRUE; + return true; } -static bfd_boolean +static bool write_build_id (bfd *abfd) { struct pe_tdata *t = pe_data (abfd); @@ -1270,7 +1270,7 @@ write_build_id (bfd *abfd) { einfo (_("%P: warning: .buildid section discarded," " --build-id ignored\n")); - return TRUE; + return true; } if (t->build_id.sec->contents == NULL) @@ -1329,11 +1329,11 @@ write_build_id (bfd *abfd) pe_data (link_info.output_bfd)->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size = sizeof (struct external_IMAGE_DEBUG_DIRECTORY); - return TRUE; + return true; } /* Make .buildid section, and set up coff_tdata->build_id. */ -static bfd_boolean +static bool setup_build_id (bfd *ibfd) { asection *s; @@ -1342,7 +1342,7 @@ setup_build_id (bfd *ibfd) if (!validate_build_id_style (emit_build_id)) { einfo (_("%P: warning: unrecognized --build-id style ignored\n")); - return FALSE; + return false; } flags = (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_IN_MEMORY @@ -1362,12 +1362,12 @@ setup_build_id (bfd *ibfd) s->size = sizeof (struct external_IMAGE_DEBUG_DIRECTORY) + sizeof (CV_INFO_PDB70) + 1; - return TRUE; + return true; } einfo (_("%P: warning: cannot create .buildid section," " --build-id ignored\n")); - return FALSE; + return false; } static void @@ -1582,7 +1582,7 @@ gld_${EMULATION_NAME}_after_open (void) /* Thunk section with reloc to another bfd. */ blhe = bfd_link_hash_lookup (link_info.hash, s->name, - FALSE, FALSE, TRUE); + false, false, true); if (blhe == NULL || blhe->type != bfd_link_hash_defined) @@ -1774,7 +1774,7 @@ gld_${EMULATION_NAME}_after_open (void) the stub. */ blhe = bfd_link_hash_lookup (link_info.hash, symbols[src_count]->name, - FALSE, FALSE, TRUE); + false, false, true); /* If the symbol in the stub section has no other undefined references, exclude the stub section from the final link. */ @@ -1837,7 +1837,7 @@ saw_option (char *option) } #endif /* DLL_SUPPORT */ -static bfd_boolean +static bool gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED) { #ifdef DLL_SUPPORT @@ -1868,7 +1868,7 @@ gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIB sprintf (buf, "%s%s", U (""), pe_def_file->exports[i].internal_name); - h = bfd_link_hash_lookup (link_info.hash, buf, TRUE, TRUE, TRUE); + h = bfd_link_hash_lookup (link_info.hash, buf, true, true, true); if (h == (struct bfd_link_hash_entry *) NULL) einfo (_("%F%P: bfd_link_hash_lookup failed: %E\n")); if (h->type == bfd_link_hash_new) @@ -1894,7 +1894,7 @@ gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIB if (image_base_statement) image_base_statement->exp = exp_assign ("__image_base__", exp_intop (pe.ImageBase), - FALSE); + false); } if (pe_def_file->stack_reserve != -1 @@ -1911,14 +1911,14 @@ gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIB if (pe_def_file->heap_commit != -1) pe.SizeOfHeapCommit = pe_def_file->heap_commit; } - return TRUE; + return true; } } #endif - return FALSE; + return false; } -static bfd_boolean +static bool gld_${EMULATION_NAME}_recognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED) { #ifdef DLL_SUPPORT @@ -1937,7 +1937,7 @@ gld_${EMULATION_NAME}_recognized_file (lang_input_statement_type *entry ATTRIBUT if (pe_bfd_is_dll (entry->the_bfd)) return pe_implied_import_dll (entry->filename); #endif - return FALSE; + return false; } static void @@ -1949,7 +1949,7 @@ gld_${EMULATION_NAME}_finish (void) if (thumb_entry_symbol != NULL) { h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol, - FALSE, FALSE, TRUE); + false, false, true); if (h != (struct bfd_link_hash_entry *) NULL && (h->type == bfd_link_hash_defined @@ -2239,7 +2239,7 @@ gld_${EMULATION_NAME}_place_orphan (asection *s, return os; } -static bfd_boolean +static bool gld_${EMULATION_NAME}_open_dynamic_archive (const char *arch ATTRIBUTE_UNUSED, search_dirs_type *search, @@ -2248,34 +2248,34 @@ gld_${EMULATION_NAME}_open_dynamic_archive static const struct { const char * format; - bfd_boolean use_prefix; + bool use_prefix; } libname_fmt [] = { /* Preferred explicit import library for dll's. */ - { "lib%s.dll.a", FALSE }, + { "lib%s.dll.a", false }, /* Alternate explicit import library for dll's. */ - { "%s.dll.a", FALSE }, + { "%s.dll.a", false }, /* "libfoo.a" could be either an import lib or a static lib. For backwards compatibility, libfoo.a needs to precede libfoo.dll and foo.dll in the search. */ - { "lib%s.a", FALSE }, + { "lib%s.a", false }, /* The 'native' spelling of an import lib name is "foo.lib". */ - { "%s.lib", FALSE }, + { "%s.lib", false }, /* PR 22948 - Check for an import library. */ - { "lib%s.lib", FALSE }, + { "lib%s.lib", false }, #ifdef DLL_SUPPORT /* Try "foo.dll" (preferred dll name, if specified). */ - { "%s%s.dll", TRUE }, + { "%s%s.dll", true }, #endif /* Try "libfoo.dll" (default preferred dll name). */ - { "lib%s.dll", FALSE }, + { "lib%s.dll", false }, /* Finally try 'native' dll name "foo.dll". */ - { "%s.dll", FALSE }, + { "%s.dll", false }, /* Note: If adding more formats to this table, make sure to check to see if their length is longer than libname_fmt[0].format, and if so, update the call to xmalloc() below. */ - { NULL, FALSE } + { NULL, false } }; static unsigned int format_max_len = 0; const char * filename; @@ -2285,7 +2285,7 @@ gld_${EMULATION_NAME}_open_dynamic_archive if (! entry->flags.maybe_archive || entry->flags.full_name_provided) - return FALSE; + return false; filename = entry->filename; @@ -2337,12 +2337,12 @@ gld_${EMULATION_NAME}_open_dynamic_archive if (!libname_fmt[i].format) { free (full_string); - return FALSE; + return false; } entry->filename = full_string; - return TRUE; + return true; } static int diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em index 5f539cb7a3e..c6fd8b8f8d9 100644 --- a/ld/emultempl/pep.em +++ b/ld/emultempl/pep.em @@ -152,7 +152,7 @@ static flagword real_flags = IMAGE_FILE_LARGE_ADDRESS_AWARE; static int support_old_code = 0; static lang_assignment_statement_type *image_base_statement = 0; static unsigned short pe_dll_characteristics = DEFAULT_DLL_CHARACTERISTICS; -static bfd_boolean insert_timestamp = TRUE; +static bool insert_timestamp = true; static const char *emit_build_id; #ifdef DLL_SUPPORT @@ -186,7 +186,7 @@ gld_${EMULATION_NAME}_before_parse (void) ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`); output_filename = "${EXECUTABLE_NAME:-a.exe}"; #ifdef DLL_SUPPORT - input_flags.dynamic = TRUE; + input_flags.dynamic = true; config.has_shared = 1; link_info.pei386_auto_import = 1; link_info.pei386_runtime_pseudo_reloc = 2; /* Use by default version 2. */ @@ -372,7 +372,7 @@ typedef struct /* FALSE for an assembly level symbol and TRUE for a C visible symbol. C visible symbols can be prefixed by underscore dependent on target's settings. */ - bfd_boolean is_c_symbol; + bool is_c_symbol; } definfo; #define GET_INIT_SYMBOL_NAME(IDX) \ @@ -389,27 +389,27 @@ static definfo init[] = { /* imagebase must be first */ #define IMAGEBASEOFF 0 - D(ImageBase,"__image_base__", NT_EXE_IMAGE_BASE, FALSE), + D(ImageBase,"__image_base__", NT_EXE_IMAGE_BASE, false), #define DLLOFF 1 - {&dll, sizeof(dll), 0, "__dll__", 0, FALSE}, + {&dll, sizeof(dll), 0, "__dll__", 0, false}, #define MSIMAGEBASEOFF 2 - D(ImageBase, "___ImageBase", NT_EXE_IMAGE_BASE, TRUE), - D(SectionAlignment,"__section_alignment__", PE_DEF_SECTION_ALIGNMENT, FALSE), - D(FileAlignment,"__file_alignment__", PE_DEF_FILE_ALIGNMENT, FALSE), - D(MajorOperatingSystemVersion,"__major_os_version__", 4, FALSE), - D(MinorOperatingSystemVersion,"__minor_os_version__", 0, FALSE), - D(MajorImageVersion,"__major_image_version__", 0, FALSE), - D(MinorImageVersion,"__minor_image_version__", 0, FALSE), - D(MajorSubsystemVersion,"__major_subsystem_version__", 5, FALSE), - D(MinorSubsystemVersion,"__minor_subsystem_version__", 2, FALSE), - D(Subsystem,"__subsystem__", ${SUBSYSTEM}, FALSE), - D(SizeOfStackReserve,"__size_of_stack_reserve__", 0x200000, FALSE), - D(SizeOfStackCommit,"__size_of_stack_commit__", 0x1000, FALSE), - D(SizeOfHeapReserve,"__size_of_heap_reserve__", 0x100000, FALSE), - D(SizeOfHeapCommit,"__size_of_heap_commit__", 0x1000, FALSE), - D(LoaderFlags,"__loader_flags__", 0x0, FALSE), - D(DllCharacteristics, "__dll_characteristics__", DEFAULT_DLL_CHARACTERISTICS, FALSE), - { NULL, 0, 0, NULL, 0, FALSE} + D(ImageBase, "___ImageBase", NT_EXE_IMAGE_BASE, true), + D(SectionAlignment,"__section_alignment__", PE_DEF_SECTION_ALIGNMENT, false), + D(FileAlignment,"__file_alignment__", PE_DEF_FILE_ALIGNMENT, false), + D(MajorOperatingSystemVersion,"__major_os_version__", 4, false), + D(MinorOperatingSystemVersion,"__minor_os_version__", 0, false), + D(MajorImageVersion,"__major_image_version__", 0, false), + D(MinorImageVersion,"__minor_image_version__", 0, false), + D(MajorSubsystemVersion,"__major_subsystem_version__", 5, false), + D(MinorSubsystemVersion,"__minor_subsystem_version__", 2, false), + D(Subsystem,"__subsystem__", ${SUBSYSTEM}, false), + D(SizeOfStackReserve,"__size_of_stack_reserve__", 0x200000, false), + D(SizeOfStackCommit,"__size_of_stack_commit__", 0x1000, false), + D(SizeOfHeapReserve,"__size_of_heap_reserve__", 0x100000, false), + D(SizeOfHeapCommit,"__size_of_heap_commit__", 0x1000, false), + D(LoaderFlags,"__loader_flags__", 0x0, false), + D(DllCharacteristics, "__dll_characteristics__", DEFAULT_DLL_CHARACTERISTICS, false), + { NULL, 0, 0, NULL, 0, false} }; @@ -679,14 +679,14 @@ set_pep_stack_heap (char *resname, char *comname) #define DEFAULT_BUILD_ID_STYLE "md5" -static bfd_boolean +static bool gld${EMULATION_NAME}_handle_option (int optc) { is_underscoring (); switch (optc) { default: - return FALSE; + return false; case OPTION_BASE_FILE: link_info.base_file = fopen (optarg, FOPEN_WB); @@ -738,7 +738,7 @@ gld${EMULATION_NAME}_handle_option (int optc) support_old_code = 1; break; case OPTION_USE_NUL_PREFIXED_IMPORT_TABLES: - pep_use_nul_prefixed_import_tables = TRUE; + pep_use_nul_prefixed_import_tables = true; break; case OPTION_NO_LEADING_UNDERSCORE: pep_leading_underscore = 0; @@ -747,10 +747,10 @@ gld${EMULATION_NAME}_handle_option (int optc) pep_leading_underscore = 1; break; case OPTION_INSERT_TIMESTAMP: - insert_timestamp = TRUE; + insert_timestamp = true; break; case OPTION_NO_INSERT_TIMESTAMP: - insert_timestamp = FALSE; + insert_timestamp = false; break; #ifdef DLL_SUPPORT case OPTION_OUT_DEF: @@ -900,7 +900,7 @@ gld${EMULATION_NAME}_handle_option (int optc) /* Set DLLCharacteristics bits */ set_pep_name ("__dll_characteristics__", pe_dll_characteristics); - return TRUE; + return true; } @@ -982,7 +982,7 @@ gld_${EMULATION_NAME}_set_symbols (void) lang_assignment_statement_type *rv; rv = lang_add_assignment (exp_assign (GET_INIT_SYMBOL_NAME (j), - exp_intop (val), FALSE)); + exp_intop (val), false)); if (init[j].size == sizeof (short)) *(short *) init[j].ptr = (short) val; else if (init[j].size == sizeof (int)) @@ -1025,7 +1025,7 @@ gld_${EMULATION_NAME}_after_parse (void) #ifdef DLL_SUPPORT static struct bfd_link_hash_entry *pep_undef_found_sym; -static bfd_boolean +static bool pep_undef_cdecl_match (struct bfd_link_hash_entry *h, void *inf) { int sl; @@ -1040,9 +1040,9 @@ pep_undef_cdecl_match (struct bfd_link_hash_entry *h, void *inf) && h->root.string[sl] == '@') { pep_undef_found_sym = h; - return FALSE; + return false; } - return TRUE; + return true; } static void @@ -1181,12 +1181,12 @@ make_import_fixup (arelent *rel, asection *s, char *name, const char *symname) pep_create_import_fixup (rel, s, _addend, name, symname); } -static bfd_boolean +static bool pr_sym (struct bfd_hash_entry *h, void *inf ATTRIBUTE_UNUSED) { printf ("+%s\n", h->string); - return TRUE; + return true; } #endif /* DLL_SUPPORT */ @@ -1199,7 +1199,7 @@ debug_section_p (bfd *abfd ATTRIBUTE_UNUSED, asection *sect, void *obj) *found = 1; } -static bfd_boolean +static bool pecoff_checksum_contents (bfd *abfd, void (*process) (const void *, size_t, void *), void *arg) @@ -1224,10 +1224,10 @@ pecoff_checksum_contents (bfd *abfd, filepos += 1; } - return TRUE; + return true; } -static bfd_boolean +static bool write_build_id (bfd *abfd) { struct pe_tdata *t = pe_data (abfd); @@ -1262,7 +1262,7 @@ write_build_id (bfd *abfd) { einfo (_("%P: warning: .buildid section discarded," " --build-id ignored\n")); - return TRUE; + return true; } if (t->build_id.sec->contents == NULL) @@ -1321,11 +1321,11 @@ write_build_id (bfd *abfd) pe_data (link_info.output_bfd)->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size = sizeof (struct external_IMAGE_DEBUG_DIRECTORY); - return TRUE; + return true; } /* Make .buildid section, and set up coff_tdata->build_id. */ -static bfd_boolean +static bool setup_build_id (bfd *ibfd) { asection *s; @@ -1334,7 +1334,7 @@ setup_build_id (bfd *ibfd) if (!validate_build_id_style (emit_build_id)) { einfo (_("%P: warning: unrecognized --build-id style ignored\n")); - return FALSE; + return false; } flags = (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_IN_MEMORY @@ -1354,12 +1354,12 @@ setup_build_id (bfd *ibfd) s->size = sizeof (struct external_IMAGE_DEBUG_DIRECTORY) + sizeof (CV_INFO_PDB70) + 1; - return TRUE; + return true; } einfo (_("%P: warning: cannot create .buildid section," " --build-id ignored\n")); - return FALSE; + return false; } static void @@ -1554,7 +1554,7 @@ gld_${EMULATION_NAME}_after_open (void) /* Thunk section with reloc to another bfd. */ blhe = bfd_link_hash_lookup (link_info.hash, s->name, - FALSE, FALSE, TRUE); + false, false, true); if (blhe == NULL || blhe->type != bfd_link_hash_defined) @@ -1715,7 +1715,7 @@ saw_option (char *option) } #endif /* DLL_SUPPORT */ -static bfd_boolean +static bool gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED) { #ifdef DLL_SUPPORT @@ -1746,7 +1746,7 @@ gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIB sprintf (buf, "%s%s", U (""), pep_def_file->exports[i].internal_name); - h = bfd_link_hash_lookup (link_info.hash, buf, TRUE, TRUE, TRUE); + h = bfd_link_hash_lookup (link_info.hash, buf, true, true, true); if (h == (struct bfd_link_hash_entry *) NULL) einfo (_("%F%P: bfd_link_hash_lookup failed: %E\n")); if (h->type == bfd_link_hash_new) @@ -1772,7 +1772,7 @@ gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIB if (image_base_statement) image_base_statement->exp = exp_assign ("__image_base__", exp_intop (pep.ImageBase), - FALSE); + false); } if (pep_def_file->stack_reserve != -1 @@ -1789,14 +1789,14 @@ gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIB if (pep_def_file->heap_commit != -1) pep.SizeOfHeapCommit = pep_def_file->heap_commit; } - return TRUE; + return true; } } #endif - return FALSE; + return false; } -static bfd_boolean +static bool gld_${EMULATION_NAME}_recognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED) { is_underscoring (); @@ -1807,7 +1807,7 @@ gld_${EMULATION_NAME}_recognized_file (lang_input_statement_type *entry ATTRIBUT if (pep_bfd_is_dll (entry->the_bfd)) return pep_implied_import_dll (entry->filename); #endif - return FALSE; + return false; } static void @@ -2059,7 +2059,7 @@ gld_${EMULATION_NAME}_place_orphan (asection *s, return os; } -static bfd_boolean +static bool gld_${EMULATION_NAME}_open_dynamic_archive (const char *arch ATTRIBUTE_UNUSED, search_dirs_type *search, @@ -2068,34 +2068,34 @@ gld_${EMULATION_NAME}_open_dynamic_archive static const struct { const char * format; - bfd_boolean use_prefix; + bool use_prefix; } libname_fmt [] = { /* Preferred explicit import library for dll's. */ - { "lib%s.dll.a", FALSE }, + { "lib%s.dll.a", false }, /* Alternate explicit import library for dll's. */ - { "%s.dll.a", FALSE }, + { "%s.dll.a", false }, /* "libfoo.a" could be either an import lib or a static lib. For backwards compatibility, libfoo.a needs to precede libfoo.dll and foo.dll in the search. */ - { "lib%s.a", FALSE }, + { "lib%s.a", false }, /* The 'native' spelling of an import lib name is "foo.lib". */ - { "%s.lib", FALSE }, + { "%s.lib", false }, /* PR 22948 - Check for an import library. */ - { "lib%s.lib", FALSE }, + { "lib%s.lib", false }, #ifdef DLL_SUPPORT /* Try "foo.dll" (preferred dll name, if specified). */ - { "%s%s.dll", TRUE }, + { "%s%s.dll", true }, #endif /* Try "libfoo.dll" (default preferred dll name). */ - { "lib%s.dll", FALSE }, + { "lib%s.dll", false }, /* Finally try 'native' dll name "foo.dll". */ - { "%s.dll", FALSE }, + { "%s.dll", false }, /* Note: If adding more formats to this table, make sure to check to see if their length is longer than libname_fmt[0].format, and if so, update the call to xmalloc() below. */ - { NULL, FALSE } + { NULL, false } }; static unsigned int format_max_len = 0; const char * filename; @@ -2105,7 +2105,7 @@ gld_${EMULATION_NAME}_open_dynamic_archive if (! entry->flags.maybe_archive || entry->flags.full_name_provided) - return FALSE; + return false; filename = entry->filename; @@ -2157,12 +2157,12 @@ gld_${EMULATION_NAME}_open_dynamic_archive if (!libname_fmt[i].format) { free (full_string); - return FALSE; + return false; } entry->filename = full_string; - return TRUE; + return true; } static int diff --git a/ld/emultempl/ppc32elf.em b/ld/emultempl/ppc32elf.em index 003bc9952aa..c8d39d84dc7 100644 --- a/ld/emultempl/ppc32elf.em +++ b/ld/emultempl/ppc32elf.em @@ -125,7 +125,7 @@ prelim_size_sections (void) { expld.phase = lang_mark_phase_enum; expld.dataseg.phase = exp_seg_none; - one_lang_size_sections_pass (NULL, FALSE); + one_lang_size_sections_pass (NULL, false); /* We must not cache anything from the preliminary sizing. */ lang_reset_memory_regions (); } @@ -246,13 +246,13 @@ EOF if grep -q 'ld_elf32_spu_emulation' ldemul-list.h; then fragment <header.next) { @@ -389,7 +389,7 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp) before its associated input section. */ *lp = info->add.head; *(info->add.tail) = l; - return TRUE; + return true; } break; @@ -410,7 +410,7 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp) break; } } - return FALSE; + return false; } @@ -467,7 +467,7 @@ ppc_layout_sections_again (void) /* If we have changed sizes of the stub sections, then we need to recalculate all the section offsets. This may mean we need to add even more stubs. */ - ldelf_map_segments (TRUE); + ldelf_map_segments (true); if (!bfd_link_relocatable (&link_info)) ppc64_elf_set_toc (&link_info, link_info.output_bfd); @@ -667,13 +667,13 @@ EOF if grep -q 'ld_elf32_spu_emulation' ldemul-list.h; then fragment <children); e_size = exp_intop (params.line_size - s->size); - lang_add_assignment (exp_assign (".", e_size, FALSE)); + lang_add_assignment (exp_assign (".", e_size, false)); pop_stat_ptr (); } lang_add_section (&os->children, s, NULL, NULL, os); @@ -192,7 +192,7 @@ spu_elf_load_ovl_mgr (void) mgr_stream = &icache_mgr_stream; } h = elf_link_hash_lookup (elf_hash_table (&link_info), - ovly_mgr_entry, FALSE, FALSE, FALSE); + ovly_mgr_entry, false, false, false); if (h != NULL && (h->root.type == bfd_link_hash_defined @@ -273,7 +273,7 @@ spu_before_allocation (void) rough layout so that overlays can be found. */ expld.phase = lang_mark_phase_enum; expld.dataseg.phase = exp_seg_none; - one_lang_size_sections_pass (NULL, TRUE); + one_lang_size_sections_pass (NULL, true); /* Find overlays by inspecting section vmas. */ ret = spu_elf_find_overlays (&link_info); @@ -476,9 +476,9 @@ base_name (const char *path) /* This function is called when building a ppc32 or ppc64 executable to handle embedded spu images. */ -extern bfd_boolean embedded_spu_file (lang_input_statement_type *, const char *); +extern bool embedded_spu_file (lang_input_statement_type *, const char *); -bfd_boolean +bool embedded_spu_file (lang_input_statement_type *entry, const char *flags) { const char *cmd[6]; @@ -497,7 +497,7 @@ embedded_spu_file (lang_input_statement_type *entry, const char *flags) || strcmp (entry->the_bfd->xvec->name, "elf32-spu") != 0 || (entry->the_bfd->tdata.elf_obj_data->elf_header->e_type != ET_EXEC && entry->the_bfd->tdata.elf_obj_data->elf_header->e_type != ET_DYN)) - return FALSE; + return false; /* Use the filename as the symbol marking the program handle struct. */ sym = base_name (bfd_get_filename (entry->the_bfd)); @@ -509,7 +509,7 @@ embedded_spu_file (lang_input_statement_type *entry, const char *flags) fd = new_tmp_file (&oname); if (fd == -1) - return FALSE; + return false; close (fd); for (search = (void *) input_file_chain.head; @@ -557,13 +557,13 @@ embedded_spu_file (lang_input_statement_type *entry, const char *flags) } } if (status) - return FALSE; + return false; old_stat_tail = stat_ptr->tail; old_file_tail = input_file_chain.tail; if (lang_add_input_file (oname, lang_input_file_is_file_enum, NULL) == NULL) - return FALSE; + return false; /* lang_add_input_file puts the new list entry at the end of the statement and input file lists. Move it to just after the current entry. */ @@ -579,8 +579,8 @@ embedded_spu_file (lang_input_statement_type *entry, const char *flags) /* Ensure bfd sections are excluded from the output. */ bfd_section_list_clear (entry->the_bfd); - entry->flags.loaded = TRUE; - return TRUE; + entry->flags.loaded = true; + return true; } EOF diff --git a/ld/emultempl/ticoff.em b/ld/emultempl/ticoff.em index 030ed92b9c4..5df4116e411 100644 --- a/ld/emultempl/ticoff.em +++ b/ld/emultempl/ticoff.em @@ -69,13 +69,13 @@ gld_${EMULATION_NAME}_list_options (FILE * file) fprintf (file, _(" --format 0|1|2 Specify which COFF version to use\n")); } -static bfd_boolean +static bool gld${EMULATION_NAME}_handle_option (int optc) { switch (optc) { default: - return FALSE; + return false; case OPTION_COFF_FORMAT: if ((*optarg == '0' || *optarg == '1' || *optarg == '2') @@ -92,7 +92,7 @@ gld${EMULATION_NAME}_handle_option (int optc) } break; } - return FALSE; + return false; } static void diff --git a/ld/emultempl/v850elf.em b/ld/emultempl/v850elf.em index 32618d98fc1..6735999e6ac 100644 --- a/ld/emultempl/v850elf.em +++ b/ld/emultempl/v850elf.em @@ -26,7 +26,7 @@ fragment <flags.maybe_archive || entry->flags.full_name_provided) - return FALSE; + return false; string = (char *) xmalloc (strlen (search->name) + strlen (entry->filename) @@ -69,12 +69,12 @@ gld${EMULATION_NAME}_open_dynamic_archive (const char *arch ATTRIBUTE_UNUSED, if (! ldfile_try_open_bfd (string, entry)) { free (string); - return FALSE; + return false; } entry->filename = string; - return TRUE; + return true; } static int @@ -152,20 +152,20 @@ gld${EMULATION_NAME}_list_options (FILE *file) fprintf (file, _(" --identification Set the identification of the output\n")); } -static bfd_boolean +static bool gld${EMULATION_NAME}_handle_option (int optc) { switch (optc) { default: - return FALSE; + return false; case OPTION_IDENTIFICATION: /* Currently ignored. */ break; } - return TRUE; + return true; } EOF diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em index 2b0fa5af64c..23ce9a3534d 100644 --- a/ld/emultempl/xtensaelf.em +++ b/ld/emultempl/xtensaelf.em @@ -52,8 +52,8 @@ static void xtensa_strip_inconsistent_linkonce_sections static bfd_vma xtensa_page_power = 12; /* 4K pages. */ /* To force a page break between literals and text, change - xtensa_use_literal_pages to "TRUE". */ -static bfd_boolean xtensa_use_literal_pages = FALSE; + xtensa_use_literal_pages to "true". */ +static bool xtensa_use_literal_pages = false; #define EXTRA_VALIDATION 0 @@ -96,7 +96,7 @@ remove_section (bfd *abfd, asection *os) } -static bfd_boolean +static bool replace_insn_sec_with_prop_sec (bfd *abfd, const char *insn_sec_name, const char *prop_sec_name, @@ -115,14 +115,14 @@ replace_insn_sec_with_prop_sec (bfd *abfd, *error_message = ""; insn_sec = bfd_get_section_by_name (abfd, insn_sec_name); if (insn_sec == NULL) - return TRUE; + return true; entry_count = insn_sec->size / 8; prop_sec = bfd_get_section_by_name (abfd, prop_sec_name); if (prop_sec != NULL && insn_sec != NULL) { *error_message = _("file already has property tables"); - return FALSE; + return false; } if (insn_sec->size != 0) @@ -173,7 +173,7 @@ replace_insn_sec_with_prop_sec (bfd *abfd, elf_section_data (insn_sec)->relocs = NULL; internal_relocs = - _bfd_elf_link_read_relocs (abfd, insn_sec, NULL, NULL, FALSE); + _bfd_elf_link_read_relocs (abfd, insn_sec, NULL, NULL, false); elf_section_data (insn_sec)->relocs = saved_relocs; if (internal_relocs == NULL) @@ -230,7 +230,7 @@ replace_insn_sec_with_prop_sec (bfd *abfd, free (insn_contents); - return TRUE; + return true; cleanup: if (prop_sec && prop_sec->owner) @@ -238,7 +238,7 @@ replace_insn_sec_with_prop_sec (bfd *abfd, free (insn_contents); free (internal_relocs); - return FALSE; + return false; } @@ -312,15 +312,15 @@ elf_xtensa_after_open (void) } -static bfd_boolean +static bool xt_config_info_unpack_and_check (char *data, - bfd_boolean *pmismatch, + bool *pmismatch, char **pmsg) { char *d, *key; int num; - *pmismatch = FALSE; + *pmismatch = false; d = data; while (*d) @@ -359,7 +359,7 @@ xt_config_info_unpack_and_check (char *data, } else if (num != elf32xtensa_abi) { - *pmismatch = TRUE; + *pmismatch = true; *pmsg = "ABI does not match"; } } @@ -367,7 +367,7 @@ xt_config_info_unpack_and_check (char *data, { if (num != XSHAL_USE_ABSOLUTE_LITERALS) { - *pmismatch = TRUE; + *pmismatch = true; *pmsg = "incompatible use of the Extended L32R option"; } } @@ -377,10 +377,10 @@ xt_config_info_unpack_and_check (char *data, goto error; } - return TRUE; + return true; error: - return FALSE; + return false; } @@ -392,7 +392,7 @@ static void check_xtensa_info (bfd *abfd, asection *info_sec) { char *data, *errmsg = ""; - bfd_boolean mismatch; + bool mismatch; data = xmalloc (info_sec->size); if (! bfd_get_section_contents (abfd, info_sec, data, 0, info_sec->size)) @@ -425,7 +425,7 @@ elf_xtensa_before_allocation (void) { asection *info_sec, *first_info_sec; bfd *first_bfd; - bfd_boolean is_big_endian = XCHAL_HAVE_BE; + bool is_big_endian = XCHAL_HAVE_BE; /* Check that the output endianness matches the Xtensa configuration. The BFD library always includes both big and @@ -565,7 +565,7 @@ struct reloc_deps_section_t { reloc_deps_e *preds; reloc_deps_e *succs; - bfd_boolean is_only_literal; + bool is_only_literal; }; @@ -585,16 +585,16 @@ typedef void (*deps_callback_t) (asection *, /* src_sec */ bfd_vma, /* target_offset */ void *); /* closure */ -extern bfd_boolean xtensa_callback_required_dependence +extern bool xtensa_callback_required_dependence (bfd *, asection *, struct bfd_link_info *, deps_callback_t, void *); static void xtensa_ldlang_clear_addresses (lang_statement_union_type *); -static bfd_boolean ld_local_file_relocations_fit +static bool ld_local_file_relocations_fit (lang_statement_union_type *, const reloc_deps_graph *); static bfd_vma ld_assign_relative_paged_dot (bfd_vma, lang_statement_union_type *, const reloc_deps_graph *, - bfd_boolean); + bool); static bfd_vma ld_xtensa_insert_page_offsets - (bfd_vma, lang_statement_union_type *, reloc_deps_graph *, bfd_boolean); + (bfd_vma, lang_statement_union_type *, reloc_deps_graph *, bool); #if EXTRA_VALIDATION static size_t ld_count_children (lang_statement_union_type *); #endif @@ -691,7 +691,7 @@ free_reloc_deps_graph (reloc_deps_graph *deps) } -static bfd_boolean +static bool section_is_source (const reloc_deps_graph *deps ATTRIBUTE_UNUSED, lang_statement_union_type *s) { @@ -699,7 +699,7 @@ section_is_source (const reloc_deps_graph *deps ATTRIBUTE_UNUSED, const reloc_deps_section *sec_deps; if (s->header.type != lang_input_section_enum) - return FALSE; + return false; sec = s->input_section.section; sec_deps = xtensa_get_section_deps (deps, sec); @@ -707,7 +707,7 @@ section_is_source (const reloc_deps_graph *deps ATTRIBUTE_UNUSED, } -static bfd_boolean +static bool section_is_target (const reloc_deps_graph *deps ATTRIBUTE_UNUSED, lang_statement_union_type *s) { @@ -715,7 +715,7 @@ section_is_target (const reloc_deps_graph *deps ATTRIBUTE_UNUSED, const reloc_deps_section *sec_deps; if (s->header.type != lang_input_section_enum) - return FALSE; + return false; sec = s->input_section.section; sec_deps = xtensa_get_section_deps (deps, sec); @@ -723,7 +723,7 @@ section_is_target (const reloc_deps_graph *deps ATTRIBUTE_UNUSED, } -static bfd_boolean +static bool section_is_source_or_target (const reloc_deps_graph *deps ATTRIBUTE_UNUSED, lang_statement_union_type *s) { @@ -802,14 +802,14 @@ ld_xtensa_move_section_after (xtensa_ld_iter *to, xtensa_ld_iter *current) /* Can only be called with lang_statements that have lists. Returns FALSE if the list is empty. */ -static bfd_boolean +static bool iter_stack_empty (xtensa_ld_iter_stack **stack_p) { return *stack_p == NULL; } -static bfd_boolean +static bool iter_stack_push (xtensa_ld_iter_stack **stack_p, lang_statement_union_type *parent) { @@ -829,12 +829,12 @@ iter_stack_push (xtensa_ld_iter_stack **stack_p, break; default: ASSERT (0); - return FALSE; + return false; } /* Empty. do not push. */ if (l->tail == &l->head) - return FALSE; + return false; stack = xmalloc (sizeof (xtensa_ld_iter_stack)); memset (stack, 0, sizeof (xtensa_ld_iter_stack)); @@ -847,7 +847,7 @@ iter_stack_push (xtensa_ld_iter_stack **stack_p, if (*stack_p != NULL) (*stack_p)->prev = stack; *stack_p = stack; - return TRUE; + return true; } @@ -968,7 +968,7 @@ xtensa_colocate_literals (reloc_deps_graph *deps, xtensa_ld_iter current; /* Location we are checking. */ xtensa_ld_iter *current_p = NULL; - bfd_boolean in_literals = FALSE; + bool in_literals = false; if (deps->count == 0) return; @@ -977,7 +977,7 @@ xtensa_colocate_literals (reloc_deps_graph *deps, while (!iter_stack_empty (stack_p)) { - bfd_boolean skip_increment = FALSE; + bool skip_increment = false; lang_statement_union_type *l = iter_stack_current (stack_p); switch (l->header.type) @@ -985,7 +985,7 @@ xtensa_colocate_literals (reloc_deps_graph *deps, case lang_assignment_statement_enum: /* Any assignment statement should block reordering across it. */ front_p = NULL; - in_literals = FALSE; + in_literals = false; break; case lang_input_section_enum: @@ -1001,7 +1001,7 @@ xtensa_colocate_literals (reloc_deps_graph *deps, } else { - bfd_boolean is_target; + bool is_target; current_p = ¤t; iter_stack_copy_current (stack_p, current_p); is_target = (section_is_target (deps, l) @@ -1011,7 +1011,7 @@ xtensa_colocate_literals (reloc_deps_graph *deps, { iter_stack_copy_current (stack_p, front_p); if (!is_target) - in_literals = FALSE; + in_literals = false; } else { @@ -1038,7 +1038,7 @@ xtensa_colocate_literals (reloc_deps_graph *deps, front_p->loc = &(*front_p->loc)->header.next; /* Do not increment the current pointer. */ - skip_increment = TRUE; + skip_increment = true; } } } @@ -1104,7 +1104,7 @@ xtensa_move_dependencies_to_front (reloc_deps_graph *deps, } -static bfd_boolean +static bool deps_has_sec_edge (const reloc_deps_graph *deps, asection *src, asection *tgt) { const reloc_deps_section *sec_deps; @@ -1112,7 +1112,7 @@ deps_has_sec_edge (const reloc_deps_graph *deps, asection *src, asection *tgt) sec_deps = xtensa_get_section_deps (deps, src); if (sec_deps == NULL) - return FALSE; + return false; for (sec_deps_e = sec_deps->succs; sec_deps_e != NULL; @@ -1120,26 +1120,26 @@ deps_has_sec_edge (const reloc_deps_graph *deps, asection *src, asection *tgt) { ASSERT (sec_deps_e->src == src); if (sec_deps_e->tgt == tgt) - return TRUE; + return true; } - return FALSE; + return false; } -static bfd_boolean +static bool deps_has_edge (const reloc_deps_graph *deps, lang_statement_union_type *src, lang_statement_union_type *tgt) { if (!section_is_source (deps, src)) - return FALSE; + return false; if (!section_is_target (deps, tgt)) - return FALSE; + return false; if (src->header.type != lang_input_section_enum) - return FALSE; + return false; if (tgt->header.type != lang_input_section_enum) - return FALSE; + return false; return deps_has_sec_edge (deps, src->input_section.section, tgt->input_section.section); @@ -1275,7 +1275,7 @@ ld_count_children (lang_statement_union_type *s) /* Check if a particular section is included in the link. This will only be true for one instance of a particular linkonce section. */ -static bfd_boolean input_section_found = FALSE; +static bool input_section_found = false; static asection *input_section_target = NULL; static void @@ -1283,13 +1283,13 @@ input_section_linked_worker (lang_statement_union_type *statement) { if ((statement->header.type == lang_input_section_enum && (statement->input_section.section == input_section_target))) - input_section_found = TRUE; + input_section_found = true; } -static bfd_boolean +static bool input_section_linked (asection *sec) { - input_section_found = FALSE; + input_section_found = false; input_section_target = sec; lang_for_each_statement_worker (input_section_linked_worker, stat_ptr->head); return input_section_found; @@ -1306,7 +1306,7 @@ input_section_linked (asection *sec) static int linkonce_len = sizeof (".gnu.linkonce.") - 1; -static bfd_boolean +static bool is_inconsistent_linkonce_section (asection *sec) { bfd *abfd = sec->owner; @@ -1315,7 +1315,7 @@ is_inconsistent_linkonce_section (asection *sec) if ((bfd_section_flags (sec) & SEC_LINK_ONCE) == 0 || strncmp (sec_name, ".gnu.linkonce.", linkonce_len) != 0) - return FALSE; + return false; /* Check if this is an Xtensa property section or an exception table for Tensilica's XCC compiler. */ @@ -1342,12 +1342,12 @@ is_inconsistent_linkonce_section (asection *sec) if (dep_sec == NULL || ! input_section_linked (dep_sec)) { free (dep_sec_name); - return TRUE; + return true; } free (dep_sec_name); } - return FALSE; + return false; } @@ -1428,20 +1428,20 @@ xtensa_wild_group_interleave_callback (lang_statement_union_type *statement) size_t old_child_count; size_t new_child_count; #endif - bfd_boolean no_reorder; + bool no_reorder; w = &statement->wild_statement; - no_reorder = FALSE; + no_reorder = false; /* If it has 0 or 1 section bound, then do not reorder. */ if (w->children.head == NULL || (w->children.head->header.type == lang_input_section_enum && w->children.head->header.next == NULL)) - no_reorder = TRUE; + no_reorder = true; if (w->filenames_sorted) - no_reorder = TRUE; + no_reorder = true; /* Check for sorting in a section list wildcard spec as well. */ if (!no_reorder) @@ -1451,7 +1451,7 @@ xtensa_wild_group_interleave_callback (lang_statement_union_type *statement) { if (l->spec.sorted == by_name) { - no_reorder = TRUE; + no_reorder = true; break; } } @@ -1470,7 +1470,7 @@ xtensa_wild_group_interleave_callback (lang_statement_union_type *statement) && ((strcmp (".init", l->spec.name) == 0) || (strcmp (".fini", l->spec.name) == 0))) { - no_reorder = TRUE; + no_reorder = true; break; } } @@ -1533,9 +1533,9 @@ xtensa_layout_wild (const reloc_deps_graph *deps, lang_wild_statement_type *w) literal_wild.header.next = NULL; literal_wild.header.type = lang_wild_statement_enum; literal_wild.filename = NULL; - literal_wild.filenames_sorted = FALSE; + literal_wild.filenames_sorted = false; literal_wild.section_list = NULL; - literal_wild.keep_sections = FALSE; + literal_wild.keep_sections = false; literal_wild.children.head = NULL; literal_wild.children.tail = &literal_wild.children.head; @@ -1579,7 +1579,7 @@ xtensa_layout_wild (const reloc_deps_graph *deps, lang_wild_statement_type *w) while (literal_wild.children.head != NULL) { lang_statement_union_type *lit = literal_wild.children.head; - bfd_boolean placed = FALSE; + bool placed = false; #if EXTRA_VALIDATION ASSERT (ct2 > 0); @@ -1601,7 +1601,7 @@ xtensa_layout_wild (const reloc_deps_graph *deps, lang_wild_statement_type *w) /* Place it here. */ lit->header.next = *s_p; *s_p = lit; - placed = TRUE; + placed = true; break; } } @@ -1643,7 +1643,7 @@ xtensa_colocate_output_literals_callback (lang_statement_union_type *statement) size_t old_child_count; size_t new_child_count; #endif - bfd_boolean no_reorder = FALSE; + bool no_reorder = false; #if EXTRA_VALIDATION old_child_count = ld_count_children (statement); @@ -1709,7 +1709,7 @@ static bfd_vma ld_assign_relative_paged_dot (bfd_vma dot, lang_statement_union_type *s, const reloc_deps_graph *deps ATTRIBUTE_UNUSED, - bfd_boolean lit_align) + bool lit_align) { /* Walk through all of the input statements in this wild statement assign dot to all of them. */ @@ -1717,8 +1717,8 @@ ld_assign_relative_paged_dot (bfd_vma dot, xtensa_ld_iter_stack *stack = NULL; xtensa_ld_iter_stack **stack_p = &stack; - bfd_boolean first_section = FALSE; - bfd_boolean in_literals = FALSE; + bool first_section = false; + bool in_literals = false; for (iter_stack_create (stack_p, s); !iter_stack_empty (stack_p); @@ -1732,21 +1732,21 @@ ld_assign_relative_paged_dot (bfd_vma dot, { asection *section = l->input_section.section; size_t align_pow = section->alignment_power; - bfd_boolean do_xtensa_alignment = FALSE; + bool do_xtensa_alignment = false; if (lit_align) { - bfd_boolean sec_is_target = section_is_target (deps, l); - bfd_boolean sec_is_source = section_is_source (deps, l); + bool sec_is_target = section_is_target (deps, l); + bool sec_is_source = section_is_source (deps, l); if (section->size != 0 && (first_section || (in_literals && !sec_is_target) || (!in_literals && sec_is_target))) { - do_xtensa_alignment = TRUE; + do_xtensa_alignment = true; } - first_section = FALSE; + first_section = false; if (section->size != 0) in_literals = (sec_is_target && !sec_is_source); } @@ -1773,7 +1773,7 @@ ld_assign_relative_paged_dot (bfd_vma dot, } -static bfd_boolean +static bool ld_local_file_relocations_fit (lang_statement_union_type *statement, const reloc_deps_graph *deps ATTRIBUTE_UNUSED) { @@ -1831,17 +1831,17 @@ ld_local_file_relocations_fit (lang_statement_union_type *statement, fprintf (stderr, "Warning: " "l32r target section before l32r\n"); fflush (stderr); - return FALSE; + return false; } if (l32r_addr - target_addr > 256 * 1024 - align_penalty) - return FALSE; + return false; } } } } - return TRUE; + return true; } @@ -1849,16 +1849,16 @@ static bfd_vma ld_xtensa_insert_page_offsets (bfd_vma dot, lang_statement_union_type *s, reloc_deps_graph *deps, - bfd_boolean lit_align) + bool lit_align) { xtensa_ld_iter_stack *stack = NULL; xtensa_ld_iter_stack **stack_p = &stack; - bfd_boolean first_section = FALSE; - bfd_boolean in_literals = FALSE; + bool first_section = false; + bool in_literals = false; if (!lit_align) - return FALSE; + return false; for (iter_stack_create (stack_p, s); !iter_stack_empty (stack_p); @@ -1871,7 +1871,7 @@ ld_xtensa_insert_page_offsets (bfd_vma dot, case lang_input_section_enum: { asection *section = l->input_section.section; - bfd_boolean do_xtensa_alignment = FALSE; + bool do_xtensa_alignment = false; if (lit_align) { @@ -1880,9 +1880,9 @@ ld_xtensa_insert_page_offsets (bfd_vma dot, || (in_literals && !section_is_target (deps, l)) || (!in_literals && section_is_target (deps, l)))) { - do_xtensa_alignment = TRUE; + do_xtensa_alignment = true; } - first_section = FALSE; + first_section = false; if (section->size != 0) { in_literals = (section_is_target (deps, l) @@ -1897,7 +1897,7 @@ ld_xtensa_insert_page_offsets (bfd_vma dot, etree_type *name_op = exp_nameop (NAME, "."); etree_type *addend_op = exp_intop (1 << xtensa_page_power); etree_type *add_op = exp_binop ('+', name_op, addend_op); - etree_type *assign_op = exp_assign (".", add_op, FALSE); + etree_type *assign_op = exp_assign (".", add_op, false); lang_assignment_statement_type *assign_stmt; lang_statement_union_type *assign_union; diff --git a/ld/emultempl/z80.em b/ld/emultempl/z80.em index c112bdbb718..b72132eb30e 100644 --- a/ld/emultempl/z80.em +++ b/ld/emultempl/z80.em @@ -46,7 +46,7 @@ z80_after_open (void) for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link.next) { const bfd_arch_info_type *info; - info = bfd_arch_get_compatible (link_info.output_bfd, abfd, FALSE); + info = bfd_arch_get_compatible (link_info.output_bfd, abfd, false); if (info == NULL) einfo (_("%F%P: %pB: Instruction sets of object files incompatible\n"), abfd); diff --git a/ld/ld.h b/ld/ld.h index 93f5af92c7d..1f52be9add6 100644 --- a/ld/ld.h +++ b/ld/ld.h @@ -122,25 +122,25 @@ enum endian_enum { ENDIAN_UNSET = 0, ENDIAN_BIG, ENDIAN_LITTLE }; typedef struct { /* 1 => assign space to common symbols even if `relocatable_output'. */ - bfd_boolean force_common_definition; + bool force_common_definition; /* If TRUE, build MIPS embedded PIC relocation tables in the output file. */ - bfd_boolean embedded_relocs; + bool embedded_relocs; /* If TRUE, force generation of a file with a .exe file. */ - bfd_boolean force_exe_suffix; + bool force_exe_suffix; /* If TRUE, generate a cross reference report. */ - bfd_boolean cref; + bool cref; /* If TRUE (which is the default), warn about mismatched input files. */ - bfd_boolean warn_mismatch; + bool warn_mismatch; /* Warn on attempting to open an incompatible library during a library search. */ - bfd_boolean warn_search_mismatch; + bool warn_search_mismatch; /* If non-zero check section addresses, once computed, for overlaps. Relocatable links only check when this is > 0. */ @@ -150,21 +150,21 @@ typedef struct assuming that the user knows what they are doing. This was the old behaviour of the linker. The new default behaviour is to reject such input files. */ - bfd_boolean accept_unknown_input_arch; + bool accept_unknown_input_arch; /* Name of the import library to generate. */ char *out_implib_filename; /* If TRUE we'll just print the default output on stdout. */ - bfd_boolean print_output_format; + bool print_output_format; /* If set, display the target memory usage (per memory region). */ - bfd_boolean print_memory_usage; + bool print_memory_usage; /* Should we force section groups to be resolved? Controlled with --force-group-allocation on the command line or FORCE_GROUP_ALLOCATION in the linker script. */ - bfd_boolean force_group_allocation; + bool force_group_allocation; /* Big or little endian as set on command line. */ enum endian_enum endian; @@ -224,61 +224,61 @@ enum orphan_handling_enum typedef struct { - bfd_boolean magic_demand_paged; - bfd_boolean make_executable; + bool magic_demand_paged; + bool make_executable; /* If TRUE, -shared is supported. */ /* ??? A better way to do this is perhaps to define this in the ld_emulation_xfer_struct since this is really a target dependent parameter. */ - bfd_boolean has_shared; + bool has_shared; /* If TRUE, build constructors. */ - bfd_boolean build_constructors; + bool build_constructors; /* If TRUE, warn about any constructors. */ - bfd_boolean warn_constructors; + bool warn_constructors; /* If TRUE, warn about merging common symbols with others. */ - bfd_boolean warn_common; + bool warn_common; /* If TRUE, only warn once about a particular undefined symbol. */ - bfd_boolean warn_once; + bool warn_once; /* How should we deal with orphan sections. */ enum orphan_handling_enum orphan_handling; /* If TRUE, warn if multiple global-pointers are needed (Alpha only). */ - bfd_boolean warn_multiple_gp; + bool warn_multiple_gp; /* If TRUE, warn if the starting address of an output section changes due to the alignment of an input section. */ - bfd_boolean warn_section_align; + bool warn_section_align; /* If TRUE, warning messages are fatal */ - bfd_boolean fatal_warnings; + bool fatal_warnings; sort_order sort_common; - bfd_boolean text_read_only; + bool text_read_only; - bfd_boolean stats; + bool stats; /* If set, orphan input sections will be mapped to separate output sections. */ - bfd_boolean unique_orphan_sections; + bool unique_orphan_sections; /* If set, only search library directories explicitly selected on the command line. */ - bfd_boolean only_cmd_line_lib_dirs; + bool only_cmd_line_lib_dirs; /* If set, numbers and absolute symbols are simply treated as numbers everywhere. */ - bfd_boolean sane_expr; + bool sane_expr; /* If set, code and non-code sections should never be in one segment. */ - bfd_boolean separate_code; + bool separate_code; /* The rpath separation character. Usually ':'. */ char rpath_separator; @@ -295,25 +295,25 @@ typedef struct unsigned long hash_table_size; /* If set, print discarded sections in map file output. */ - bfd_boolean print_map_discarded; + bool print_map_discarded; /* If set, emit the names and types of statically-linked variables into the CTF. */ - bfd_boolean ctf_variables; + bool ctf_variables; /* If set, share only duplicated types in CTF, rather than sharing all types that are not in conflict. */ - bfd_boolean ctf_share_duplicated; + bool ctf_share_duplicated; } ld_config_type; extern ld_config_type config; extern FILE * saved_script_handle; -extern bfd_boolean force_make_executable; +extern bool force_make_executable; extern int yyparse (void); extern void add_cref (const char *, bfd *, asection *, bfd_vma); -extern bfd_boolean handle_asneeded_cref (bfd *, enum notice_asneeded_action); +extern bool handle_asneeded_cref (bfd *, enum notice_asneeded_action); extern void output_cref (FILE *); extern void check_nocrossrefs (void); extern void ld_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; diff --git a/ld/ldbuildid.c b/ld/ldbuildid.c index c55a939ae2f..c0e91bcefc9 100644 --- a/ld/ldbuildid.c +++ b/ld/ldbuildid.c @@ -32,14 +32,14 @@ #define streq(a,b) strcmp ((a), (b)) == 0 #define strneq(a,b,n) strncmp ((a), (b), (n)) == 0 -bfd_boolean +bool validate_build_id_style (const char *style) { if ((streq (style, "md5")) || (streq (style, "sha1")) || (streq (style, "uuid")) || (strneq (style, "0x", 2))) - return TRUE; + return true; - return FALSE; + return false; } bfd_size_type @@ -94,7 +94,7 @@ read_hex (const char xdigit) return 0; } -bfd_boolean +bool generate_build_id (bfd *abfd, const char *style, checksum_fn checksum_contents, @@ -107,7 +107,7 @@ generate_build_id (bfd *abfd, md5_init_ctx (&ctx); if (!(*checksum_contents) (abfd, (sum_fn) &md5_process_bytes, &ctx)) - return FALSE; + return false; md5_finish_ctx (&ctx, id_bits); } else if (streq (style, "sha1")) @@ -116,7 +116,7 @@ generate_build_id (bfd *abfd, sha1_init_ctx (&ctx); if (!(*checksum_contents) (abfd, (sum_fn) &sha1_process_bytes, &ctx)) - return FALSE; + return false; sha1_finish_ctx (&ctx, id_bits); } else if (streq (style, "uuid")) @@ -126,11 +126,11 @@ generate_build_id (bfd *abfd, int fd = open ("/dev/urandom", O_RDONLY); if (fd < 0) - return FALSE; + return false; n = read (fd, id_bits, size); close (fd); if (n < size) - return FALSE; + return false; #else /* __MINGW32__ */ typedef RPC_STATUS (RPC_ENTRY * UuidCreateFn) (UUID *); UUID uuid; @@ -138,18 +138,18 @@ generate_build_id (bfd *abfd, HMODULE rpc_library = LoadLibrary ("rpcrt4.dll"); if (!rpc_library) - return FALSE; + return false; uuid_create = (UuidCreateFn) (void (WINAPI *)(void)) GetProcAddress (rpc_library, "UuidCreate"); if (!uuid_create) { FreeLibrary (rpc_library); - return FALSE; + return false; } if (uuid_create (&uuid) != RPC_S_OK) { FreeLibrary (rpc_library); - return FALSE; + return false; } FreeLibrary (rpc_library); memcpy (id_bits, &uuid, @@ -179,5 +179,5 @@ generate_build_id (bfd *abfd, else abort (); /* Should have been validated earlier. */ - return TRUE; + return true; } diff --git a/ld/ldbuildid.h b/ld/ldbuildid.h index 2e104fc11ed..7cb9d957dad 100644 --- a/ld/ldbuildid.h +++ b/ld/ldbuildid.h @@ -21,7 +21,7 @@ #ifndef LDBUILDID_H #define LDBUILDID_H -extern bfd_boolean +extern bool validate_build_id_style (const char *); extern bfd_size_type @@ -29,11 +29,11 @@ compute_build_id_size (const char *); typedef void (*sum_fn) (const void *, size_t, void *); -typedef bfd_boolean (*checksum_fn) (bfd *, - void (*) (const void *, size_t, void *), - void *); +typedef bool (*checksum_fn) (bfd *, + void (*) (const void *, size_t, void *), + void *); -extern bfd_boolean +extern bool generate_build_id (bfd *, const char *, checksum_fn, unsigned char *, int); #endif /* LDBUILDID_H */ diff --git a/ld/ldcref.c b/ld/ldcref.c index 3ea84b676d4..1a54bbf438a 100644 --- a/ld/ldcref.c +++ b/ld/ldcref.c @@ -77,8 +77,8 @@ struct cref_hash_table static void output_one_cref (FILE *, struct cref_hash_entry *); static void check_local_sym_xref (lang_input_statement_type *); -static bfd_boolean check_nocrossref (struct cref_hash_entry *, void *); -static void check_refs (const char *, bfd_boolean, asection *, bfd *, +static bool check_nocrossref (struct cref_hash_entry *, void *); +static void check_refs (const char *, bool, asection *, bfd *, struct lang_nocrossrefs *); static void check_reloc_refs (bfd *, asection *, void *); @@ -93,8 +93,7 @@ static void check_reloc_refs (bfd *, asection *, void *); #define cref_hash_traverse(table, func, info) \ (bfd_hash_traverse \ (&(table)->root, \ - (bfd_boolean (*) (struct bfd_hash_entry *, void *)) (func), \ - (info))) + (bool (*) (struct bfd_hash_entry *, void *)) (func), (info))) /* The cref hash table. */ @@ -102,7 +101,7 @@ static struct cref_hash_table cref_table; /* Whether the cref hash table has been initialized. */ -static bfd_boolean cref_initialized; +static bool cref_initialized; /* The number of symbols seen so far. */ @@ -169,10 +168,10 @@ add_cref (const char *name, if (!bfd_hash_table_init (&cref_table.root, cref_hash_newfunc, sizeof (struct cref_hash_entry))) einfo (_("%X%P: bfd_hash_table_init of cref table failed: %E\n")); - cref_initialized = TRUE; + cref_initialized = true; } - h = cref_hash_lookup (&cref_table, name, TRUE, FALSE); + h = cref_hash_lookup (&cref_table, name, true, false); if (h == NULL) einfo (_("%X%P: cref_hash_lookup failed: %E\n")); @@ -188,31 +187,31 @@ add_cref (const char *name, r->next = h->refs; h->refs = r; r->abfd = abfd; - r->def = FALSE; - r->common = FALSE; - r->undef = FALSE; + r->def = false; + r->common = false; + r->undef = false; } if (bfd_is_und_section (section)) - r->undef = TRUE; + r->undef = true; else if (bfd_is_com_section (section)) - r->common = TRUE; + r->common = true; else - r->def = TRUE; + r->def = true; } /* Called before loading an as-needed library to take a snapshot of the cref hash table, and after we have loaded or found that the library was not needed. */ -bfd_boolean +bool handle_asneeded_cref (bfd *abfd ATTRIBUTE_UNUSED, enum notice_asneeded_action act) { unsigned int i; if (!cref_initialized) - return TRUE; + return true; if (act == notice_as_needed) { @@ -238,7 +237,7 @@ handle_asneeded_cref (bfd *abfd ATTRIBUTE_UNUSED, alloc_mark = bfd_hash_allocate (&cref_table.root, 1); if (alloc_mark == NULL) - return FALSE; + return false; memcpy (old_tab, cref_table.root.table, tabsize); old_ent = (char *) old_tab + tabsize; @@ -266,7 +265,7 @@ handle_asneeded_cref (bfd *abfd ATTRIBUTE_UNUSED, } } } - return TRUE; + return true; } if (act == notice_not_needed) @@ -278,8 +277,8 @@ handle_asneeded_cref (bfd *abfd ATTRIBUTE_UNUSED, /* The only way old_tab can be NULL is if the cref hash table had not been initialised when notice_as_needed. */ bfd_hash_table_free (&cref_table.root); - cref_initialized = FALSE; - return TRUE; + cref_initialized = false; + return true; } old_ent = (char *) old_tab + tabsize; @@ -313,18 +312,18 @@ handle_asneeded_cref (bfd *abfd ATTRIBUTE_UNUSED, alloc_mark); } else if (act != notice_needed) - return FALSE; + return false; free (old_tab); old_tab = NULL; - return TRUE; + return true; } /* Copy the addresses of the hash table entries into an array. This is called via cref_hash_traverse. We also fill in the demangled name. */ -static bfd_boolean +static bool cref_fill_array (struct cref_hash_entry *h, void *data) { struct cref_hash_entry ***pph = (struct cref_hash_entry ***) data; @@ -339,7 +338,7 @@ cref_fill_array (struct cref_hash_entry *h, void *data) ++*pph; - return TRUE; + return true; } /* Sort an array of cref hash table entries by name. */ @@ -408,8 +407,8 @@ output_one_cref (FILE *fp, struct cref_hash_entry *h) struct bfd_link_hash_entry *hl; struct cref_ref *r; - hl = bfd_link_hash_lookup (link_info.hash, h->root.string, FALSE, - FALSE, TRUE); + hl = bfd_link_hash_lookup (link_info.hash, h->root.string, false, + false, true); if (hl == NULL) einfo (_("%P: symbol `%pT' missing from main hash table\n"), h->root.string); @@ -537,7 +536,7 @@ check_local_sym_xref (lang_input_statement_type *statement) for (ncr = ncrs->list; ncr != NULL; ncr = ncr->next) { if (strcmp (ncr->name, outsecname) == 0) - check_refs (symname, FALSE, sym->section, abfd, ncrs); + check_refs (symname, false, sym->section, abfd, ncrs); /* The NOCROSSREFS_TO command only checks symbols defined in the first section in the list. */ if (ncrs->onlyfirst) @@ -549,7 +548,7 @@ check_local_sym_xref (lang_input_statement_type *statement) /* Check one symbol to see if it is a prohibited cross reference. */ -static bfd_boolean +static bool check_nocrossref (struct cref_hash_entry *h, void *ignore ATTRIBUTE_UNUSED) { struct bfd_link_hash_entry *hl; @@ -559,22 +558,22 @@ check_nocrossref (struct cref_hash_entry *h, void *ignore ATTRIBUTE_UNUSED) struct lang_nocrossref *ncr; struct cref_ref *ref; - hl = bfd_link_hash_lookup (link_info.hash, h->root.string, FALSE, - FALSE, TRUE); + hl = bfd_link_hash_lookup (link_info.hash, h->root.string, false, + false, true); if (hl == NULL) { einfo (_("%P: symbol `%pT' missing from main hash table\n"), h->root.string); - return TRUE; + return true; } if (hl->type != bfd_link_hash_defined && hl->type != bfd_link_hash_defweak) - return TRUE; + return true; defsec = hl->u.def.section->output_section; if (defsec == NULL) - return TRUE; + return true; defsecname = bfd_section_name (defsec); for (ncrs = nocrossref_list; ncrs != NULL; ncrs = ncrs->next) @@ -582,7 +581,7 @@ check_nocrossref (struct cref_hash_entry *h, void *ignore ATTRIBUTE_UNUSED) { if (strcmp (ncr->name, defsecname) == 0) for (ref = h->refs; ref != NULL; ref = ref->next) - check_refs (hl->root.string, TRUE, hl->u.def.section, + check_refs (hl->root.string, true, hl->u.def.section, ref->abfd, ncrs); /* The NOCROSSREFS_TO command only checks symbols defined in the first section in the list. */ @@ -590,7 +589,7 @@ check_nocrossref (struct cref_hash_entry *h, void *ignore ATTRIBUTE_UNUSED) break; } - return TRUE; + return true; } /* The struct is used to pass information from check_refs to @@ -602,7 +601,7 @@ struct check_refs_info asection *defsec; struct lang_nocrossrefs *ncrs; asymbol **asymbols; - bfd_boolean global; + bool global; }; /* This function is called for each symbol defined in a section which @@ -612,7 +611,7 @@ struct check_refs_info static void check_refs (const char *name, - bfd_boolean global, + bool global, asection *sec, bfd *abfd, struct lang_nocrossrefs *ncrs) @@ -652,7 +651,7 @@ check_reloc_refs (bfd *abfd, asection *sec, void *iarg) const char *outdefsecname; struct lang_nocrossref *ncr; const char *symname; - bfd_boolean global; + bool global; long relsize; arelent **relpp; long relcount; diff --git a/ld/ldctor.c b/ld/ldctor.c index 841ffe3b1e5..830ec6e87e2 100644 --- a/ld/ldctor.c +++ b/ld/ldctor.c @@ -40,7 +40,7 @@ lang_statement_list_type constructor_list; /* Whether the constructors should be sorted. Note that this is global for the entire link; we assume that there is only a single CONSTRUCTORS command in the linker script. */ -bfd_boolean constructors_sorted; +bool constructors_sorted; /* The sets we have seen. */ struct set_info *sets; @@ -195,15 +195,15 @@ ctor_cmp (const void *p1, const void *p2) void ldctor_build_sets (void) { - static bfd_boolean called; - bfd_boolean header_printed; + static bool called; + bool header_printed; struct set_info *p; /* The emulation code may call us directly, but we only want to do this once. */ if (called) return; - called = TRUE; + called = true; if (constructors_sorted) { @@ -246,7 +246,7 @@ ldctor_build_sets (void) lang_list_init (&constructor_list); push_stat_ptr (&constructor_list); - header_printed = FALSE; + header_printed = false; for (p = sets; p != NULL; p = p->next) { struct set_element *e; @@ -326,10 +326,10 @@ ldctor_build_sets (void) lang_add_assignment (exp_assign (".", exp_unop (ALIGN_K, exp_intop (reloc_size)), - FALSE)); + false)); lang_add_assignment (exp_assign (p->h->root.string, exp_nameop (NAME, "."), - FALSE)); + false)); lang_add_data (size, exp_intop (p->count)); for (e = p->elements; e != NULL; e = e->u.next) @@ -341,7 +341,7 @@ ldctor_build_sets (void) if (!header_printed) { minfo (_("\nSet Symbol\n\n")); - header_printed = TRUE; + header_printed = true; } minfo ("%s", p->h->root.string); diff --git a/ld/ldctor.h b/ld/ldctor.h index d780e85e59c..6efe349bb83 100644 --- a/ld/ldctor.h +++ b/ld/ldctor.h @@ -27,7 +27,7 @@ extern lang_statement_list_type constructor_list; /* Whether the constructors should be sorted. Note that this is global for the entire link; we assume that there is only a single CONSTRUCTORS command in the linker script. */ -extern bfd_boolean constructors_sorted; +extern bool constructors_sorted; /* We keep a list of these structures for each set we build. */ diff --git a/ld/ldelf.c b/ld/ldelf.c index 94d775db5cd..631d11b9217 100644 --- a/ld/ldelf.c +++ b/ld/ldelf.c @@ -56,7 +56,7 @@ static struct bfd_link_needed_list *global_needed; static lang_input_statement_type *global_found; static struct stat global_stat; static struct bfd_link_needed_list *global_vercheck_needed; -static bfd_boolean global_vercheck_failed; +static bool global_vercheck_failed; void ldelf_after_parse (void) @@ -76,7 +76,7 @@ ldelf_after_parse (void) /* Handle the generation of DT_NEEDED tags. */ -bfd_boolean +bool ldelf_load_symbols (lang_input_statement_type *entry) { int link_class = 0; @@ -100,13 +100,13 @@ ldelf_load_symbols (lang_input_statement_type *entry) if (link_class == 0 || (bfd_get_file_flags (entry->the_bfd) & DYNAMIC) == 0) - return FALSE; + return false; bfd_elf_set_dyn_lib_class (entry->the_bfd, (enum dynamic_lib_link_class) link_class); /* Continue on with normal load_symbols processing. */ - return FALSE; + return false; } /* On Linux, it's possible to have different versions of the same @@ -168,7 +168,7 @@ ldelf_vercheck (lang_input_statement_type *s) FOO.SO.VER2, and VER1 and VER2 are different. This appears to be a version mismatch, so we tell the caller to try a different version of this library. */ - global_vercheck_failed = TRUE; + global_vercheck_failed = true; return; } } @@ -246,7 +246,7 @@ ldelf_stat_needed (lang_input_statement_type *s) named by a DT_NEEDED entry. The FORCE parameter indicates whether to skip the check for a conflicting version. */ -static bfd_boolean +static bool ldelf_try_needed (struct dt_needed *needed, int force, int is_linux) { bfd *abfd; @@ -259,7 +259,7 @@ ldelf_try_needed (struct dt_needed *needed, int force, int is_linux) { if (verbose) info_msg (_("attempt to open %s failed\n"), name); - return FALSE; + return false; } track_dependency_files (name); @@ -270,19 +270,19 @@ ldelf_try_needed (struct dt_needed *needed, int force, int is_linux) if (! bfd_check_format (abfd, bfd_object)) { bfd_close (abfd); - return FALSE; + return false; } if ((bfd_get_file_flags (abfd) & DYNAMIC) == 0) { bfd_close (abfd); - return FALSE; + return false; } /* For DT_NEEDED, they have to match. */ if (abfd->xvec != link_info.output_bfd->xvec) { bfd_close (abfd); - return FALSE; + return false; } /* Check whether this object would include any conflicting library @@ -300,14 +300,14 @@ ldelf_try_needed (struct dt_needed *needed, int force, int is_linux) if (needs != NULL) { global_vercheck_needed = needs; - global_vercheck_failed = FALSE; + global_vercheck_failed = false; lang_for_each_input_file (ldelf_vercheck); if (global_vercheck_failed) { bfd_close (abfd); /* Return FALSE to force the caller to move on to try another file on the search path. */ - return FALSE; + return false; } /* But wait! It gets much worse. On Linux, if a shared @@ -326,7 +326,7 @@ ldelf_try_needed (struct dt_needed *needed, int force, int is_linux) if (l == NULL) { bfd_close (abfd); - return FALSE; + return false; } } } @@ -357,7 +357,7 @@ ldelf_try_needed (struct dt_needed *needed, int force, int is_linux) { /* Return TRUE to indicate that we found the file, even though we aren't going to do anything with it. */ - return TRUE; + return true; } /* Specify the soname to use. */ @@ -384,12 +384,12 @@ ldelf_try_needed (struct dt_needed *needed, int force, int is_linux) if (! bfd_link_add_symbols (abfd, &link_info)) einfo (_("%F%P: %pB: error adding symbols: %E\n"), abfd); - return TRUE; + return true; } /* Search for a needed file in a path. */ -static bfd_boolean +static bool ldelf_search_needed (const char *path, struct dt_needed *n, int force, int is_linux, int elfsize) { @@ -402,7 +402,7 @@ ldelf_search_needed (const char *path, struct dt_needed *n, int force, return ldelf_try_needed (n, force, is_linux); if (path == NULL || *path == '\0') - return FALSE; + return false; needed.by = n->by; needed.name = n->name; @@ -586,7 +586,7 @@ ldelf_search_needed (const char *path, struct dt_needed *n, int force, needed.name = filename; if (ldelf_try_needed (&needed, force, is_linux)) - return TRUE; + return true; free (filename); @@ -595,7 +595,7 @@ ldelf_search_needed (const char *path, struct dt_needed *n, int force, path = s + 1; } - return FALSE; + return false; } /* Prefix the sysroot to absolute paths in PATH, a string containing @@ -687,11 +687,11 @@ ldelf_add_sysroot (const char *path) #include "elf-hints-local.h" #endif -static bfd_boolean +static bool ldelf_check_ld_elf_hints (const struct bfd_link_needed_list *l, int force, int elfsize) { - static bfd_boolean initialized; + static bool initialized; static const char *ld_elf_hints; struct dt_needed needed; @@ -726,15 +726,15 @@ ldelf_check_ld_elf_hints (const struct bfd_link_needed_list *l, int force, fclose (f); } - initialized = TRUE; + initialized = true; } if (ld_elf_hints == NULL) - return FALSE; + return false; needed.by = l->by; needed.name = l->name; - return ldelf_search_needed (ld_elf_hints, &needed, force, FALSE, elfsize); + return ldelf_search_needed (ld_elf_hints, &needed, force, false, elfsize); } /* For a native linker, check the file /etc/ld.so.conf for directories @@ -747,7 +747,7 @@ struct ldelf_ld_so_conf size_t len, alloc; }; -static bfd_boolean +static bool ldelf_parse_ld_so_conf (struct ldelf_ld_so_conf *, const char *); static void @@ -788,7 +788,7 @@ ldelf_parse_ld_so_conf_include (struct ldelf_ld_so_conf *info, free (newp); } -static bfd_boolean +static bool ldelf_parse_ld_so_conf (struct ldelf_ld_so_conf *info, const char *filename) { FILE *f = fopen (filename, FOPEN_RT); @@ -796,7 +796,7 @@ ldelf_parse_ld_so_conf (struct ldelf_ld_so_conf *info, const char *filename) size_t linelen; if (f == NULL) - return FALSE; + return false; linelen = 256; line = xmalloc (linelen); @@ -893,14 +893,14 @@ ldelf_parse_ld_so_conf (struct ldelf_ld_so_conf *info, const char *filename) while (! feof (f)); free (line); fclose (f); - return TRUE; + return true; } -static bfd_boolean +static bool ldelf_check_ld_so_conf (const struct bfd_link_needed_list *l, int force, int elfsize, const char *prefix) { - static bfd_boolean initialized; + static bool initialized; static const char *ld_so_conf; struct dt_needed needed; @@ -927,16 +927,16 @@ ldelf_check_ld_so_conf (const struct bfd_link_needed_list *l, int force, ld_so_conf = ldelf_add_sysroot (info.path); free (info.path); } - initialized = TRUE; + initialized = true; } if (ld_so_conf == NULL) - return FALSE; + return false; needed.by = l->by; needed.name = l->name; - return ldelf_search_needed (ld_so_conf, &needed, force, TRUE, elfsize); + return ldelf_search_needed (ld_so_conf, &needed, force, true, elfsize); } /* See if an input file matches a DT_NEEDED entry by name. */ @@ -1073,7 +1073,7 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd, if (!link_info.traditional_format) { bfd *elfbfd = NULL; - bfd_boolean warn_eh_frame = FALSE; + bool warn_eh_frame = false; int seen_type = 0; for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) @@ -1116,7 +1116,7 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd, if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) elfbfd = abfd; - warn_eh_frame = TRUE; + warn_eh_frame = true; } } @@ -1135,7 +1135,7 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd, && bfd_set_section_alignment (s, 2)) { htab->eh_info.hdr_sec = s; - warn_eh_frame = FALSE; + warn_eh_frame = false; } } if (warn_eh_frame) @@ -1202,7 +1202,7 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd, if (global_found != NULL) { nn.name = global_found->filename; - if (ldelf_try_needed (&nn, TRUE, is_linux)) + if (ldelf_try_needed (&nn, true, is_linux)) continue; } @@ -1347,7 +1347,7 @@ id_note_section_size (bfd *abfd ATTRIBUTE_UNUSED) return size; } -static bfd_boolean +static bool write_build_id (bfd *abfd) { const struct elf_backend_data *bed = get_elf_backend_data (abfd); @@ -1366,7 +1366,7 @@ write_build_id (bfd *abfd) { einfo (_("%P: warning: .note.gnu.build-id section discarded," " --build-id ignored\n")); - return TRUE; + return true; } i_shdr = &elf_section_data (asec->output_section)->this_hdr; @@ -1400,7 +1400,7 @@ write_build_id (bfd *abfd) /* Make .note.gnu.build-id section, and set up elf_tdata->build_id. */ -bfd_boolean +bool ldelf_setup_build_id (bfd *ibfd) { asection *s; @@ -1411,7 +1411,7 @@ ldelf_setup_build_id (bfd *ibfd) if (size == 0) { einfo (_("%P: warning: unrecognized --build-id style ignored\n")); - return FALSE; + return false; } flags = (SEC_ALLOC | SEC_LOAD | SEC_IN_MEMORY @@ -1425,12 +1425,12 @@ ldelf_setup_build_id (bfd *ibfd) t->o->build_id.sec = s; elf_section_type (s) = SHT_NOTE; s->size = size; - return TRUE; + return true; } einfo (_("%P: warning: cannot create .note.gnu.build-id section," " --build-id ignored\n")); - return FALSE; + return false; } /* Look through an expression for an assignment statement. */ @@ -1438,13 +1438,13 @@ ldelf_setup_build_id (bfd *ibfd) static void ldelf_find_exp_assignment (etree_type *exp) { - bfd_boolean provide = FALSE; + bool provide = false; switch (exp->type.node_class) { case etree_provide: case etree_provided: - provide = TRUE; + provide = true; /* Fallthru */ case etree_assign: /* We call record_link_assignment even if the symbol is defined. @@ -1564,7 +1564,7 @@ ldelf_before_allocation (char *audit, char *depaudit, { struct elf_link_hash_table *htab = elf_hash_table (&link_info); struct elf_link_hash_entry *h - = elf_link_hash_lookup (htab, "__ehdr_start", FALSE, FALSE, TRUE); + = elf_link_hash_lookup (htab, "__ehdr_start", false, false, true); /* Only adjust the export class if the symbol was referenced and not defined, otherwise leave it alone. */ @@ -1576,7 +1576,7 @@ ldelf_before_allocation (char *audit, char *depaudit, { const struct elf_backend_data *bed; bed = get_elf_backend_data (link_info.output_bfd); - (*bed->elf_backend_hide_symbol) (&link_info, h, TRUE); + (*bed->elf_backend_hide_symbol) (&link_info, h, true); if (ELF_ST_VISIBILITY (h->other) != STV_INTERNAL) h->other = (h->other & ~ELF_ST_VISIBILITY (-1)) | STV_HIDDEN; /* Don't leave the symbol undefined. Undefined hidden @@ -1725,17 +1725,17 @@ ldelf_before_allocation (char *audit, char *depaudit, dynamic libraries have an extension of .so (or .sl on oddball systems like hpux). */ -bfd_boolean +bool ldelf_open_dynamic_archive (const char *arch, search_dirs_type *search, lang_input_statement_type *entry) { const char *filename; char *string; size_t len; - bfd_boolean opened = FALSE; + bool opened = false; if (! entry->flags.maybe_archive) - return FALSE; + return false; filename = entry->filename; len = strlen (search->name) + strlen (filename); @@ -1769,7 +1769,7 @@ ldelf_open_dynamic_archive (const char *arch, search_dirs_type *search, if (!opened && !ldfile_try_open_bfd (string, entry)) { free (string); - return FALSE; + return false; } entry->filename = string; @@ -1800,7 +1800,7 @@ ldelf_open_dynamic_archive (const char *arch, search_dirs_type *search, bfd_elf_set_dt_needed_name (entry->the_bfd, filename); } - return TRUE; + return true; } /* A variant of lang_output_section_find used by place_orphan. */ @@ -1869,7 +1869,7 @@ output_rel_find (int isdyn, int rela) /* Return whether IN is suitable to be part of OUT. */ -static bfd_boolean +static bool elf_orphan_compatible (asection *in, asection *out) { /* Non-zero sh_info implies a section with SHF_INFO_LINK with @@ -1880,7 +1880,7 @@ elf_orphan_compatible (asection *in, asection *out) shouldn't merge sections with differing unknown semantics. */ if (elf_section_data (out)->this_hdr.sh_info != elf_section_data (in)->this_hdr.sh_info) - return FALSE; + return false; /* We can't merge with a member of an output section group or merge two sections with differing SHF_EXCLUDE or other processor and OS specific flags when doing a relocatable link. */ @@ -1888,7 +1888,7 @@ elf_orphan_compatible (asection *in, asection *out) && (elf_next_in_group (out) != NULL || ((elf_section_flags (out) ^ elf_section_flags (in)) & (SHF_MASKPROC | SHF_MASKOS)) != 0)) - return FALSE; + return false; return _bfd_elf_match_sections_by_type (link_info.output_bfd, out, in->owner, in); } diff --git a/ld/ldelf.h b/ld/ldelf.h index aaf264ae239..267dd3ba192 100644 --- a/ld/ldelf.h +++ b/ld/ldelf.h @@ -21,12 +21,12 @@ extern const char *ldelf_emit_note_gnu_build_id; extern void ldelf_after_parse (void); -extern bfd_boolean ldelf_load_symbols (lang_input_statement_type *); +extern bool ldelf_load_symbols (lang_input_statement_type *); extern void ldelf_after_open (int, int, int, int, int, const char *); -extern bfd_boolean ldelf_setup_build_id (bfd *); +extern bool ldelf_setup_build_id (bfd *); extern void ldelf_append_to_separated_string (char **, char *); extern void ldelf_before_allocation (char *, char *, const char *); -extern bfd_boolean ldelf_open_dynamic_archive +extern bool ldelf_open_dynamic_archive (const char *, search_dirs_type *, lang_input_statement_type *); extern lang_output_section_statement_type *ldelf_place_orphan (asection *, const char *, int); diff --git a/ld/ldelfgen.c b/ld/ldelfgen.c index c49b85494ee..495fa8451fc 100644 --- a/ld/ldelfgen.c +++ b/ld/ldelfgen.c @@ -52,7 +52,7 @@ struct os_sections /* Add IS to data kept for OS. */ -static bfd_boolean +static bool add_link_order_input_section (lang_input_section_type *is, lang_output_section_statement_type *os) { @@ -83,18 +83,18 @@ add_link_order_input_section (lang_input_section_type *is, && (s->flags & SEC_LINKER_CREATED) == 0 && elf_linked_to_section (s) != NULL) os_info->ordered++; - return FALSE; + return false; } /* Run over the linker's statement list, extracting info about input sections attached to each output section. */ -static bfd_boolean +static bool link_order_scan (lang_statement_union_type *u, lang_output_section_statement_type *os) { asection *s; - bfd_boolean ret = FALSE; + bool ret = false; for (; u != NULL; u = u->header.next) { @@ -102,21 +102,21 @@ link_order_scan (lang_statement_union_type *u, { case lang_wild_statement_enum: if (link_order_scan (u->wild_statement.children.head, os)) - ret = TRUE; + ret = true; break; case lang_constructors_statement_enum: if (link_order_scan (constructor_list.head, os)) - ret = TRUE; + ret = true; break; case lang_output_section_statement_enum: if (u->output_section_statement.constraint != -1 && link_order_scan (u->output_section_statement.children.head, &u->output_section_statement)) - ret = TRUE; + ret = true; break; case lang_group_statement_enum: if (link_order_scan (u->group_statement.children.head, os)) - ret = TRUE; + ret = true; break; case lang_input_section_enum: s = u->input_section.section; @@ -127,7 +127,7 @@ link_order_scan (lang_statement_union_type *u, || ((s->output_section->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) == (SEC_LOAD | SEC_THREAD_LOCAL)))) if (add_link_order_input_section (&u->input_section, os)) - ret = TRUE; + ret = true; break; default: break; @@ -195,7 +195,7 @@ compare_link_order (const void *a, const void *b) /* Rearrange sections with SHF_LINK_ORDER into the same order as their linked sections. */ -static bfd_boolean +static bool fixup_link_order (lang_output_section_statement_type *os) { struct os_sections *os_info = os->data; @@ -223,7 +223,7 @@ fixup_link_order (lang_output_section_statement_type *os) if (os_info->isec[i].idx != i) break; if (i == os_info->count) - return FALSE; + return false; /* Now reorder the linker input section statements to reflect the proper sorting. The is done by rewriting the existing statements @@ -247,19 +247,19 @@ fixup_link_order (lang_output_section_statement_type *os) } free (save_s); free (orig_is); - return TRUE; + return true; } void -ldelf_map_segments (bfd_boolean need_layout) +ldelf_map_segments (bool need_layout) { int tries = 10; - static bfd_boolean done_link_order_scan = FALSE; + static bool done_link_order_scan = false; do { lang_relax_sections (need_layout); - need_layout = FALSE; + need_layout = false; if (bfd_get_flavour (link_info.output_bfd) == bfd_target_elf_flavour) { @@ -267,7 +267,7 @@ ldelf_map_segments (bfd_boolean need_layout) if (!done_link_order_scan) { link_order_scan (statement_list.head, NULL); - done_link_order_scan = TRUE; + done_link_order_scan = true; } for (os = (void *) lang_os_list.head; os != NULL; os = os->next) { @@ -284,7 +284,7 @@ ldelf_map_segments (bfd_boolean need_layout) } if (os_info->count > 1 && fixup_link_order (os)) - need_layout = TRUE; + need_layout = true; } } } @@ -308,11 +308,11 @@ ldelf_map_segments (bfd_boolean need_layout) if (tries > 6) /* The first few times we allow any change to phdr_size . */ - need_layout = TRUE; + need_layout = true; else if (phdr_size < elf_program_header_size (link_info.output_bfd)) /* After that we only allow the size to grow. */ - need_layout = TRUE; + need_layout = true; else elf_program_header_size (link_info.output_bfd) = phdr_size; } diff --git a/ld/ldelfgen.h b/ld/ldelfgen.h index 95b06d92459..704893bf853 100644 --- a/ld/ldelfgen.h +++ b/ld/ldelfgen.h @@ -22,7 +22,7 @@ struct elf_internal_sym; struct elf_strtab_hash; struct ctf_dict; -extern void ldelf_map_segments (bfd_boolean); +extern void ldelf_map_segments (bool); extern int ldelf_emit_ctf_early (void); extern void ldelf_acquire_strings_for_ctf (struct ctf_dict *ctf_output, struct elf_strtab_hash *strtab); diff --git a/ld/ldemul.c b/ld/ldemul.c index ddfd48321a2..9c51af0bd6d 100644 --- a/ld/ldemul.c +++ b/ld/ldemul.c @@ -121,13 +121,13 @@ ldemul_get_script (int *isfile) return ld_emulation->get_script (isfile); } -bfd_boolean +bool ldemul_open_dynamic_archive (const char *arch, search_dirs_type *search, lang_input_statement_type *entry) { if (ld_emulation->open_dynamic_archive) return (*ld_emulation->open_dynamic_archive) (arch, search, entry); - return FALSE; + return false; } lang_output_section_statement_type * @@ -148,41 +148,41 @@ ldemul_add_options (int ns, char **shortopts, int nl, nrl, really_longopts); } -bfd_boolean +bool ldemul_handle_option (int optc) { if (ld_emulation->handle_option) return (*ld_emulation->handle_option) (optc); - return FALSE; + return false; } -bfd_boolean +bool ldemul_parse_args (int argc, char **argv) { /* Try and use the emulation parser if there is one. */ if (ld_emulation->parse_args) return (*ld_emulation->parse_args) (argc, argv); - return FALSE; + return false; } /* Let the emulation code handle an unrecognized file. */ -bfd_boolean +bool ldemul_unrecognized_file (lang_input_statement_type *entry) { if (ld_emulation->unrecognized_file) return (*ld_emulation->unrecognized_file) (entry); - return FALSE; + return false; } /* Let the emulation code handle a recognized file. */ -bfd_boolean +bool ldemul_recognized_file (lang_input_statement_type *entry) { if (ld_emulation->recognized_file) return (*ld_emulation->recognized_file) (entry); - return FALSE; + return false; } char * @@ -220,7 +220,7 @@ after_parse_default (void) if (entry_symbol.name != NULL && (bfd_link_executable (&link_info) || entry_from_cmdline)) { - bfd_boolean is_vma = FALSE; + bool is_vma = false; if (entry_from_cmdline) { @@ -242,25 +242,25 @@ after_parse_default (void) void after_open_default (void) { - link_info.big_endian = TRUE; + link_info.big_endian = true; if (bfd_big_endian (link_info.output_bfd)) ; else if (bfd_little_endian (link_info.output_bfd)) - link_info.big_endian = FALSE; + link_info.big_endian = false; else { if (command_line.endian == ENDIAN_BIG) ; else if (command_line.endian == ENDIAN_LITTLE) - link_info.big_endian = FALSE; + link_info.big_endian = false; else if (command_line.endian == ENDIAN_UNSET) { LANG_FOR_EACH_INPUT_STATEMENT (s) if (s->the_bfd != NULL) { if (bfd_little_endian (s->the_bfd)) - link_info.big_endian = FALSE; + link_info.big_endian = false; break; } } @@ -280,7 +280,7 @@ before_place_orphans_default (void) void after_allocation_default (void) { - lang_relax_sections (FALSE); + lang_relax_sections (false); } void @@ -344,12 +344,12 @@ void ldemul_list_emulations (FILE *f) { ld_emulation_xfer_type **eptr = ld_emulations; - bfd_boolean first = TRUE; + bool first = true; for (; *eptr; eptr++) { if (first) - first = FALSE; + first = false; else fprintf (f, " "); fprintf (f, "%s", (*eptr)->emulation_name); @@ -430,7 +430,7 @@ ldemul_new_dynsym_for_ctf (struct ctf_dict *ctf_output, int symidx, ld_emulation->new_dynsym_for_ctf (ctf_output, symidx, sym); } -bfd_boolean +bool ldemul_print_symbol (struct bfd_link_hash_entry *hash_entry, void *ptr) { if (ld_emulation->print_symbol) diff --git a/ld/ldemul.h b/ld/ldemul.h index 7dd37789caf..1e0bdc07786 100644 --- a/ld/ldemul.h +++ b/ld/ldemul.h @@ -62,17 +62,17 @@ extern void ldemul_create_output_section_statements (void); extern lang_output_section_statement_type *ldemul_place_orphan (asection *, const char *, int); -extern bfd_boolean ldemul_parse_args +extern bool ldemul_parse_args (int, char **); extern void ldemul_add_options (int, char **, int, struct option **, int, struct option **); -extern bfd_boolean ldemul_handle_option +extern bool ldemul_handle_option (int); -extern bfd_boolean ldemul_unrecognized_file +extern bool ldemul_unrecognized_file (struct lang_input_statement_struct *); -extern bfd_boolean ldemul_recognized_file +extern bool ldemul_recognized_file (struct lang_input_statement_struct *); -extern bfd_boolean ldemul_open_dynamic_archive +extern bool ldemul_open_dynamic_archive (const char *, struct search_dirs *, struct lang_input_statement_struct *); extern char *ldemul_default_target (int, char**); @@ -114,7 +114,7 @@ extern void ldemul_acquire_strings_for_ctf extern void ldemul_new_dynsym_for_ctf (struct ctf_dict *, int symidx, struct elf_internal_sym *); -extern bfd_boolean ldemul_print_symbol +extern bool ldemul_print_symbol (struct bfd_link_hash_entry *hash_entry, void *ptr); typedef struct ld_emulation_xfer_struct { @@ -170,7 +170,7 @@ typedef struct ld_emulation_xfer_struct { /* Try to open a dynamic library. ARCH is an architecture name, and is normally the empty string. ENTRY is the lang_input_statement that should be opened. */ - bfd_boolean (*open_dynamic_archive) + bool (*open_dynamic_archive) (const char *arch, struct search_dirs *, struct lang_input_statement_struct *entry); @@ -186,7 +186,7 @@ typedef struct ld_emulation_xfer_struct { /* Parse args which the base linker doesn't understand. Return TRUE if the arg needs no further processing. */ - bfd_boolean (*parse_args) (int, char **); + bool (*parse_args) (int, char **); /* Hook to add options to parameters passed by the base linker to getopt_long and getopt_long_only calls. */ @@ -195,11 +195,11 @@ typedef struct ld_emulation_xfer_struct { /* Companion to the above to handle an option. Returns TRUE if it is one of our options. */ - bfd_boolean (*handle_option) (int); + bool (*handle_option) (int); /* Run to handle files which are not recognized as object files or archives. Return TRUE if the file was handled. */ - bfd_boolean (*unrecognized_file) + bool (*unrecognized_file) (struct lang_input_statement_struct *); /* Run to list the command line options which parse_args handles. */ @@ -207,7 +207,7 @@ typedef struct ld_emulation_xfer_struct { /* Run to specially handle files which *are* recognized as object files or archives. Return TRUE if the file was handled. */ - bfd_boolean (*recognized_file) + bool (*recognized_file) (struct lang_input_statement_struct *); /* Called when looking for libraries in a directory specified @@ -251,7 +251,7 @@ typedef struct ld_emulation_xfer_struct { /* Called when printing a symbol to the map file. AIX uses this hook to flag gc'd symbols. */ - bfd_boolean (*print_symbol) + bool (*print_symbol) (struct bfd_link_hash_entry *hash_entry, void *ptr); } ld_emulation_xfer_type; diff --git a/ld/ldexp.c b/ld/ldexp.c index 7a95e561a03..2efbec658be 100644 --- a/ld/ldexp.c +++ b/ld/ldexp.c @@ -161,14 +161,14 @@ make_log2ceil (void) { bfd_vma value = expld.result.value; bfd_vma result = -1; - bfd_boolean round_up = FALSE; + bool round_up = false; do { result++; /* If more than one bit is set in the value we will need to round up. */ if ((value > 1) && (value & 1)) - round_up = TRUE; + round_up = true; } while (value >>= 1); @@ -184,13 +184,13 @@ make_abs (void) if (expld.result.section != NULL) expld.result.value += expld.result.section->vma; expld.result.section = bfd_abs_section_ptr; - expld.rel_from_abs = FALSE; + expld.rel_from_abs = false; } static void new_abs (bfd_vma value) { - expld.result.valid_p = TRUE; + expld.result.valid_p = true; expld.result.section = bfd_abs_section_ptr; expld.result.value = value; expld.result.str = NULL; @@ -240,7 +240,7 @@ exp_relop (asection *section, bfd_vma value) static void new_number (bfd_vma value) { - expld.result.valid_p = TRUE; + expld.result.valid_p = true; expld.result.value = value; expld.result.str = NULL; expld.result.section = NULL; @@ -249,7 +249,7 @@ new_number (bfd_vma value) static void new_rel (bfd_vma value, asection *section) { - expld.result.valid_p = TRUE; + expld.result.valid_p = true; expld.result.value = value; expld.result.str = NULL; expld.result.section = section; @@ -260,8 +260,8 @@ new_rel_from_abs (bfd_vma value) { asection *s = expld.section; - expld.rel_from_abs = TRUE; - expld.result.valid_p = TRUE; + expld.rel_from_abs = true; + expld.result.valid_p = true; expld.result.value = value - s->vma; expld.result.str = NULL; expld.result.section = s; @@ -297,26 +297,26 @@ static struct definedness_hash_entry * symbol_defined (const char *name) { return ((struct definedness_hash_entry *) - bfd_hash_lookup (&definedness_table, name, FALSE, FALSE)); + bfd_hash_lookup (&definedness_table, name, false, false)); } /* Update the definedness state of NAME. Return FALSE if script symbol is multiply defining a strong symbol in an object. */ -static bfd_boolean +static bool update_definedness (const char *name, struct bfd_link_hash_entry *h) { - bfd_boolean ret; + bool ret; struct definedness_hash_entry *defentry = (struct definedness_hash_entry *) - bfd_hash_lookup (&definedness_table, name, TRUE, FALSE); + bfd_hash_lookup (&definedness_table, name, true, false); if (defentry == NULL) einfo (_("%F%P: bfd_hash_lookup failed creating symbol %s\n"), name); /* If the symbol was already defined, and not by a script, then it must be defined by an object file or by the linker target code. */ - ret = TRUE; + ret = true; if (!h->ldscript_def && (h->type == bfd_link_hash_defined || h->type == bfd_link_hash_defweak @@ -326,7 +326,7 @@ update_definedness (const char *name, struct bfd_link_hash_entry *h) if (h->type == bfd_link_hash_defined && h->u.def.section->output_section != NULL && !h->linker_def) - ret = FALSE; + ret = false; } defentry->iteration = lang_statement_iteration; @@ -344,7 +344,7 @@ fold_segment_end (seg_align_type *seg) if (expld.phase == lang_first_phase_enum || expld.section != bfd_abs_section_ptr) { - expld.result.valid_p = FALSE; + expld.result.valid_p = false; } else if (seg->phase == exp_seg_align_seen || seg->phase == exp_seg_relro_seen) @@ -359,7 +359,7 @@ fold_segment_end (seg_align_type *seg) /* OK. */ } else - expld.result.valid_p = FALSE; + expld.result.valid_p = false; } static void @@ -374,7 +374,7 @@ fold_unary (etree_type *tree) if (expld.phase != lang_first_phase_enum) new_rel_from_abs (align_n (expld.dot, expld.result.value)); else - expld.result.valid_p = FALSE; + expld.result.valid_p = false; break; case ABSOLUTE: @@ -405,7 +405,7 @@ fold_unary (etree_type *tree) expld.result.value = align_n (expld.dot, expld.result.value); } else - expld.result.valid_p = FALSE; + expld.result.valid_p = false; break; case DATA_SEGMENT_END: @@ -451,7 +451,7 @@ fold_segment_align (seg_align_type *seg, etree_value_type *lhs) seg->relro = exp_seg_relro_start; if (expld.phase == lang_first_phase_enum || expld.section != bfd_abs_section_ptr) - expld.result.valid_p = FALSE; + expld.result.valid_p = false; else { bfd_vma maxpage = lhs->value; @@ -482,7 +482,7 @@ fold_segment_align (seg_align_type *seg, etree_value_type *lhs) seg->relro_end = 0; } else - expld.result.valid_p = FALSE; + expld.result.valid_p = false; } } } @@ -496,7 +496,7 @@ fold_segment_relro_end (seg_align_type *seg, etree_value_type *lhs) seg->relro_offset = expld.result.value; if (expld.phase == lang_first_phase_enum || expld.section != bfd_abs_section_ptr) - expld.result.valid_p = FALSE; + expld.result.valid_p = false; else if (seg->phase == exp_seg_align_seen || seg->phase == exp_seg_adjust || seg->phase == exp_seg_relro_adjust @@ -520,7 +520,7 @@ fold_segment_relro_end (seg_align_type *seg, etree_value_type *lhs) seg->phase = exp_seg_relro_seen; } else - expld.result.valid_p = FALSE; + expld.result.valid_p = false; } static void @@ -552,7 +552,7 @@ fold_binary (etree_type *tree) einfo (_("%P: warning: address of `%s' " "isn't multiple of maximum page size\n"), segment_name); - seg->used = TRUE; + seg->used = true; value = seg->value; break; } @@ -710,7 +710,7 @@ fold_name (etree_type *tree) h = bfd_wrapped_link_hash_lookup (link_info.output_bfd, &link_info, tree->name.name, - FALSE, FALSE, TRUE); + false, false, true); new_number (h != NULL && (h->type == bfd_link_hash_defined || h->type == bfd_link_hash_defweak @@ -729,7 +729,7 @@ fold_name (etree_type *tree) h = bfd_wrapped_link_hash_lookup (link_info.output_bfd, &link_info, tree->name.name, - TRUE, FALSE, TRUE); + true, false, true); if (!h) { if (expld.phase != lang_first_phase_enum) @@ -872,7 +872,7 @@ fold_name (etree_type *tree) { lang_memory_region_type *mem; - mem = lang_memory_region_lookup (tree->name.name, FALSE); + mem = lang_memory_region_lookup (tree->name.name, false); if (mem != NULL) new_number (mem->length); else @@ -886,7 +886,7 @@ fold_name (etree_type *tree) { lang_memory_region_type *mem; - mem = lang_memory_region_lookup (tree->name.name, FALSE); + mem = lang_memory_region_lookup (tree->name.name, false); if (mem != NULL) new_rel_from_abs (mem->origin); else @@ -914,7 +914,7 @@ fold_name (etree_type *tree) /* Return true if TREE is '.'. */ -static bfd_boolean +static bool is_dot (const etree_type *tree) { return (tree->type.node_class == etree_name @@ -925,7 +925,7 @@ is_dot (const etree_type *tree) /* Return true if TREE is a constant equal to VAL. */ -static bfd_boolean +static bool is_value (const etree_type *tree, bfd_vma val) { return (tree->type.node_class == etree_value @@ -935,7 +935,7 @@ is_value (const etree_type *tree, bfd_vma val) /* Return true if TREE is an absolute symbol equal to VAL defined in a linker script. */ -static bfd_boolean +static bool is_sym_value (const etree_type *tree, bfd_vma val) { struct bfd_link_hash_entry *h; @@ -948,7 +948,7 @@ is_sym_value (const etree_type *tree, bfd_vma val) && (h = bfd_wrapped_link_hash_lookup (link_info.output_bfd, &link_info, tree->name.name, - FALSE, FALSE, TRUE)) != NULL + false, false, true)) != NULL && h->ldscript_def && h->type == bfd_link_hash_defined && h->u.def.section == bfd_abs_section_ptr @@ -957,7 +957,7 @@ is_sym_value (const etree_type *tree, bfd_vma val) /* Return true if TREE is ". != 0". */ -static bfd_boolean +static bool is_dot_ne_0 (const etree_type *tree) { return (tree->type.node_class == etree_binary @@ -969,7 +969,7 @@ is_dot_ne_0 (const etree_type *tree) /* Return true if TREE is ". = . + 0" or ". = . + sym" where sym is an absolute constant with value 0 defined in a linker script. */ -static bfd_boolean +static bool is_dot_plus_0 (const etree_type *tree) { return (tree->type.node_class == etree_binary @@ -981,7 +981,7 @@ is_dot_plus_0 (const etree_type *tree) /* Return true if TREE is "ALIGN (. != 0 ? some_expression : 1)". */ -static bfd_boolean +static bool is_align_conditional (const etree_type *tree) { if (tree->type.node_class == etree_unary @@ -992,7 +992,7 @@ is_align_conditional (const etree_type *tree) && is_dot_ne_0 (tree->trinary.cond) && is_value (tree->trinary.rhs, 1)); } - return FALSE; + return false; } static void @@ -1055,9 +1055,9 @@ exp_fold_tree_1 (etree_type *tree) if (expld.phase != lang_first_phase_enum) { /* Notify the folder that this is an assignment to dot. */ - expld.assigning_to_dot = TRUE; + expld.assigning_to_dot = true; exp_fold_tree_1 (tree->assign.src); - expld.assigning_to_dot = FALSE; + expld.assigning_to_dot = false; /* If we are assigning to dot inside an output section arrange to keep the section, except for certain @@ -1126,7 +1126,7 @@ exp_fold_tree_1 (etree_type *tree) if (tree->type.node_class == etree_provide) { h = bfd_link_hash_lookup (link_info.hash, tree->assign.dst, - FALSE, FALSE, TRUE); + false, false, true); if (h == NULL || !(h->type == bfd_link_hash_new || h->type == bfd_link_hash_undefined @@ -1164,7 +1164,7 @@ exp_fold_tree_1 (etree_type *tree) if (h == NULL) { h = bfd_link_hash_lookup (link_info.hash, tree->assign.dst, - TRUE, FALSE, TRUE); + true, false, true); if (h == NULL) einfo (_("%F%P:%s: hash creation failed\n"), tree->assign.dst); @@ -1179,7 +1179,7 @@ exp_fold_tree_1 (etree_type *tree) { expld.result.value = 0; expld.result.section = NULL; - expld.result.valid_p = TRUE; + expld.result.valid_p = true; } if (expld.result.valid_p) @@ -1231,7 +1231,7 @@ exp_fold_tree_1 (etree_type *tree) { bfd_copy_link_hash_symbol_type (link_info.output_bfd, h, expld.assign_src); - expld.assign_src->non_ir_ref_regular = TRUE; + expld.assign_src->non_ir_ref_regular = true; } } } @@ -1255,7 +1255,7 @@ exp_fold_tree_1 (etree_type *tree) void exp_fold_tree (etree_type *tree, asection *current_section, bfd_vma *dotp) { - expld.rel_from_abs = FALSE; + expld.rel_from_abs = false; expld.dot = *dotp; expld.dotp = dotp; expld.section = current_section; @@ -1265,7 +1265,7 @@ exp_fold_tree (etree_type *tree, asection *current_section, bfd_vma *dotp) void exp_fold_tree_no_dot (etree_type *tree) { - expld.rel_from_abs = FALSE; + expld.rel_from_abs = false; expld.dot = 0; expld.dotp = NULL; expld.section = bfd_abs_section_ptr; @@ -1363,7 +1363,7 @@ static etree_type * exp_assop (const char *dst, etree_type *src, enum node_tree_enum class, - bfd_boolean hidden) + bool hidden) { etree_type *n; @@ -1381,7 +1381,7 @@ exp_assop (const char *dst, /* Handle linker script assignments and HIDDEN. */ etree_type * -exp_assign (const char *dst, etree_type *src, bfd_boolean hidden) +exp_assign (const char *dst, etree_type *src, bool hidden) { return exp_assop (dst, src, etree_assign, hidden); } @@ -1391,13 +1391,13 @@ exp_assign (const char *dst, etree_type *src, bfd_boolean hidden) etree_type * exp_defsym (const char *dst, etree_type *src) { - return exp_assop (dst, src, etree_assign, FALSE); + return exp_assop (dst, src, etree_assign, false); } /* Handle PROVIDE. */ etree_type * -exp_provide (const char *dst, etree_type *src, bfd_boolean hidden) +exp_provide (const char *dst, etree_type *src, bool hidden) { return exp_assop (dst, src, etree_provide, hidden); } @@ -1422,7 +1422,7 @@ exp_assert (etree_type *exp, const char *message) void exp_print_tree (etree_type *tree) { - bfd_boolean function_like; + bool function_like; if (config.map_file == NULL) config.map_file = stderr; @@ -1445,7 +1445,7 @@ exp_print_tree (etree_type *tree) return; case etree_assign: fputs (tree->assign.dst, config.map_file); - exp_print_token (tree->type.node_code, TRUE); + exp_print_token (tree->type.node_code, true); exp_print_tree (tree->assign.src); break; case etree_provide: @@ -1455,7 +1455,7 @@ exp_print_tree (etree_type *tree) fputc (')', config.map_file); break; case etree_binary: - function_like = FALSE; + function_like = false; switch (tree->type.node_code) { case MAX_K: @@ -1463,12 +1463,12 @@ exp_print_tree (etree_type *tree) case ALIGN_K: case DATA_SEGMENT_ALIGN: case DATA_SEGMENT_RELRO_END: - function_like = TRUE; + function_like = true; break; case SEGMENT_START: /* Special handling because arguments are in reverse order and the segment name is quoted. */ - exp_print_token (tree->type.node_code, FALSE); + exp_print_token (tree->type.node_code, false); fputs (" (\"", config.map_file); exp_print_tree (tree->binary.rhs); fputs ("\", ", config.map_file); @@ -1478,7 +1478,7 @@ exp_print_tree (etree_type *tree) } if (function_like) { - exp_print_token (tree->type.node_code, FALSE); + exp_print_token (tree->type.node_code, false); fputc (' ', config.map_file); } fputc ('(', config.map_file); @@ -1486,7 +1486,7 @@ exp_print_tree (etree_type *tree) if (function_like) fprintf (config.map_file, ", "); else - exp_print_token (tree->type.node_code, TRUE); + exp_print_token (tree->type.node_code, true); exp_print_tree (tree->binary.rhs); fputc (')', config.map_file); break; @@ -1498,7 +1498,7 @@ exp_print_tree (etree_type *tree) exp_print_tree (tree->trinary.rhs); break; case etree_unary: - exp_print_token (tree->unary.type.node_code, FALSE); + exp_print_token (tree->unary.type.node_code, false); if (tree->unary.child) { fprintf (config.map_file, " ("); @@ -1518,7 +1518,7 @@ exp_print_tree (etree_type *tree) fputs (tree->name.name, config.map_file); else { - exp_print_token (tree->type.node_code, FALSE); + exp_print_token (tree->type.node_code, false); if (tree->name.name) fprintf (config.map_file, " (%s)", tree->name.name); } @@ -1673,7 +1673,7 @@ ldexp_init (void) SEGMENT_START or ORIGIN) outside of an output section statement, to section relative. */ -static bfd_boolean +static bool set_sym_sections (struct bfd_hash_entry *bh, void *inf ATTRIBUTE_UNUSED) { struct definedness_hash_entry *def = (struct definedness_hash_entry *) bh; @@ -1681,7 +1681,7 @@ set_sym_sections (struct bfd_hash_entry *bh, void *inf ATTRIBUTE_UNUSED) { struct bfd_link_hash_entry *h; h = bfd_link_hash_lookup (link_info.hash, bh->string, - FALSE, FALSE, TRUE); + false, false, true); if (h != NULL && h->type == bfd_link_hash_defined && h->u.def.section == bfd_abs_section_ptr) @@ -1690,7 +1690,7 @@ set_sym_sections (struct bfd_hash_entry *bh, void *inf ATTRIBUTE_UNUSED) h->u.def.section = def->final_sec; } } - return TRUE; + return true; } void @@ -1702,7 +1702,7 @@ ldexp_finalize_syms (void) /* Determine whether a symbol is going to remain absolute even after ldexp_finalize_syms() has run. */ -bfd_boolean +bool ldexp_is_final_sym_absolute (const struct bfd_link_hash_entry *h) { if (h->type == bfd_link_hash_defined @@ -1711,14 +1711,14 @@ ldexp_is_final_sym_absolute (const struct bfd_link_hash_entry *h) const struct definedness_hash_entry *def; if (!h->ldscript_def) - return TRUE; + return true; def = symbol_defined (h->root.string); if (def != NULL) return def->final_sec == bfd_abs_section_ptr; } - return FALSE; + return false; } void diff --git a/ld/ldexp.h b/ld/ldexp.h index 1055053e28d..ebe82f6088f 100644 --- a/ld/ldexp.h +++ b/ld/ldexp.h @@ -26,7 +26,7 @@ typedef struct { bfd_vma value; char *str; asection *section; - bfd_boolean valid_p; + bool valid_p; } etree_value_type; enum node_tree_enum { @@ -66,7 +66,7 @@ typedef union etree_union { node_type type; const char *dst; union etree_union *src; - bfd_boolean hidden; + bool hidden; } assign; struct { node_type type; @@ -149,14 +149,14 @@ struct ldexp_control { lang_phase_type phase; /* Principally used for diagnostics. */ - bfd_boolean assigning_to_dot; + bool assigning_to_dot; /* Set if the current expression used "dot", SEGMENT_START or ORIGIN, but not ABSOLUTE or combined symbols in a way that forces an absolute result. Used in tracking symbols assigned from dot outside of output section statements, in order to later convert them from absolute. */ - bfd_boolean rel_from_abs; + bool rel_from_abs; /* If evaluating an assignment, the destination. Cleared if an etree_name NAME matches this, to signal a self-assignment. @@ -193,7 +193,7 @@ typedef struct segment_struct { bfd_vma value; /* True if a SEGMENT_START directive corresponding to this segment has been seen. */ - bfd_boolean used; + bool used; } segment_type; /* The segments specified by the user on the command-line. */ @@ -220,11 +220,11 @@ etree_type *exp_unop etree_type *exp_nameop (int, const char *); etree_type *exp_assign - (const char *, etree_type *, bfd_boolean); + (const char *, etree_type *, bool); etree_type *exp_defsym (const char *, etree_type *); etree_type *exp_provide - (const char *, etree_type *, bfd_boolean); + (const char *, etree_type *, bool); etree_type *exp_assert (etree_type *, const char *); void exp_print_tree @@ -239,7 +239,7 @@ bfd_vma exp_get_abs_int (etree_type *, int, char *); void ldexp_init (void); void ldexp_finalize_syms (void); -bfd_boolean ldexp_is_final_sym_absolute (const struct bfd_link_hash_entry *); +bool ldexp_is_final_sym_absolute (const struct bfd_link_hash_entry *); void ldexp_finish (void); #endif diff --git a/ld/ldfile.c b/ld/ldfile.c index c428d1487f3..9d0af06f1f6 100644 --- a/ld/ldfile.c +++ b/ld/ldfile.c @@ -39,7 +39,7 @@ #include "plugin.h" #endif /* BFD_SUPPORTS_PLUGINS */ -bfd_boolean ldfile_assumed_script = FALSE; +bool ldfile_assumed_script = false; const char *ldfile_output_machine_name = ""; unsigned long ldfile_output_machine; enum bfd_architecture ldfile_output_architecture; @@ -68,19 +68,19 @@ static search_arch_type **search_arch_tail_ptr = &search_arch_head; /* Test whether a pathname, after canonicalization, is the same or a sub-directory of the sysroot directory. */ -static bfd_boolean +static bool is_sysrooted_pathname (const char *name) { char *realname; int len; - bfd_boolean result; + bool result; if (ld_canon_sysroot == NULL) - return FALSE; + return false; realname = lrealpath (name); len = strlen (realname); - result = FALSE; + result = false; if (len > ld_canon_sysroot_len && IS_DIR_SEPARATOR (realname[ld_canon_sysroot_len])) { @@ -96,7 +96,7 @@ is_sysrooted_pathname (const char *name) Makes a copy of NAME using xmalloc(). */ void -ldfile_add_library_path (const char *name, bfd_boolean cmdline) +ldfile_add_library_path (const char *name, bool cmdline) { search_dirs_type *new_dirs; @@ -121,7 +121,7 @@ ldfile_add_library_path (const char *name, bfd_boolean cmdline) /* Try to open a BFD for a lang_input_statement. */ -bfd_boolean +bool ldfile_try_open_bfd (const char *attempt, lang_input_statement_type *entry) { @@ -139,7 +139,7 @@ ldfile_try_open_bfd (const char *attempt, { if (bfd_get_error () == bfd_error_invalid_target) einfo (_("%F%P: invalid BFD target `%s'\n"), entry->target); - return FALSE; + return false; } track_dependency_files (attempt); @@ -162,8 +162,8 @@ ldfile_try_open_bfd (const char *attempt, a dynamic object. In the code below, it's OK to exit early if the check fails, - closing the checked BFD and returning FALSE, but if the BFD - checks out compatible, do not exit early returning TRUE, or + closing the checked BFD and returning false, but if the BFD + checks out compatible, do not exit early returning true, or the plugins will not get a chance to claim the file. */ if (entry->flags.search_dirs || !entry->flags.dynamic) @@ -191,7 +191,7 @@ ldfile_try_open_bfd (const char *attempt, /* Try to interpret the file as a linker script. */ ldfile_open_command_file (attempt); - ldfile_assumed_script = TRUE; + ldfile_assumed_script = true; parser_input = input_selected; ldlex_both (); token = INPUT_SCRIPT; @@ -258,7 +258,7 @@ ldfile_try_open_bfd (const char *attempt, token = yylex (); } ldlex_popstate (); - ldfile_assumed_script = FALSE; + ldfile_assumed_script = false; fclose (yyin); yyin = NULL; if (skip) @@ -269,7 +269,7 @@ ldfile_try_open_bfd (const char *attempt, attempt, entry->local_sym_name); bfd_close (entry->the_bfd); entry->the_bfd = NULL; - return FALSE; + return false; } } goto success; @@ -281,7 +281,7 @@ ldfile_try_open_bfd (const char *attempt, attempt); bfd_close (entry->the_bfd); entry->the_bfd = NULL; - return FALSE; + return false; } if (entry->flags.search_dirs @@ -299,7 +299,7 @@ ldfile_try_open_bfd (const char *attempt, attempt, entry->local_sym_name); bfd_close (entry->the_bfd); entry->the_bfd = NULL; - return FALSE; + return false; } } } @@ -322,13 +322,13 @@ ldfile_try_open_bfd (const char *attempt, /* It opened OK, the format checked out, and the plugins have had their chance to claim it, so this is success. */ - return TRUE; + return true; } /* Search for and open the file specified by ENTRY. If it is an archive, use ARCH, LIB and SUFFIX to modify the file name. */ -bfd_boolean +bool ldfile_open_file_search (const char *arch, lang_input_statement_type *entry, const char *lib, @@ -347,15 +347,15 @@ ldfile_open_file_search (const char *arch, if (ldfile_try_open_bfd (name, entry)) { entry->filename = name; - return TRUE; + return true; } free (name); } else if (ldfile_try_open_bfd (entry->filename, entry)) - return TRUE; + return true; if (IS_ABSOLUTE_PATH (entry->filename)) - return FALSE; + return false; } for (search = search_head; search != NULL; search = search->next) @@ -365,7 +365,7 @@ ldfile_open_file_search (const char *arch, if (entry->flags.dynamic && !bfd_link_relocatable (&link_info)) { if (ldemul_open_dynamic_archive (arch, search, entry)) - return TRUE; + return true; } if (entry->flags.maybe_archive && !entry->flags.full_name_provided) @@ -378,13 +378,13 @@ ldfile_open_file_search (const char *arch, if (ldfile_try_open_bfd (string, entry)) { entry->filename = string; - return TRUE; + return true; } free (string); } - return FALSE; + return false; } /* Open the input file specified by ENTRY. @@ -409,13 +409,13 @@ ldfile_open_file (lang_input_statement_type *entry) else einfo (_("%P: cannot find %s: %E\n"), entry->local_sym_name); - entry->flags.missing_file = TRUE; - input_flags.missing_file = TRUE; + entry->flags.missing_file = true; + input_flags.missing_file = true; } else { search_arch_type *arch; - bfd_boolean found = FALSE; + bool found = false; /* If extra_search_path is set, entry->filename is a relative path. Search the directory of the current linker script before searching @@ -427,7 +427,7 @@ ldfile_open_file (lang_input_statement_type *entry) if (ldfile_try_open_bfd (path, entry)) { entry->filename = path; - entry->flags.search_dirs = FALSE; + entry->flags.search_dirs = false; return; } @@ -453,7 +453,7 @@ ldfile_open_file (lang_input_statement_type *entry) /* If we have found the file, we don't need to search directories again. */ if (found) - entry->flags.search_dirs = FALSE; + entry->flags.search_dirs = false; else { if (entry->flags.sysrooted @@ -513,8 +513,8 @@ ldfile_open_file (lang_input_statement_type *entry) } } - entry->flags.missing_file = TRUE; - input_flags.missing_file = TRUE; + entry->flags.missing_file = true; + input_flags.missing_file = true; } } } @@ -522,7 +522,7 @@ ldfile_open_file (lang_input_statement_type *entry) /* Try to open NAME. */ static FILE * -try_open (const char *name, bfd_boolean *sysrooted) +try_open (const char *name, bool *sysrooted) { FILE *result; @@ -544,12 +544,12 @@ try_open (const char *name, bfd_boolean *sysrooted) /* Return TRUE iff directory DIR contains an "ldscripts" subdirectory. */ -static bfd_boolean +static bool check_for_scripts_dir (char *dir) { char *buf; struct stat s; - bfd_boolean res; + bool res; buf = concat (dir, "/ldscripts", (const char *) NULL); res = stat (buf, &s) == 0 && S_ISDIR (s.st_mode); @@ -604,8 +604,8 @@ find_scripts_dir (void) static FILE * ldfile_find_command_file (const char *name, - bfd_boolean default_only, - bfd_boolean *sysrooted) + bool default_only, + bool *sysrooted) { search_dirs_type *search; FILE *result = NULL; @@ -627,7 +627,7 @@ ldfile_find_command_file (const char *name, { search_dirs_type **save_tail_ptr = search_tail_ptr; search_tail_ptr = &script_search; - ldfile_add_library_path (script_dir, TRUE); + ldfile_add_library_path (script_dir, true); search_tail_ptr = save_tail_ptr; } } @@ -673,7 +673,7 @@ static void ldfile_open_command_file_1 (const char *name, enum script_open_style open_how) { FILE *ldlex_input_stack; - bfd_boolean sysrooted; + bool sysrooted; static struct script_name_list *processed_scripts = NULL; struct script_name_list *script; size_t len; diff --git a/ld/ldfile.h b/ld/ldfile.h index 5c5ac361c77..5b0b27a2fb4 100644 --- a/ld/ldfile.h +++ b/ld/ldfile.h @@ -21,7 +21,7 @@ #ifndef LDFILE_H #define LDFILE_H -extern bfd_boolean ldfile_assumed_script; +extern bool ldfile_assumed_script; extern unsigned long ldfile_output_machine; extern enum bfd_architecture ldfile_output_architecture; extern const char *ldfile_output_machine_name; @@ -35,7 +35,7 @@ typedef struct search_dirs { /* Name of directory. */ const char *name; /* TRUE if this is from the command line. */ - bfd_boolean cmdline; + bool cmdline; } search_dirs_type; extern search_dirs_type *search_head; @@ -43,7 +43,7 @@ extern search_dirs_type *search_head; extern void ldfile_add_arch (const char *); extern void ldfile_add_library_path - (const char *, bfd_boolean cmdline); + (const char *, bool cmdline); extern void ldfile_open_command_file (const char *name); extern void ldfile_open_script_file @@ -52,11 +52,11 @@ extern void ldfile_open_default_command_file (const char *name); extern void ldfile_open_file (struct lang_input_statement_struct *); -extern bfd_boolean ldfile_try_open_bfd +extern bool ldfile_try_open_bfd (const char *, struct lang_input_statement_struct *); extern void ldfile_set_output_arch (const char *, enum bfd_architecture); -extern bfd_boolean ldfile_open_file_search +extern bool ldfile_open_file_search (const char *arch, struct lang_input_statement_struct *, const char *lib, const char *suffix); diff --git a/ld/ldgram.y b/ld/ldgram.y index 5912329c778..dd911f46169 100644 --- a/ld/ldgram.y +++ b/ld/ldgram.y @@ -49,7 +49,7 @@ static enum section_type sectype; static lang_memory_region_type *region; -static bfd_boolean ldgram_had_keep = FALSE; +static bool ldgram_had_keep = false; static char *ldgram_vers_current_lang = NULL; #define ERROR_NAME_MAX 20 @@ -77,8 +77,8 @@ static int error_index; union etree_union *etree; struct phdr_info { - bfd_boolean filehdr; - bfd_boolean phdrs; + bool filehdr; + bool phdrs; union etree_union *at; union etree_union *flags; } phdr; @@ -252,7 +252,7 @@ mri_script_command: mri_script_lines END { ldlex_popstate (); } | START NAME - { lang_add_entry ($2, FALSE); } + { lang_add_entry ($2, false); } | ; @@ -289,11 +289,11 @@ extern_name_list: extern_name_list_body: NAME - { ldlang_add_undef ($1, FALSE); } + { ldlang_add_undef ($1, false); } | extern_name_list_body NAME - { ldlang_add_undef ($2, FALSE); } + { ldlang_add_undef ($2, false); } | extern_name_list_body ',' NAME - { ldlang_add_undef ($3, FALSE); } + { ldlang_add_undef ($3, false); } ; script_file: @@ -322,7 +322,7 @@ ifile_p1: | TARGET_K '(' NAME ')' { lang_add_target($3); } | SEARCH_DIR '(' filename ')' - { ldfile_add_library_path ($3, FALSE); } + { ldfile_add_library_path ($3, false); } | OUTPUT '(' filename ')' { lang_add_output($3, 1); } | OUTPUT_FORMAT '(' NAME ')' @@ -333,11 +333,11 @@ ifile_p1: | OUTPUT_ARCH '(' NAME ')' { ldfile_set_output_arch ($3, bfd_arch_unknown); } | FORCE_COMMON_ALLOCATION - { command_line.force_common_definition = TRUE ; } + { command_line.force_common_definition = true ; } | FORCE_GROUP_ALLOCATION - { command_line.force_group_allocation = TRUE ; } + { command_line.force_group_allocation = true ; } | INHIBIT_COMMON_ALLOCATION - { link_info.inhibit_common_definition = TRUE ; } + { link_info.inhibit_common_definition = true ; } | INPUT '(' input_list ')' | GROUP { lang_enter_group (); } @@ -394,17 +394,17 @@ input_list1: (char *)NULL); } | AS_NEEDED '(' { $$ = input_flags.add_DT_NEEDED_for_regular; - input_flags.add_DT_NEEDED_for_regular = TRUE; } + input_flags.add_DT_NEEDED_for_regular = true; } input_list1 ')' { input_flags.add_DT_NEEDED_for_regular = $3; } | input_list1 ',' AS_NEEDED '(' { $$ = input_flags.add_DT_NEEDED_for_regular; - input_flags.add_DT_NEEDED_for_regular = TRUE; } + input_flags.add_DT_NEEDED_for_regular = true; } input_list1 ')' { input_flags.add_DT_NEEDED_for_regular = $5; } | input_list1 AS_NEEDED '(' { $$ = input_flags.add_DT_NEEDED_for_regular; - input_flags.add_DT_NEEDED_for_regular = TRUE; } + input_flags.add_DT_NEEDED_for_regular = true; } input_list1 ')' { input_flags.add_DT_NEEDED_for_regular = $4; } ; @@ -421,7 +421,7 @@ sec_or_group_p1: statement_anywhere: ENTRY '(' NAME ')' - { lang_add_entry ($3, FALSE); } + { lang_add_entry ($3, false); } | assignment end | ASSERT_K {ldlex_expression ();} '(' exp ',' NAME ')' { ldlex_popstate (); @@ -534,7 +534,7 @@ sect_flag_list: NAME n->with = with_flags; n->name = $1; } - n->valid = FALSE; + n->valid = false; n->next = NULL; $$ = n; } @@ -552,7 +552,7 @@ sect_flag_list: NAME n->with = with_flags; n->name = $3; } - n->valid = FALSE; + n->valid = false; n->next = $1; $$ = n; } @@ -564,7 +564,7 @@ sect_flags: struct flag_info *n; n = ((struct flag_info *) xmalloc (sizeof *n)); n->flag_list = $3; - n->flags_initialized = FALSE; + n->flags_initialized = false; n->not_with_flags = 0; n->only_with_flags = 0; $$ = n; @@ -657,9 +657,9 @@ input_section_spec_no_keep: input_section_spec: input_section_spec_no_keep | KEEP '(' - { ldgram_had_keep = TRUE; } + { ldgram_had_keep = true; } input_section_spec_no_keep ')' - { ldgram_had_keep = FALSE; } + { ldgram_had_keep = false; } ; statement: @@ -676,7 +676,7 @@ statement: } | SORT_BY_NAME '(' CONSTRUCTORS ')' { - constructors_sorted = TRUE; + constructors_sorted = true; lang_add_attribute (lang_constructors_statement_enum); } | input_section_spec @@ -761,7 +761,7 @@ end: ';' | ',' assignment: NAME '=' mustbe_exp { - lang_add_assignment (exp_assign ($1, $3, FALSE)); + lang_add_assignment (exp_assign ($1, $3, false)); } | NAME assign_op mustbe_exp { @@ -769,19 +769,19 @@ assignment: exp_binop ($2, exp_nameop (NAME, $1), - $3), FALSE)); + $3), false)); } | HIDDEN '(' NAME '=' mustbe_exp ')' { - lang_add_assignment (exp_assign ($3, $5, TRUE)); + lang_add_assignment (exp_assign ($3, $5, true)); } | PROVIDE '(' NAME '=' mustbe_exp ')' { - lang_add_assignment (exp_provide ($3, $5, FALSE)); + lang_add_assignment (exp_provide ($3, $5, false)); } | PROVIDE_HIDDEN '(' NAME '=' mustbe_exp ')' { - lang_add_assignment (exp_provide ($3, $5, TRUE)); + lang_add_assignment (exp_provide ($3, $5, true)); } ; @@ -803,7 +803,7 @@ memory_spec_list: memory_spec: NAME - { region = lang_memory_region_lookup ($1, TRUE); } + { region = lang_memory_region_lookup ($1, true); } attributes_opt ':' origin_spec opt_comma length_spec {} @@ -875,9 +875,9 @@ low_level_library_NAME_list: floating_point_support: FLOAT - { lang_float(TRUE); } + { lang_float(true); } | NOFLOAT - { lang_float(FALSE); } + { lang_float(false); } ; nocrossref_list: @@ -1108,7 +1108,7 @@ section: NAME { ldlex_expression(); } opt_exp_with_type { ldlex_popstate (); - lang_add_assignment (exp_assign (".", $3, FALSE)); + lang_add_assignment (exp_assign (".", $3, false)); } '{' sec_or_group_p1 '}' | INCLUDE filename @@ -1173,7 +1173,7 @@ phdr_opt: n = ((struct lang_output_section_phdr_list *) xmalloc (sizeof *n)); n->name = $3; - n->used = FALSE; + n->used = false; n->next = $1; $$ = n; } @@ -1269,9 +1269,9 @@ phdr_qualifiers: { $$ = $3; if (strcmp ($1, "FILEHDR") == 0 && $2 == NULL) - $$.filehdr = TRUE; + $$.filehdr = true; else if (strcmp ($1, "PHDRS") == 0 && $2 == NULL) - $$.phdrs = TRUE; + $$.phdrs = true; else if (strcmp ($1, "FLAGS") == 0 && $2 != NULL) $$.flags = $2; else @@ -1407,19 +1407,19 @@ vers_tag: vers_defns: VERS_IDENTIFIER { - $$ = lang_new_vers_pattern (NULL, $1, ldgram_vers_current_lang, FALSE); + $$ = lang_new_vers_pattern (NULL, $1, ldgram_vers_current_lang, false); } | NAME { - $$ = lang_new_vers_pattern (NULL, $1, ldgram_vers_current_lang, TRUE); + $$ = lang_new_vers_pattern (NULL, $1, ldgram_vers_current_lang, true); } | vers_defns ';' VERS_IDENTIFIER { - $$ = lang_new_vers_pattern ($1, $3, ldgram_vers_current_lang, FALSE); + $$ = lang_new_vers_pattern ($1, $3, ldgram_vers_current_lang, false); } | vers_defns ';' NAME { - $$ = lang_new_vers_pattern ($1, $3, ldgram_vers_current_lang, TRUE); + $$ = lang_new_vers_pattern ($1, $3, ldgram_vers_current_lang, true); } | vers_defns ';' EXTERN NAME '{' { @@ -1446,27 +1446,27 @@ vers_defns: } | GLOBAL { - $$ = lang_new_vers_pattern (NULL, "global", ldgram_vers_current_lang, FALSE); + $$ = lang_new_vers_pattern (NULL, "global", ldgram_vers_current_lang, false); } | vers_defns ';' GLOBAL { - $$ = lang_new_vers_pattern ($1, "global", ldgram_vers_current_lang, FALSE); + $$ = lang_new_vers_pattern ($1, "global", ldgram_vers_current_lang, false); } | LOCAL { - $$ = lang_new_vers_pattern (NULL, "local", ldgram_vers_current_lang, FALSE); + $$ = lang_new_vers_pattern (NULL, "local", ldgram_vers_current_lang, false); } | vers_defns ';' LOCAL { - $$ = lang_new_vers_pattern ($1, "local", ldgram_vers_current_lang, FALSE); + $$ = lang_new_vers_pattern ($1, "local", ldgram_vers_current_lang, false); } | EXTERN { - $$ = lang_new_vers_pattern (NULL, "extern", ldgram_vers_current_lang, FALSE); + $$ = lang_new_vers_pattern (NULL, "extern", ldgram_vers_current_lang, false); } | vers_defns ';' EXTERN { - $$ = lang_new_vers_pattern ($1, "extern", ldgram_vers_current_lang, FALSE); + $$ = lang_new_vers_pattern ($1, "extern", ldgram_vers_current_lang, false); } ; diff --git a/ld/ldlang.c b/ld/ldlang.c index 629be32efaf..89108993236 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -63,9 +63,9 @@ static struct obstack map_obstack; #define obstack_chunk_alloc xmalloc #define obstack_chunk_free free static const char *entry_symbol_default = "start"; -static bfd_boolean map_head_is_link_order = FALSE; +static bool map_head_is_link_order = false; static lang_output_section_statement_type *default_common_section; -static bfd_boolean map_option_f; +static bool map_option_f; static bfd_vma print_dot; static lang_input_statement_type *first_file; static const char *current_target; @@ -79,19 +79,19 @@ static unsigned int opb_shift = 0; static void exp_init_os (etree_type *); static lang_input_statement_type *lookup_name (const char *); static void insert_undefined (const char *); -static bfd_boolean sort_def_symbol (struct bfd_link_hash_entry *, void *); +static bool sort_def_symbol (struct bfd_link_hash_entry *, void *); static void print_statement (lang_statement_union_type *, lang_output_section_statement_type *); static void print_statement_list (lang_statement_union_type *, lang_output_section_statement_type *); static void print_statements (void); -static void print_input_section (asection *, bfd_boolean); -static bfd_boolean lang_one_common (struct bfd_link_hash_entry *, void *); +static void print_input_section (asection *, bool); +static bool lang_one_common (struct bfd_link_hash_entry *, void *); static void lang_record_phdrs (void); static void lang_do_version_exports_section (void); static void lang_finalize_version_expr_head (struct bfd_elf_version_expr_head *); -static void lang_do_memory_regions (bfd_boolean); +static void lang_do_memory_regions (bool); /* Exported variables. */ const char *output_target; @@ -122,11 +122,11 @@ struct bfd_elf_dynamic_list **current_dynamic_list_p; struct bfd_sym_chain entry_symbol = { NULL, NULL }; const char *entry_section = ".text"; struct lang_input_statement_flags input_flags; -bfd_boolean entry_from_cmdline; -bfd_boolean lang_has_input_file = FALSE; -bfd_boolean had_output_filename = FALSE; -bfd_boolean lang_float_flag = FALSE; -bfd_boolean delete_output_file_on_failure = FALSE; +bool entry_from_cmdline; +bool lang_has_input_file = false; +bool had_output_filename = false; +bool lang_float_flag = false; +bool delete_output_file_on_failure = false; struct lang_phdr *lang_phdr_list; struct lang_nocrossrefs *nocrossref_list; struct asneeded_minfo **asneeded_list_tail; @@ -219,18 +219,18 @@ archive_path (const char *pattern) /* Given that FILE_SPEC results in a non-NULL SEP result from archive_path, return whether F matches FILE_SPEC. */ -static bfd_boolean +static bool input_statement_is_archive_path (const char *file_spec, char *sep, lang_input_statement_type *f) { - bfd_boolean match = FALSE; + bool match = false; if ((*(sep + 1) == 0 || name_match (sep + 1, f->filename) == 0) && ((sep != file_spec) == (f->the_bfd != NULL && f->the_bfd->my_archive != NULL))) { - match = TRUE; + match = true; if (sep != file_spec) { @@ -243,7 +243,7 @@ input_statement_is_archive_path (const char *file_spec, char *sep, return match; } -static bfd_boolean +static bool unique_section_p (const asection *sec, const lang_output_section_statement_type *os) { @@ -259,9 +259,9 @@ unique_section_p (const asection *sec, secnam = sec->name; for (unam = unique_section_list; unam; unam = unam->next) if (name_match (unam->name, secnam) == 0) - return TRUE; + return true; - return FALSE; + return false; } /* Generic traversal routines for finding matching sections. */ @@ -269,7 +269,7 @@ unique_section_p (const asection *sec, /* Return true if FILE matches a pattern in EXCLUDE_LIST, otherwise return false. */ -static bfd_boolean +static bool walk_wild_file_in_exclude_list (struct name_list *exclude_list, lang_input_statement_type *file) { @@ -284,11 +284,11 @@ walk_wild_file_in_exclude_list (struct name_list *exclude_list, if (p != NULL) { if (input_statement_is_archive_path (list_tmp->name, p, file)) - return TRUE; + return true; } else if (name_match (list_tmp->name, file->filename) == 0) - return TRUE; + return true; /* FIXME: Perhaps remove the following at some stage? Matching unadorned archives like this was never documented and has @@ -297,10 +297,10 @@ walk_wild_file_in_exclude_list (struct name_list *exclude_list, && file->the_bfd->my_archive != NULL && name_match (list_tmp->name, bfd_get_filename (file->the_bfd->my_archive)) == 0) - return TRUE; + return true; } - return FALSE; + return false; } /* Try processing a section against a wildcard. This just calls @@ -343,7 +343,7 @@ walk_wild_section_general (lang_wild_statement_type *ptr, while (sec != NULL) { - bfd_boolean skip = FALSE; + bool skip = false; if (sec->spec.name != NULL) { @@ -366,30 +366,30 @@ walk_wild_section_general (lang_wild_statement_type *ptr, typedef struct { asection *found_section; - bfd_boolean multiple_sections_found; + bool multiple_sections_found; } section_iterator_callback_data; -static bfd_boolean +static bool section_iterator_callback (bfd *abfd ATTRIBUTE_UNUSED, asection *s, void *data) { section_iterator_callback_data *d = (section_iterator_callback_data *) data; if (d->found_section != NULL) { - d->multiple_sections_found = TRUE; - return TRUE; + d->multiple_sections_found = true; + return true; } d->found_section = s; - return FALSE; + return false; } static asection * find_section (lang_input_statement_type *file, struct wildcard_list *sec, - bfd_boolean *multiple_sections_found) + bool *multiple_sections_found) { - section_iterator_callback_data cb_data = { NULL, FALSE }; + section_iterator_callback_data cb_data = { NULL, false }; bfd_get_section_by_name_if (file->the_bfd, sec->spec.name, section_iterator_callback, &cb_data); @@ -403,29 +403,29 @@ find_section (lang_input_statement_type *file, /* A simple wild is a literal string followed by a single '*', where the literal part is at least 4 characters long. */ -static bfd_boolean +static bool is_simple_wild (const char *name) { size_t len = strcspn (name, "*?["); return len >= 4 && name[len] == '*' && name[len + 1] == '\0'; } -static bfd_boolean +static bool match_simple_wild (const char *pattern, const char *name) { /* The first four characters of the pattern are guaranteed valid non-wildcard characters. So we can go faster. */ if (pattern[0] != name[0] || pattern[1] != name[1] || pattern[2] != name[2] || pattern[3] != name[3]) - return FALSE; + return false; pattern += 4; name += 4; while (*pattern != '*') if (*name++ != *pattern++) - return FALSE; + return false; - return TRUE; + return true; } /* Return the numerical value of the init_priority attribute from @@ -622,7 +622,7 @@ walk_wild_section_specs1_wild0 (lang_wild_statement_type *ptr, (should be rare), we fall back to the general algorithm because we would otherwise have to sort the sections to make sure they get processed in the bfd's order. */ - bfd_boolean multiple_sections_found; + bool multiple_sections_found; struct wildcard_list *sec0 = ptr->handler_data[0]; asection *s0 = find_section (file, sec0, &multiple_sections_found); @@ -644,7 +644,7 @@ walk_wild_section_specs1_wild1 (lang_wild_statement_type *ptr, for (s = file->the_bfd->sections; s != NULL; s = s->next) { const char *sname = bfd_section_name (s); - bfd_boolean skip = !match_simple_wild (wildsec0->spec.name, sname); + bool skip = !match_simple_wild (wildsec0->spec.name, sname); if (!skip) walk_wild_consider_section (ptr, file, s, wildsec0, callback, data); @@ -660,7 +660,7 @@ walk_wild_section_specs2_wild1 (lang_wild_statement_type *ptr, asection *s; struct wildcard_list *sec0 = ptr->handler_data[0]; struct wildcard_list *wildsec1 = ptr->handler_data[1]; - bfd_boolean multiple_sections_found; + bool multiple_sections_found; asection *s0 = find_section (file, sec0, &multiple_sections_found); if (multiple_sections_found) @@ -681,7 +681,7 @@ walk_wild_section_specs2_wild1 (lang_wild_statement_type *ptr, else { const char *sname = bfd_section_name (s); - bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname); + bool skip = !match_simple_wild (wildsec1->spec.name, sname); if (!skip) walk_wild_consider_section (ptr, file, s, wildsec1, callback, @@ -700,7 +700,7 @@ walk_wild_section_specs3_wild2 (lang_wild_statement_type *ptr, struct wildcard_list *sec0 = ptr->handler_data[0]; struct wildcard_list *wildsec1 = ptr->handler_data[1]; struct wildcard_list *wildsec2 = ptr->handler_data[2]; - bfd_boolean multiple_sections_found; + bool multiple_sections_found; asection *s0 = find_section (file, sec0, &multiple_sections_found); if (multiple_sections_found) @@ -716,7 +716,7 @@ walk_wild_section_specs3_wild2 (lang_wild_statement_type *ptr, else { const char *sname = bfd_section_name (s); - bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname); + bool skip = !match_simple_wild (wildsec1->spec.name, sname); if (!skip) walk_wild_consider_section (ptr, file, s, wildsec1, callback, data); @@ -742,7 +742,7 @@ walk_wild_section_specs4_wild2 (lang_wild_statement_type *ptr, struct wildcard_list *sec1 = ptr->handler_data[1]; struct wildcard_list *wildsec2 = ptr->handler_data[2]; struct wildcard_list *wildsec3 = ptr->handler_data[3]; - bfd_boolean multiple_sections_found; + bool multiple_sections_found; asection *s0 = find_section (file, sec0, &multiple_sections_found), *s1; if (multiple_sections_found) @@ -768,8 +768,7 @@ walk_wild_section_specs4_wild2 (lang_wild_statement_type *ptr, else { const char *sname = bfd_section_name (s); - bfd_boolean skip = !match_simple_wild (wildsec2->spec.name, - sname); + bool skip = !match_simple_wild (wildsec2->spec.name, sname); if (!skip) walk_wild_consider_section (ptr, file, s, wildsec2, callback, @@ -802,7 +801,7 @@ walk_wild_section (lang_wild_statement_type *ptr, only if the prefixes of name1 and name2 are different up to the first wildcard character. */ -static bfd_boolean +static bool wild_spec_can_overlap (const char *name1, const char *name2) { size_t prefix1_len = strcspn (name1, "?*["); @@ -1114,7 +1113,7 @@ new_afile (const char *name, { lang_input_statement_type *p; - lang_has_input_file = TRUE; + lang_has_input_file = true; p = new_stat (lang_input_statement, stat_ptr); memset (&p->the_bfd, 0, @@ -1132,8 +1131,8 @@ new_afile (const char *name, case lang_input_file_is_symbols_only_enum: p->filename = name; p->local_sym_name = name; - p->flags.real = TRUE; - p->flags.just_syms = TRUE; + p->flags.real = true; + p->flags.just_syms = true; break; case lang_input_file_is_fake_enum: p->filename = name; @@ -1143,19 +1142,19 @@ new_afile (const char *name, if (name[0] == ':' && name[1] != '\0') { p->filename = name + 1; - p->flags.full_name_provided = TRUE; + p->flags.full_name_provided = true; } else p->filename = name; p->local_sym_name = concat ("-l", name, (const char *) NULL); - p->flags.maybe_archive = TRUE; - p->flags.real = TRUE; - p->flags.search_dirs = TRUE; + p->flags.maybe_archive = true; + p->flags.real = true; + p->flags.search_dirs = true; break; case lang_input_file_is_marker_enum: p->filename = name; p->local_sym_name = name; - p->flags.search_dirs = TRUE; + p->flags.search_dirs = true; break; case lang_input_file_is_search_file_enum: p->filename = name; @@ -1164,13 +1163,13 @@ new_afile (const char *name, script first. */ if (from_filename && !IS_ABSOLUTE_PATH (name)) p->extra_search_path = ldirname (from_filename); - p->flags.real = TRUE; - p->flags.search_dirs = TRUE; + p->flags.real = true; + p->flags.search_dirs = true; break; case lang_input_file_is_file_enum: p->filename = name; p->local_sym_name = name; - p->flags.real = TRUE; + p->flags.real = true; break; default: FAIL (); @@ -1346,7 +1345,7 @@ static lang_memory_region_type **lang_memory_region_list_tail = &lang_memory_region_list; lang_memory_region_type * -lang_memory_region_lookup (const char *const name, bfd_boolean create) +lang_memory_region_lookup (const char *const name, bool create) { lang_memory_region_name *n; lang_memory_region_type *r; @@ -1383,7 +1382,7 @@ lang_memory_region_lookup (const char *const name, bfd_boolean create) new_region->last_os = NULL; new_region->flags = 0; new_region->not_flags = 0; - new_region->had_full_message = FALSE; + new_region->had_full_message = false; *lang_memory_region_list_tail = new_region; lang_memory_region_list_tail = &new_region->next; @@ -1451,7 +1450,7 @@ lang_memory_default (asection *section) return p; } } - return lang_memory_region_lookup (DEFAULT_MEMORY_REGION, FALSE); + return lang_memory_region_lookup (DEFAULT_MEMORY_REGION, false); } /* Get the output section statement directly from the userdata. */ @@ -1478,7 +1477,7 @@ lang_output_section_statement_lookup (const char *name, entry = ((struct out_section_hash_entry *) bfd_hash_lookup (&output_section_statement_table, name, - create != 0, FALSE)); + create != 0, false)); if (entry == NULL) { if (create) @@ -1655,7 +1654,7 @@ lang_output_section_find_by_flags (const asection *sec, { /* .tdata can go after .data, .tbss after .tdata. Treat .tbss as if it were a loaded section, and don't use match_type. */ - bfd_boolean seen_thread_local = FALSE; + bool seen_thread_local = false; match_type = NULL; for (look = first; look; look = look->next) @@ -1675,7 +1674,7 @@ lang_output_section_find_by_flags (const asection *sec, previous section. */ break; found = look; - seen_thread_local = TRUE; + seen_thread_local = true; } else if (seen_thread_local) break; @@ -1803,7 +1802,7 @@ insert_os_after (lang_output_section_statement_type *after) { lang_statement_union_type **where; lang_statement_union_type **assign = NULL; - bfd_boolean ignore_first; + bool ignore_first; ignore_first = after == (void *) lang_os_list.head; @@ -1825,7 +1824,7 @@ insert_os_after (lang_output_section_statement_type *after) { if (!ignore_first) assign = where; - ignore_first = FALSE; + ignore_first = false; } } continue; @@ -1838,7 +1837,7 @@ insert_os_after (lang_output_section_statement_type *after) case lang_padding_statement_enum: case lang_constructors_statement_enum: assign = NULL; - ignore_first = FALSE; + ignore_first = false; continue; case lang_output_section_statement_enum: if (assign != NULL) @@ -1921,8 +1920,8 @@ lang_insert_orphan (asection *s, if (after != NULL && os->bfd_section != NULL) { asection *snew, *as; - bfd_boolean place_after = place->stmt == NULL; - bfd_boolean insert_after = TRUE; + bool place_after = place->stmt == NULL; + bool insert_after = true; snew = os->bfd_section; @@ -1977,7 +1976,7 @@ lang_insert_orphan (asection *s, asection *after_sec; /* True if we need to insert the orphan section after a specific section to maintain output note section order. */ - bfd_boolean after_sec_note = FALSE; + bool after_sec_note = false; static asection *first_orphan_note = NULL; @@ -2021,14 +2020,14 @@ lang_insert_orphan (asection *s, alignments, place the section before all output orphan note sections. */ after_sec = first_orphan_note; - insert_after = FALSE; + insert_after = false; } } else if (first_orphan_note) { /* Don't place non-note sections in the middle of orphan note sections. */ - after_sec_note = TRUE; + after_sec_note = true; after_sec = as; for (sec = as->next; (sec != NULL @@ -2046,7 +2045,7 @@ lang_insert_orphan (asection *s, /* Search forward to insert OS after AFTER_SEC output statement. */ lang_output_section_statement_type *stmt, *next; - bfd_boolean found = FALSE; + bool found = false; for (stmt = after; stmt != NULL; stmt = next) { next = stmt->next; @@ -2054,8 +2053,8 @@ lang_insert_orphan (asection *s, { if (stmt->bfd_section == after_sec) { - place_after = TRUE; - found = TRUE; + place_after = true; + found = true; after = stmt; break; } @@ -2066,8 +2065,8 @@ lang_insert_orphan (asection *s, AFTER_SEC output statement. */ if (next && next->bfd_section == after_sec) { - place_after = TRUE; - found = TRUE; + place_after = true; + found = true; after = stmt; break; } @@ -2083,7 +2082,7 @@ lang_insert_orphan (asection *s, { if (stmt->bfd_section == after_sec) { - place_after = TRUE; + place_after = true; after = stmt; break; } @@ -2094,7 +2093,7 @@ lang_insert_orphan (asection *s, AFTER_SEC output statement. */ if (stmt->next->bfd_section == after_sec) { - place_after = TRUE; + place_after = true; after = stmt; break; } @@ -2266,7 +2265,7 @@ void lang_map (void) { lang_memory_region_type *m; - bfd_boolean dis_header_printed = FALSE; + bool dis_header_printed = false; LANG_FOR_EACH_INPUT_STATEMENT (file) { @@ -2285,10 +2284,10 @@ lang_map (void) if (! dis_header_printed) { fprintf (config.map_file, _("\nDiscarded input sections\n\n")); - dis_header_printed = TRUE; + dis_header_printed = true; } - print_input_section (s, TRUE); + print_input_section (s, true); } } @@ -2349,7 +2348,7 @@ lang_map (void) config.map_file); } -static bfd_boolean +static bool sort_def_symbol (struct bfd_link_hash_entry *hash_entry, void *info ATTRIBUTE_UNUSED) { @@ -2378,7 +2377,7 @@ sort_def_symbol (struct bfd_link_hash_entry *hash_entry, ud->map_symbol_def_tail = &def->next; ud->map_symbol_def_count++; } - return TRUE; + return true; } /* Initialize an output section. */ @@ -2502,10 +2501,10 @@ section_already_linked (bfd *abfd, asection *sec, void *data) /* Returns true if SECTION is one we know will be discarded based on its section flags, otherwise returns false. */ -static bfd_boolean +static bool lang_discard_section_p (asection *section) { - bfd_boolean discard; + bool discard; flagword flags = section->flags; /* Discard sections marked with SEC_EXCLUDE. */ @@ -2515,13 +2514,13 @@ lang_discard_section_p (asection *section) sections from within the group. */ if ((flags & SEC_GROUP) != 0 && link_info.resolve_section_groups) - discard = TRUE; + discard = true; /* Discard debugging sections if we are stripping debugging information. */ if ((link_info.strip == strip_debugger || link_info.strip == strip_all) && (flags & SEC_DEBUGGING) != 0) - discard = TRUE; + discard = true; return discard; } @@ -2544,7 +2543,7 @@ lang_add_section (lang_statement_list_type *ptr, { flagword flags = section->flags; - bfd_boolean discard; + bool discard; lang_input_section_type *new_section; bfd *abfd = link_info.output_bfd; @@ -2554,7 +2553,7 @@ lang_add_section (lang_statement_list_type *ptr, /* Discard input sections which are assigned to a section named DISCARD_SECTION_NAME. */ if (strcmp (output->name, DISCARD_SECTION_NAME) == 0) - discard = TRUE; + discard = true; if (discard) { @@ -2573,7 +2572,7 @@ lang_add_section (lang_statement_list_type *ptr, if (sflag_info) { - bfd_boolean keep; + bool keep; keep = bfd_lookup_section_flags (&link_info, sflag_info, section); if (!keep) @@ -2753,7 +2752,7 @@ wild_sort (lang_wild_statement_type *wild, if (wild->filenames_sorted) { const char *fn, *ln; - bfd_boolean fa, la; + bool fa, la; int i; /* The PE support for the .idata section as generated by @@ -2765,23 +2764,23 @@ wild_sort (lang_wild_statement_type *wild, && file->the_bfd->my_archive != NULL) { fn = bfd_get_filename (file->the_bfd->my_archive); - fa = TRUE; + fa = true; } else { fn = file->filename; - fa = FALSE; + fa = false; } if (ls->section->owner->my_archive != NULL) { ln = bfd_get_filename (ls->section->owner->my_archive); - la = TRUE; + la = true; } else { ln = bfd_get_filename (ls->section->owner); - la = FALSE; + la = false; } i = filename_cmp (fn, ln); @@ -2892,7 +2891,7 @@ check_section_callback (lang_wild_statement_type *ptr ATTRIBUTE_UNUSED, return; if (section->output_section == NULL && (section->flags & SEC_READONLY) == 0) - os->all_input_readonly = FALSE; + os->all_input_readonly = false; } /* This is passed a file name which must have been seen already and @@ -2994,7 +2993,7 @@ check_excluded_libs (bfd *abfd) if (strcmp (lib->name, "ALL") == 0) { - abfd->no_export = TRUE; + abfd->no_export = true; return; } @@ -3003,7 +3002,7 @@ check_excluded_libs (bfd *abfd) || (filename[len] == '.' && filename[len + 1] == 'a' && filename[len + 2] == '\0'))) { - abfd->no_export = TRUE; + abfd->no_export = true; return; } @@ -3013,20 +3012,20 @@ check_excluded_libs (bfd *abfd) /* Get the symbols for an input file. */ -bfd_boolean +bool load_symbols (lang_input_statement_type *entry, lang_statement_list_type *place) { char **matching; if (entry->flags.loaded) - return TRUE; + return true; ldfile_open_file (entry); /* Do not process further if the file was missing. */ if (entry->flags.missing_file) - return TRUE; + return true; if (trace_files || verbose) info_msg ("%pI\n", entry); @@ -3042,7 +3041,7 @@ load_symbols (lang_input_statement_type *entry, /* See if the emulation has some special knowledge. */ if (ldemul_unrecognized_file (entry)) - return TRUE; + return true; if (err == bfd_error_file_ambiguously_recognized) { @@ -3073,12 +3072,12 @@ load_symbols (lang_input_statement_type *entry, input_flags.whole_archive = entry->flags.whole_archive; input_flags.dynamic = entry->flags.dynamic; - ldfile_assumed_script = TRUE; + ldfile_assumed_script = true; parser_input = input_script; current_input_file = entry->filename; yyparse (); current_input_file = NULL; - ldfile_assumed_script = FALSE; + ldfile_assumed_script = false; /* missing_file is sticky. sysrooted will already have been restored when seeing EOF in yyparse, but no harm to restore @@ -3088,13 +3087,13 @@ load_symbols (lang_input_statement_type *entry, pop_stat_ptr (); fclose (yyin); yyin = NULL; - entry->flags.loaded = TRUE; + entry->flags.loaded = true; - return TRUE; + return true; } if (ldemul_recognized_file (entry)) - return TRUE; + return true; /* We don't call ldlang_add_file for an archive. Instead, the add_symbols entry point will call ldlang_add_file, via the @@ -3117,7 +3116,7 @@ load_symbols (lang_input_statement_type *entry, if (entry->flags.whole_archive) { bfd *member = NULL; - bfd_boolean loaded = TRUE; + bool loaded = true; for (;;) { @@ -3131,7 +3130,7 @@ load_symbols (lang_input_statement_type *entry, { einfo (_("%F%P: %pB: member %pB in archive is not an object\n"), entry->the_bfd, member); - loaded = FALSE; + loaded = false; } subsbfd = member; @@ -3145,7 +3144,7 @@ load_symbols (lang_input_statement_type *entry, if (!bfd_link_add_symbols (subsbfd, &link_info)) { einfo (_("%F%P: %pB: error adding symbols: %E\n"), member); - loaded = FALSE; + loaded = false; } } @@ -3156,7 +3155,7 @@ load_symbols (lang_input_statement_type *entry, } if (bfd_link_add_symbols (entry->the_bfd, &link_info)) - entry->flags.loaded = TRUE; + entry->flags.loaded = true; else einfo (_("%F%P: %pB: error adding symbols: %E\n"), entry->the_bfd); @@ -3451,7 +3450,7 @@ open_output (const char *name) einfo (_("%F%P: cannot open output file %s: %E\n"), name); } - delete_output_file_on_failure = TRUE; + delete_output_file_on_failure = true; if (!bfd_set_format (link_info.output_bfd, bfd_object)) einfo (_("%F%P: %s: can not make object file: %E\n"), name); @@ -3618,15 +3617,15 @@ open_input_bfds (lang_statement_union_type *s, enum open_bfd_mode mode) && bfd_get_flavour (abfd) == bfd_target_elf_flavour && (elf_dyn_lib_class (abfd) & DYN_AS_NEEDED) != 0))) { - s->input_statement.flags.loaded = FALSE; - s->input_statement.flags.reload = TRUE; + s->input_statement.flags.loaded = false; + s->input_statement.flags.reload = true; } os_tail = lang_os_list.tail; lang_list_init (&add); if (!load_symbols (&s->input_statement, &add)) - config.make_executable = FALSE; + config.make_executable = false; if (add.head != NULL) { @@ -3957,7 +3956,7 @@ typedef struct bfd_sym_chain ldlang_undef_chain_list_type; #define ldlang_undef_chain_list_head entry_symbol.next void -ldlang_add_undef (const char *const name, bfd_boolean cmdline ATTRIBUTE_UNUSED) +ldlang_add_undef (const char *const name, bool cmdline ATTRIBUTE_UNUSED) { ldlang_undef_chain_list_type *new_undef; @@ -3978,14 +3977,14 @@ insert_undefined (const char *name) { struct bfd_link_hash_entry *h; - h = bfd_link_hash_lookup (link_info.hash, name, TRUE, FALSE, TRUE); + h = bfd_link_hash_lookup (link_info.hash, name, true, false, true); if (h == NULL) einfo (_("%F%P: bfd_link_hash_lookup failed: %E\n")); if (h->type == bfd_link_hash_new) { h->type = bfd_link_hash_undefined; h->u.undef.abfd = NULL; - h->non_ir_ref_regular = TRUE; + h->non_ir_ref_regular = true; bfd_link_add_undef (link_info.hash, h); } } @@ -4014,7 +4013,7 @@ lang_mark_undefineds (void) for (ptr = ldlang_undef_chain_list_head; ptr != NULL; ptr = ptr->next) { struct elf_link_hash_entry *h = (struct elf_link_hash_entry *) - bfd_link_hash_lookup (link_info.hash, ptr->name, FALSE, FALSE, TRUE); + bfd_link_hash_lookup (link_info.hash, ptr->name, false, false, true); if (h != NULL) h->mark = 1; } @@ -4041,7 +4040,7 @@ ldlang_add_require_defined (const char *const name) { struct require_defined_symbol *ptr; - ldlang_add_undef (name, TRUE); + ldlang_add_undef (name, true); ptr = stat_alloc (sizeof (*ptr)); ptr->next = require_defined_symbol_list; ptr->name = strdup (name); @@ -4061,7 +4060,7 @@ ldlang_check_require_defined_symbols (void) struct bfd_link_hash_entry *h; h = bfd_link_hash_lookup (link_info.hash, ptr->name, - FALSE, FALSE, TRUE); + false, false, true); if (h == NULL || (h->type != bfd_link_hash_defined && h->type != bfd_link_hash_defweak)) @@ -4197,7 +4196,7 @@ map_input_to_output_sections if (tos->constraint == ONLY_IF_RW || tos->constraint == ONLY_IF_RO) { - tos->all_input_readonly = TRUE; + tos->all_input_readonly = true; check_input_sections (tos->children.head, tos); if (tos->all_input_readonly != (tos->constraint == ONLY_IF_RO)) tos->constraint = -1; @@ -4495,7 +4494,7 @@ strip_excluded_output_sections (void) { expld.phase = lang_mark_phase_enum; expld.dataseg.phase = exp_seg_none; - one_lang_size_sections_pass (NULL, FALSE); + one_lang_size_sections_pass (NULL, false); lang_reset_memory_regions (); } @@ -4504,7 +4503,7 @@ strip_excluded_output_sections (void) os = os->next) { asection *output_section; - bfd_boolean exclude; + bool exclude; if (os->constraint < 0) continue; @@ -4531,7 +4530,7 @@ strip_excluded_output_sections (void) && ((s->flags & SEC_LINKER_CREATED) != 0 || link_info.emitrelocations)) { - exclude = FALSE; + exclude = false; break; } } @@ -4541,7 +4540,7 @@ strip_excluded_output_sections (void) /* We don't set bfd_section to NULL since bfd_section of the removed output section statement may still be used. */ if (!os->update_dot) - os->ignored = TRUE; + os->ignored = true; output_section->flags |= SEC_EXCLUDE; bfd_section_list_remove (link_info.output_bfd, output_section); link_info.output_bfd->section_count--; @@ -4580,7 +4579,7 @@ lang_clear_os_map (void) /* Stop future calls to lang_add_section from messing with map_head and map_tail link_order fields. */ - map_head_is_link_order = TRUE; + map_head_is_link_order = true; } static void @@ -4632,7 +4631,7 @@ print_assignment (lang_assignment_statement_type *assignment, lang_output_section_statement_type *output_section) { unsigned int i; - bfd_boolean is_dot; + bool is_dot; etree_type *tree; asection *osec; @@ -4641,7 +4640,7 @@ print_assignment (lang_assignment_statement_type *assignment, if (assignment->exp->type.node_class == etree_assert) { - is_dot = FALSE; + is_dot = false; tree = assignment->exp->assert_s.child; } else @@ -4659,7 +4658,7 @@ print_assignment (lang_assignment_statement_type *assignment, if (assignment->exp->type.node_class != etree_provide) exp_fold_tree (tree, osec, &print_dot); else - expld.result.valid_p = FALSE; + expld.result.valid_p = false; if (expld.result.valid_p) { @@ -4683,7 +4682,7 @@ print_assignment (lang_assignment_statement_type *assignment, struct bfd_link_hash_entry *h; h = bfd_link_hash_lookup (link_info.hash, assignment->exp->assign.dst, - FALSE, FALSE, TRUE); + false, false, true); if (h != NULL && (h->type == bfd_link_hash_defined || h->type == bfd_link_hash_defweak)) @@ -4725,7 +4724,7 @@ print_input_statement (lang_input_statement_type *statm) /* Print all symbols defined in a particular section. This is called via bfd_link_hash_traverse, or by print_all_symbols. */ -bfd_boolean +bool print_one_symbol (struct bfd_link_hash_entry *hash_entry, void *ptr) { asection *sec = (asection *) ptr; @@ -4746,7 +4745,7 @@ print_one_symbol (struct bfd_link_hash_entry *hash_entry, void *ptr) minfo (" %pT\n", hash_entry->root.string); } - return TRUE; + return true; } static int @@ -4797,7 +4796,7 @@ print_all_symbols (asection *sec) /* Print information about an input section to the map file. */ static void -print_input_section (asection *i, bfd_boolean is_discarded) +print_input_section (asection *i, bool is_discarded) { bfd_size_type size = i->size; int len; @@ -5169,7 +5168,7 @@ print_statement (lang_statement_union_type *s, print_reloc_statement (&s->reloc_statement); break; case lang_input_section_enum: - print_input_section (s->input_section.section, FALSE); + print_input_section (s->input_section.section, false); break; case lang_padding_statement_enum: print_padding_statement (&s->padding_statement); @@ -5286,7 +5285,7 @@ size_input_section (lang_statement_union_type **this_ptr, lang_output_section_statement_type *output_section_statement, fill_type *fill, - bfd_boolean *removed, + bool *removed, bfd_vma dot) { lang_input_section_type *is = &((*this_ptr)->input_section); @@ -5391,7 +5390,7 @@ size_input_section struct check_sec { asection *sec; - bfd_boolean warned; + bool warned; }; static int @@ -5453,7 +5452,7 @@ lang_check_section_addresses (void) bfd_vma p_start = 0; bfd_vma p_end = 0; lang_memory_region_type *m; - bfd_boolean overlays; + bool overlays; /* Detect address space overflow on allocated sections. */ addr_mask = ((bfd_vma) 1 << @@ -5490,7 +5489,7 @@ lang_check_section_addresses (void) continue; sections[count].sec = s; - sections[count].warned = FALSE; + sections[count].warned = false; count++; } @@ -5525,7 +5524,7 @@ lang_check_section_addresses (void) einfo (_("%X%P: section %s LMA [%V,%V]" " overlaps section %s LMA [%V,%V]\n"), s->name, s_start, s_end, p->name, p_start, p_end); - sections[i].warned = TRUE; + sections[i].warned = true; } p = s; p_start = s_start; @@ -5539,14 +5538,14 @@ lang_check_section_addresses (void) this property. It is possible to intentionally generate overlays that fail this test, but it would be unusual. */ qsort (sections, count, sizeof (*sections), sort_sections_by_vma); - overlays = FALSE; + overlays = false; p_start = sections[0].sec->vma; for (i = 1; i < count; i++) { s_start = sections[i].sec->vma; if (p_start == s_start) { - overlays = TRUE; + overlays = true; break; } p_start = s_start; @@ -5623,7 +5622,7 @@ os_region_check (lang_output_section_statement_type *os, } else if (!region->had_full_message) { - region->had_full_message = TRUE; + region->had_full_message = true; einfo (_("%X%P: %pB section `%s' will not fit in region `%s'\n"), os->bfd_section->owner, @@ -5665,17 +5664,17 @@ lang_size_sections_1 lang_output_section_statement_type *output_section_statement, fill_type *fill, bfd_vma dot, - bfd_boolean *relax, - bfd_boolean check_regions) + bool *relax, + bool check_regions) { lang_statement_union_type *s; lang_statement_union_type *prev_s = NULL; - bfd_boolean removed_prev_s = FALSE; + bool removed_prev_s = false; /* Size up the sections from their constituent parts. */ for (s = *prev; s != NULL; prev_s = s, s = s->header.next) { - bfd_boolean removed=FALSE; + bool removed = false; switch (s->header.type) { @@ -5701,7 +5700,7 @@ lang_size_sections_1 os->addr_tree = exp_intop (0); if (os->addr_tree != NULL) { - os->processed_vma = FALSE; + os->processed_vma = false; exp_fold_tree (os->addr_tree, bfd_abs_section_ptr, &dot); if (expld.result.valid_p) @@ -5845,7 +5844,7 @@ lang_size_sections_1 lang_size_sections_1 (&os->children.head, os, os->fill, newdot, relax, check_regions); - os->processed_vma = TRUE; + os->processed_vma = true; if (bfd_is_abs_section (os->bfd_section) || os->ignored) /* Except for some special linker created sections, @@ -5873,7 +5872,7 @@ lang_size_sections_1 /* Set section lma. */ r = os->region; if (r == NULL) - r = lang_memory_region_lookup (DEFAULT_MEMORY_REGION, FALSE); + r = lang_memory_region_lookup (DEFAULT_MEMORY_REGION, false); if (os->load_base) { @@ -5944,7 +5943,7 @@ lang_size_sections_1 os->bfd_section->lma = lma; } } - os->processed_lma = TRUE; + os->processed_lma = true; /* Keep track of normal sections using the default lma region. We use this to set the lma for @@ -6102,12 +6101,12 @@ lang_size_sections_1 i = s->input_section.section; if (relax) { - bfd_boolean again; + bool again; if (!bfd_relax_section (i->owner, i, &link_info, &again)) einfo (_("%F%P: can't relax section: %E\n")); if (again) - *relax = TRUE; + *relax = true; } dot = size_input_section (prev, output_section_statement, fill, &removed, dot); @@ -6153,7 +6152,7 @@ lang_size_sections_1 /* If we don't have an output section, then just adjust the default memory address. */ lang_memory_region_lookup (DEFAULT_MEMORY_REGION, - FALSE)->current = newdot; + false)->current = newdot; } else if (newdot != dot) { @@ -6233,13 +6232,13 @@ lang_size_sections_1 the current one. */ prev_s->header.next=s->header.next; s = prev_s; - removed_prev_s = FALSE; + removed_prev_s = false; } else { /* Remove the first input section of the list. */ *prev = s->header.next; - removed_prev_s = TRUE; + removed_prev_s = true; } /* Move to next element, unless we removed the head of the @@ -6250,7 +6249,7 @@ lang_size_sections_1 else { prev = &s->header.next; - removed_prev_s = FALSE; + removed_prev_s = false; } } return dot; @@ -6261,12 +6260,12 @@ lang_size_sections_1 CURRENT_SECTION and PREVIOUS_SECTION ought to be placed into different segments. We are allowed an opportunity to override this decision. */ -bfd_boolean +bool ldlang_override_segment_assignment (struct bfd_link_info *info ATTRIBUTE_UNUSED, bfd *abfd ATTRIBUTE_UNUSED, asection *current_section, asection *previous_section, - bfd_boolean new_segment) + bool new_segment) { lang_output_section_statement_type *cur; lang_output_section_statement_type *prev; @@ -6274,7 +6273,7 @@ ldlang_override_segment_assignment (struct bfd_link_info *info ATTRIBUTE_UNUSED, /* The checks below are only necessary when the BFD library has decided that the two sections ought to be placed into the same segment. */ if (new_segment) - return TRUE; + return true; /* Paranoia checks. */ if (current_section == NULL || previous_section == NULL) @@ -6284,7 +6283,7 @@ ldlang_override_segment_assignment (struct bfd_link_info *info ATTRIBUTE_UNUSED, sections comingled in the same segment. */ if (config.separate_code && ((current_section->flags ^ previous_section->flags) & SEC_CODE)) - return TRUE; + return true; /* Find the memory regions associated with the two sections. We call lang_output_section_find() here rather than scanning the list @@ -6305,7 +6304,7 @@ ldlang_override_segment_assignment (struct bfd_link_info *info ATTRIBUTE_UNUSED, } void -one_lang_size_sections_pass (bfd_boolean *relax, bfd_boolean check_regions) +one_lang_size_sections_pass (bool *relax, bool check_regions) { lang_statement_iteration++; if (expld.phase != lang_mark_phase_enum) @@ -6314,7 +6313,7 @@ one_lang_size_sections_pass (bfd_boolean *relax, bfd_boolean check_regions) 0, 0, relax, check_regions); } -static bfd_boolean +static bool lang_size_segment (seg_align_type *seg) { /* If XXX_SEGMENT_ALIGN XXX_SEGMENT_END pair was seen, check whether @@ -6329,11 +6328,11 @@ lang_size_segment (seg_align_type *seg) && first + last <= seg->pagesize) { seg->phase = exp_seg_adjust; - return TRUE; + return true; } seg->phase = exp_seg_done; - return FALSE; + return false; } static bfd_vma @@ -6377,22 +6376,22 @@ lang_size_relro_segment_1 (seg_align_type *seg) return relro_end; } -static bfd_boolean -lang_size_relro_segment (bfd_boolean *relax, bfd_boolean check_regions) +static bool +lang_size_relro_segment (bool *relax, bool check_regions) { - bfd_boolean do_reset = FALSE; - bfd_boolean do_data_relro; + bool do_reset = false; + bool do_data_relro; bfd_vma data_initial_base, data_relro_end; if (link_info.relro && expld.dataseg.relro_end) { - do_data_relro = TRUE; + do_data_relro = true; data_initial_base = expld.dataseg.base; data_relro_end = lang_size_relro_segment_1 (&expld.dataseg); } else { - do_data_relro = FALSE; + do_data_relro = false; data_initial_base = data_relro_end = 0; } @@ -6406,18 +6405,18 @@ lang_size_relro_segment (bfd_boolean *relax, bfd_boolean check_regions) if (do_data_relro && expld.dataseg.relro_end > data_relro_end) { expld.dataseg.base = data_initial_base;; - do_reset = TRUE; + do_reset = true; } } if (!do_data_relro && lang_size_segment (&expld.dataseg)) - do_reset = TRUE; + do_reset = true; return do_reset; } void -lang_size_sections (bfd_boolean *relax, bfd_boolean check_regions) +lang_size_sections (bool *relax, bool check_regions) { expld.phase = lang_allocating_phase_enum; expld.dataseg.phase = exp_seg_none; @@ -6429,7 +6428,7 @@ lang_size_sections (bfd_boolean *relax, bfd_boolean check_regions) if (expld.dataseg.phase == exp_seg_end_seen) { - bfd_boolean do_reset + bool do_reset = lang_size_relro_segment (relax, check_regions); if (do_reset) @@ -6448,7 +6447,7 @@ lang_size_sections (bfd_boolean *relax, bfd_boolean check_regions) static lang_output_section_statement_type *current_section; static lang_assignment_statement_type *current_assign; -static bfd_boolean prefer_next_section; +static bool prefer_next_section; /* Worker function for lang_do_assignments. Recursiveness goes here. */ @@ -6457,7 +6456,7 @@ lang_do_assignments_1 (lang_statement_union_type *s, lang_output_section_statement_type *current_os, fill_type *fill, bfd_vma dot, - bfd_boolean *found_end) + bool *found_end) { for (; s != NULL; s = s->header.next) { @@ -6481,7 +6480,7 @@ lang_do_assignments_1 (lang_statement_union_type *s, if ((os->bfd_section->flags & SEC_ALLOC) != 0) { current_section = os; - prefer_next_section = FALSE; + prefer_next_section = false; } dot = os->bfd_section->vma; } @@ -6586,12 +6585,12 @@ lang_do_assignments_1 (lang_statement_union_type *s, const char *p = current_assign->exp->assign.dst; if (current_os == abs_output_section && p[0] == '.' && p[1] == 0) - prefer_next_section = TRUE; + prefer_next_section = true; while (*p == '_') ++p; if (strcmp (p, "end") == 0) - *found_end = TRUE; + *found_end = true; } exp_fold_tree (s->assignment_statement.exp, (current_os->bfd_section != NULL @@ -6625,10 +6624,10 @@ lang_do_assignments_1 (lang_statement_union_type *s, void lang_do_assignments (lang_phase_type phase) { - bfd_boolean found_end = FALSE; + bool found_end = false; current_section = NULL; - prefer_next_section = FALSE; + prefer_next_section = false; expld.phase = phase; lang_statement_iteration++; lang_do_assignments_1 (statement_list.head, @@ -6830,7 +6829,7 @@ undef_start_stop (struct bfd_link_hash_entry *h) unsigned int was_forced = eh->forced_local; bed = get_elf_backend_data (link_info.output_bfd); - (*bed->elf_backend_hide_symbol) (&link_info, eh, TRUE); + (*bed->elf_backend_hide_symbol) (&link_info, eh, true); if (!eh->ref_regular_nonweak) h->type = bfd_link_hash_undefweak; eh->def_regular = 0; @@ -6912,13 +6911,13 @@ static void lang_end (void) { struct bfd_link_hash_entry *h; - bfd_boolean warn; + bool warn; if ((bfd_link_relocatable (&link_info) && !link_info.gc_sections) || bfd_link_dll (&link_info)) warn = entry_from_cmdline; else - warn = TRUE; + warn = true; /* Force the user to specify a root when generating a relocatable with --gc-sections, unless --gc-keep-exported was also given. */ @@ -6931,7 +6930,7 @@ lang_end (void) for (sym = link_info.gc_sym_list; sym != NULL; sym = sym->next) { h = bfd_link_hash_lookup (link_info.hash, sym->name, - FALSE, FALSE, FALSE); + false, false, false); if (h != NULL && (h->type == bfd_link_hash_defined || h->type == bfd_link_hash_defweak) @@ -6948,11 +6947,11 @@ lang_end (void) /* No entry has been specified. Look for the default entry, but don't warn if we don't find it. */ entry_symbol.name = entry_symbol_default; - warn = FALSE; + warn = false; } h = bfd_link_hash_lookup (link_info.hash, entry_symbol.name, - FALSE, FALSE, TRUE); + false, false, true); if (h != NULL && (h->type == bfd_link_hash_defined || h->type == bfd_link_hash_defweak) @@ -7140,7 +7139,7 @@ lang_common (void) /* Place one common symbol in the correct section. */ -static bfd_boolean +static bool lang_one_common (struct bfd_link_hash_entry *h, void *info) { unsigned int power_of_two; @@ -7148,17 +7147,17 @@ lang_one_common (struct bfd_link_hash_entry *h, void *info) asection *section; if (h->type != bfd_link_hash_common) - return TRUE; + return true; size = h->u.c.size; power_of_two = h->u.c.p->alignment_power; if (config.sort_common == sort_descending && power_of_two < *(unsigned int *) info) - return TRUE; + return true; else if (config.sort_common == sort_ascending && power_of_two > *(unsigned int *) info) - return TRUE; + return true; section = h->u.c.p->section; if (!bfd_define_common_symbol (link_info.output_bfd, &link_info, h)) @@ -7167,7 +7166,7 @@ lang_one_common (struct bfd_link_hash_entry *h, void *info) if (config.map_file != NULL) { - static bfd_boolean header_printed; + static bool header_printed; int len; char *name; char buf[50]; @@ -7176,7 +7175,7 @@ lang_one_common (struct bfd_link_hash_entry *h, void *info) { minfo (_("\nAllocating common symbols\n")); minfo (_("Common symbol size file\n\n")); - header_printed = TRUE; + header_printed = true; } name = bfd_demangle (link_info.output_bfd, h->root.string, @@ -7221,7 +7220,7 @@ lang_one_common (struct bfd_link_hash_entry *h, void *info) minfo ("%pB\n", section->owner); } - return TRUE; + return true; } /* Handle a single orphan section S, placing the orphan into an appropriate @@ -7429,7 +7428,7 @@ lang_add_output (const char *name, int from_script) if (!had_output_filename || !from_script) { output_filename = name; - had_output_filename = TRUE; + had_output_filename = true; } } @@ -7503,8 +7502,8 @@ lang_reset_memory_regions (void) os != NULL; os = os->next) { - os->processed_vma = FALSE; - os->processed_lma = FALSE; + os->processed_vma = false; + os->processed_lma = false; } for (o = link_info.output_bfd->sections; o != NULL; o = o->next) @@ -7604,8 +7603,8 @@ find_relro_section_callback (lang_wild_statement_type *ptr ATTRIBUTE_UNUSED, && !IGNORE_SECTION (section) && section->size != 0) { - bfd_boolean *has_relro_section = (bfd_boolean *) data; - *has_relro_section = TRUE; + bool *has_relro_section = (bool *) data; + *has_relro_section = true; } } @@ -7614,7 +7613,7 @@ find_relro_section_callback (lang_wild_statement_type *ptr ATTRIBUTE_UNUSED, static void lang_find_relro_sections_1 (lang_statement_union_type *s, seg_align_type *seg, - bfd_boolean *has_relro_section) + bool *has_relro_section) { if (*has_relro_section) return; @@ -7652,7 +7651,7 @@ lang_find_relro_sections_1 (lang_statement_union_type *s, static void lang_find_relro_sections (void) { - bfd_boolean has_relro_section = FALSE; + bool has_relro_section = false; /* Check all sections in the link script. */ @@ -7660,13 +7659,13 @@ lang_find_relro_sections (void) &expld.dataseg, &has_relro_section); if (!has_relro_section) - link_info.relro = FALSE; + link_info.relro = false; } /* Relax all sections until bfd_relax_section gives up. */ void -lang_relax_sections (bfd_boolean need_layout) +lang_relax_sections (bool need_layout) { if (RELAXATION_ENABLED) { @@ -7679,7 +7678,7 @@ lang_relax_sections (bfd_boolean need_layout) while (i--) { /* Keep relaxing until bfd_relax_section gives up. */ - bfd_boolean relax_again; + bool relax_again; link_info.relax_trip = -1; do @@ -7700,14 +7699,14 @@ lang_relax_sections (bfd_boolean need_layout) /* Perform another relax pass - this time we know where the globals are, so can make a better guess. */ - relax_again = FALSE; - lang_size_sections (&relax_again, FALSE); + relax_again = false; + lang_size_sections (&relax_again, false); } while (relax_again); link_info.relax_pass++; } - need_layout = TRUE; + need_layout = true; } if (need_layout) @@ -7715,7 +7714,7 @@ lang_relax_sections (bfd_boolean need_layout) /* Final extra sizing to report errors. */ lang_do_assignments (lang_assigning_phase_enum); lang_reset_memory_regions (); - lang_size_sections (NULL, TRUE); + lang_size_sections (NULL, true); } } @@ -7732,7 +7731,7 @@ lang_relax_sections (bfd_boolean need_layout) inserted at the head of the file_chain. */ static lang_input_statement_type * -find_replacements_insert_point (bfd_boolean *before) +find_replacements_insert_point (bool *before) { lang_input_statement_type *claim1, *lastobject; lastobject = (void *) input_file_chain.head; @@ -7752,7 +7751,7 @@ find_replacements_insert_point (bfd_boolean *before) /* No files were claimed by the plugin. Choose the last object file found on the list (maybe the first, dummy entry) as the insert point. */ - *before = FALSE; + *before = false; return lastobject; } @@ -7895,7 +7894,7 @@ lang_check_relocs (void) if (!bfd_link_check_relocs (abfd, &link_info)) { /* No object output, fail return. */ - config.make_executable = FALSE; + config.make_executable = false; /* Note: we do not abort the loop, but rather continue the scan in case there are other bad relocations to report. */ @@ -7951,7 +7950,7 @@ lang_process (void) means that when we call open_input_bfds PROVIDE statements will trigger to provide any needed symbols. The regions origins and lengths are not assigned as a result of this call. */ - lang_do_memory_regions (FALSE); + lang_do_memory_regions (false); /* Create a bfd for each input file. */ current_target = default_target; @@ -7960,7 +7959,7 @@ lang_process (void) /* Now that open_input_bfds has processed assignments and provide statements we can give values to symbolic origin/length now. */ - lang_do_memory_regions (TRUE); + lang_do_memory_regions (true); #if BFD_SUPPORTS_PLUGINS if (link_info.lto_plugin_active) @@ -7981,7 +7980,7 @@ lang_process (void) if (plugin_call_all_symbols_read ()) einfo (_("%F%P: %s: plugin reported error after all symbols read\n"), plugin_error_plugin ()); - link_info.lto_all_symbols_read = TRUE; + link_info.lto_all_symbols_read = true; /* Open any newly added files, updating the file chains. */ plugin_undefs = link_info.hash->undefs_tail; open_input_bfds (*added.tail, OPEN_BFD_NORMAL); @@ -7999,7 +7998,7 @@ lang_process (void) after the first input file that was claimed by the plugin, unless that file was an archive in which case it is inserted immediately before. */ - bfd_boolean before; + bool before; lang_statement_union_type **prev; plugin_insert = find_replacements_insert_point (&before); /* If a plugin adds input files without having claimed any, we @@ -8249,7 +8248,7 @@ lang_process (void) void lang_add_wild (struct wildcard_spec *filespec, struct wildcard_list *section_list, - bfd_boolean keep_sections) + bool keep_sections) { struct wildcard_list *curr, *next; lang_wild_statement_type *new_stmt; @@ -8268,12 +8267,12 @@ lang_add_wild (struct wildcard_spec *filespec, if (strcmp (filespec->name, "*") == 0) filespec->name = NULL; else if (!wildcardp (filespec->name)) - lang_has_input_file = TRUE; + lang_has_input_file = true; } new_stmt = new_stat (lang_wild_statement, stat_ptr); new_stmt->filename = NULL; - new_stmt->filenames_sorted = FALSE; + new_stmt->filenames_sorted = false; new_stmt->section_flag_list = NULL; new_stmt->exclude_name_list = NULL; if (filespec != NULL) @@ -8307,7 +8306,7 @@ lang_section_start (const char *name, etree_type *address, precedence. */ void -lang_add_entry (const char *name, bfd_boolean cmdline) +lang_add_entry (const char *name, bool cmdline) { if (entry_symbol.name == NULL || cmdline @@ -8345,7 +8344,7 @@ lang_add_map (const char *name) switch (*name) { case 'F': - map_option_f = TRUE; + map_option_f = true; break; } name++; @@ -8423,11 +8422,11 @@ lang_startup (const char *name) } first_file->filename = name; first_file->local_sym_name = name; - first_file->flags.real = TRUE; + first_file->flags.real = true; } void -lang_float (bfd_boolean maybe) +lang_float (bool maybe) { lang_float_flag = maybe; } @@ -8449,10 +8448,10 @@ lang_get_regions (lang_memory_region_type **region, lang_memory_region_type **lma_region, const char *memspec, const char *lma_memspec, - bfd_boolean have_lma, - bfd_boolean have_vma) + bool have_lma, + bool have_vma) { - *lma_region = lang_memory_region_lookup (lma_memspec, FALSE); + *lma_region = lang_memory_region_lookup (lma_memspec, false); /* If no runtime region or VMA has been specified, but the load region has been specified, then use the load region for the runtime region @@ -8462,7 +8461,7 @@ lang_get_regions (lang_memory_region_type **region, && strcmp (memspec, DEFAULT_MEMORY_REGION) == 0) *region = *lma_region; else - *region = lang_memory_region_lookup (memspec, FALSE); + *region = lang_memory_region_lookup (memspec, false); if (have_lma && lma_memspec != 0) einfo (_("%X%P:%pS: section has both a load address and a load region\n"), @@ -8547,13 +8546,13 @@ lang_leave_group (void) void lang_new_phdr (const char *name, etree_type *type, - bfd_boolean filehdr, - bfd_boolean phdrs, + bool filehdr, + bool phdrs, etree_type *at, etree_type *flags) { struct lang_phdr *n, **pp; - bfd_boolean hdrs; + bool hdrs; n = stat_alloc (sizeof (struct lang_phdr)); n->next = NULL; @@ -8573,7 +8572,7 @@ lang_new_phdr (const char *name, { einfo (_("%X%P:%pS: PHDRS and FILEHDR are not supported" " when prior PT_LOAD headers lack them\n"), NULL); - hdrs = FALSE; + hdrs = false; } *pp = n; @@ -8664,7 +8663,7 @@ lang_record_phdrs (void) } secs[c] = os->bfd_section; ++c; - pl->used = TRUE; + pl->used = true; } } } @@ -8717,11 +8716,11 @@ lang_add_nocrossref (lang_nocrossref_type *l) n = (struct lang_nocrossrefs *) xmalloc (sizeof *n); n->next = nocrossref_list; n->list = l; - n->onlyfirst = FALSE; + n->onlyfirst = false; nocrossref_list = n; /* Set notice_all so that we get informed about all symbols. */ - link_info.notice_all = TRUE; + link_info.notice_all = true; } /* Record a section that cannot be referenced from a list of sections. */ @@ -8730,7 +8729,7 @@ void lang_add_nocrossref_to (lang_nocrossref_type *l) { lang_add_nocrossref (l); - nocrossref_list->onlyfirst = TRUE; + nocrossref_list->onlyfirst = true; } /* Overlay handling. We handle overlays with some static variables. */ @@ -8833,7 +8832,7 @@ lang_leave_overlay_section (fill_type *fill, sprintf (buf, "__load_start_%s", clean); lang_add_assignment (exp_provide (buf, exp_nameop (LOADADDR, name), - FALSE)); + false)); buf = (char *) xmalloc (strlen (clean) + sizeof "__load_stop_"); sprintf (buf, "__load_stop_%s", clean); @@ -8841,7 +8840,7 @@ lang_leave_overlay_section (fill_type *fill, exp_binop ('+', exp_nameop (LOADADDR, name), exp_nameop (SIZEOF, name)), - FALSE)); + false)); free (clean); } @@ -8864,7 +8863,7 @@ lang_leave_overlay (etree_type *lma_expr, lang_get_regions (®ion, &lma_region, memspec, lma_memspec, - lma_expr != NULL, FALSE); + lma_expr != NULL, false); nocrossref = NULL; @@ -8874,7 +8873,7 @@ lang_leave_overlay (etree_type *lma_expr, { overlay_list->os->update_dot = 1; overlay_list->os->update_dot_tree - = exp_assign (".", exp_binop ('+', overlay_vma, overlay_max), FALSE); + = exp_assign (".", exp_binop ('+', overlay_vma, overlay_max), false); } l = overlay_list; @@ -9054,7 +9053,7 @@ static const char * realsymbol (const char *pattern) { const char *p; - bfd_boolean changed = FALSE, backslash = FALSE; + bool changed = false, backslash = false; char *s, *symbol = (char *) xmalloc (strlen (pattern) + 1); for (p = pattern, s = symbol; *p != '\0'; ++p) @@ -9065,8 +9064,8 @@ realsymbol (const char *pattern) { /* Remove the preceding backslash. */ *(s - 1) = *p; - backslash = FALSE; - changed = TRUE; + backslash = false; + changed = true; } else { @@ -9101,7 +9100,7 @@ struct bfd_elf_version_expr * lang_new_vers_pattern (struct bfd_elf_version_expr *orig, const char *new_name, const char *lang, - bfd_boolean literal_p) + bool literal_p) { struct bfd_elf_version_expr *ret; @@ -9109,12 +9108,12 @@ lang_new_vers_pattern (struct bfd_elf_version_expr *orig, ret->next = orig; ret->symver = 0; ret->script = 0; - ret->literal = TRUE; + ret->literal = true; ret->pattern = literal_p ? new_name : realsymbol (new_name); if (ret->pattern == NULL) { ret->pattern = new_name; - ret->literal = FALSE; + ret->literal = false; } if (lang == NULL || strcasecmp (lang, "C") == 0) @@ -9405,7 +9404,7 @@ lang_do_version_exports_section (void) p = contents; while (p < contents + len) { - greg = lang_new_vers_pattern (greg, p, NULL, FALSE); + greg = lang_new_vers_pattern (greg, p, NULL, false); p = strchr (p, '\0') + 1; } @@ -9415,7 +9414,7 @@ lang_do_version_exports_section (void) sec->flags |= SEC_EXCLUDE | SEC_KEEP; } - lreg = lang_new_vers_pattern (NULL, "*", NULL, FALSE); + lreg = lang_new_vers_pattern (NULL, "*", NULL, false); lang_register_vers_node (command_line.version_exports_section, lang_new_vers_node (greg, lreg), NULL); } @@ -9429,7 +9428,7 @@ lang_do_version_exports_section (void) data structures, and throw errors if missing symbols are encountered. */ static void -lang_do_memory_regions (bfd_boolean update_regions_p) +lang_do_memory_regions (bool update_regions_p) { lang_memory_region_type *r = lang_memory_region_list; @@ -9521,7 +9520,7 @@ lang_append_dynamic_list_cpp_typeinfo (void) for (i = 0; i < ARRAY_SIZE (symbols); i++) dynamic = lang_new_vers_pattern (dynamic, symbols [i], "C++", - FALSE); + false); lang_append_dynamic_list (&link_info.dynamic_list, dynamic); } @@ -9542,7 +9541,7 @@ lang_append_dynamic_list_cpp_new (void) for (i = 0; i < ARRAY_SIZE (symbols); i++) dynamic = lang_new_vers_pattern (dynamic, symbols [i], "C++", - FALSE); + false); lang_append_dynamic_list (&link_info.dynamic_list, dynamic); } @@ -9568,7 +9567,7 @@ lang_ld_feature (char *str) sep = *q; *q = 0; if (strcasecmp (p, "SANE_EXPR") == 0) - config.sane_expr = TRUE; + config.sane_expr = true; else einfo (_("%X%P: unknown feature `%s'\n"), p); *q = sep; diff --git a/ld/ldlang.h b/ld/ldlang.h index 3463d4ca0cc..6fbe16d97d9 100644 --- a/ld/ldlang.h +++ b/ld/ldlang.h @@ -65,7 +65,7 @@ typedef struct memory_region_struct union lang_statement_union *last_os; flagword flags; flagword not_flags; - bfd_boolean had_full_message; + bool had_full_message; } lang_memory_region_type; enum statement_enum @@ -131,7 +131,7 @@ typedef struct lang_output_section_phdr_list { struct lang_output_section_phdr_list *next; const char *name; - bfd_boolean used; + bool used; } lang_output_section_phdr_list; typedef struct lang_output_section_statement_struct @@ -343,7 +343,7 @@ typedef struct input_section_userdata_struct unsigned long map_symbol_def_count; } input_section_userdata_type; -static inline bfd_boolean +static inline bool bfd_input_just_syms (const bfd *abfd) { lang_input_statement_type *is = bfd_usrdata (abfd); @@ -360,8 +360,8 @@ typedef void (*walk_wild_section_handler_t) (lang_wild_statement_type *, callback_t callback, void *data); -typedef bfd_boolean (*lang_match_sec_type_func) (bfd *, const asection *, - bfd *, const asection *); +typedef bool (*lang_match_sec_type_func) (bfd *, const asection *, + bfd *, const asection *); /* Binary search tree structure to efficiently sort sections by name. */ @@ -377,9 +377,9 @@ struct lang_wild_statement_struct { lang_statement_header_type header; const char *filename; - bfd_boolean filenames_sorted; + bool filenames_sorted; struct wildcard_list *section_list; - bfd_boolean keep_sections; + bool keep_sections; lang_statement_list_type children; struct name_list *exclude_name_list; @@ -421,7 +421,7 @@ typedef struct { lang_statement_header_type header; const char *where; - bfd_boolean is_before; + bool is_before; } lang_insert_statement_type; typedef union lang_statement_union @@ -451,8 +451,8 @@ struct lang_phdr struct lang_phdr *next; const char *name; unsigned long type; - bfd_boolean filehdr; - bfd_boolean phdrs; + bool filehdr; + bool phdrs; etree_type *at; etree_type *flags; }; @@ -472,7 +472,7 @@ struct lang_nocrossrefs { struct lang_nocrossrefs *next; lang_nocrossref_type *list; - bfd_boolean onlyfirst; + bool onlyfirst; }; /* This structure is used to hold a list of input section names which @@ -510,14 +510,14 @@ extern const char *output_target; extern lang_output_section_statement_type *abs_output_section; extern lang_statement_list_type lang_os_list; extern struct lang_input_statement_flags input_flags; -extern bfd_boolean lang_has_input_file; +extern bool lang_has_input_file; extern lang_statement_list_type statement_list; extern lang_statement_list_type *stat_ptr; -extern bfd_boolean delete_output_file_on_failure; +extern bool delete_output_file_on_failure; extern struct bfd_sym_chain entry_symbol; extern const char *entry_section; -extern bfd_boolean entry_from_cmdline; +extern bool entry_from_cmdline; extern lang_statement_list_type file_chain; extern lang_statement_list_type input_file_chain; @@ -533,7 +533,7 @@ extern void lang_init extern void lang_finish (void); extern lang_memory_region_type * lang_memory_region_lookup - (const char * const, bfd_boolean); + (const char * const, bool); extern void lang_memory_region_alias (const char *, const char *); extern void lang_map @@ -548,19 +548,19 @@ extern lang_output_section_statement_type *lang_enter_output_section_statement extern void lang_final (void); extern void lang_relax_sections - (bfd_boolean); + (bool); extern void lang_process (void); extern void lang_section_start (const char *, union etree_union *, const segment_type *); extern void lang_add_entry - (const char *, bfd_boolean); + (const char *, bool); extern void lang_default_entry (const char *); extern void lang_add_target (const char *); extern void lang_add_wild - (struct wildcard_spec *, struct wildcard_list *, bfd_boolean); + (struct wildcard_spec *, struct wildcard_list *, bool); extern void lang_add_map (const char *); extern void lang_add_fill @@ -572,7 +572,7 @@ extern void lang_add_attribute extern void lang_startup (const char *); extern void lang_float - (bfd_boolean); + (bool); extern void lang_leave_output_section_statement (fill_type *, const char *, lang_output_section_phdr_list *, const char *); @@ -617,7 +617,7 @@ extern lang_output_section_statement_type *lang_output_section_statement_lookup extern lang_output_section_statement_type *next_matching_output_section_statement (lang_output_section_statement_type *, int); extern void ldlang_add_undef - (const char *const, bfd_boolean); + (const char *const, bool); extern void ldlang_add_require_defined (const char *const); extern void lang_add_output_format @@ -646,9 +646,9 @@ extern void lang_clear_os_map extern void dprint_statement (lang_statement_union_type *, int); extern void lang_size_sections - (bfd_boolean *, bfd_boolean); + (bool *, bool); extern void one_lang_size_sections_pass - (bfd_boolean *, bfd_boolean); + (bool *, bool); extern void lang_add_insert (const char *, int); extern void lang_enter_group @@ -659,7 +659,7 @@ extern void lang_add_section (lang_statement_list_type *, asection *, struct wildcard_list *, struct flag_info *, lang_output_section_statement_type *); extern void lang_new_phdr - (const char *, etree_type *, bfd_boolean, bfd_boolean, etree_type *, + (const char *, etree_type *, bool, bool, etree_type *, etree_type *); extern void lang_add_nocrossref (lang_nocrossref_type *); @@ -676,7 +676,7 @@ extern void lang_leave_overlay lang_output_section_phdr_list *, const char *); extern struct bfd_elf_version_expr *lang_new_vers_pattern - (struct bfd_elf_version_expr *, const char *, const char *, bfd_boolean); + (struct bfd_elf_version_expr *, const char *, const char *, bool); extern struct bfd_elf_version_tree *lang_new_vers_node (struct bfd_elf_version_expr *, struct bfd_elf_version_expr *); extern struct bfd_elf_version_deps *lang_add_vers_depend @@ -692,7 +692,7 @@ extern void lang_add_unique extern const char *lang_get_output_target (void); extern void add_excluded_libs (const char *); -extern bfd_boolean load_symbols +extern bool load_symbols (lang_input_statement_type *, lang_statement_list_type *); struct elf_sym_strtab; @@ -703,9 +703,9 @@ extern void ldlang_ctf_new_dynsym (int symidx, struct elf_internal_sym *); extern void ldlang_write_ctf_late (void); -extern bfd_boolean +extern bool ldlang_override_segment_assignment - (struct bfd_link_info *, bfd *, asection *, asection *, bfd_boolean); + (struct bfd_link_info *, bfd *, asection *, asection *, bool); extern void lang_ld_feature (char *); @@ -716,7 +716,7 @@ lang_print_memory_usage (void); extern void lang_add_gc_name (const char *); -extern bfd_boolean +extern bool print_one_symbol (struct bfd_link_hash_entry *hash_entry, void *ptr); #endif diff --git a/ld/ldmain.c b/ld/ldmain.c index aa52205daf4..b99d518ea31 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -60,7 +60,7 @@ FILE *saved_script_handle = NULL; FILE *previous_script_handle = NULL; -bfd_boolean force_make_executable = FALSE; +bool force_make_executable = false; char *default_target; const char *output_filename = "a.out"; @@ -82,14 +82,14 @@ int g_switch_value = 8; unsigned int trace_files; /* Nonzero means report actions taken by the linker, and describe the linker script in use. */ -bfd_boolean verbose; +bool verbose; /* Nonzero means version number was printed, so exit successfully instead of complaining if no input files are given. */ -bfd_boolean version_printed; +bool version_printed; /* TRUE if we should demangle symbol names. */ -bfd_boolean demangling; +bool demangling; args_type command_line; @@ -101,7 +101,7 @@ static const char *get_sysroot (int, char **); static char *get_emulation (int, char **); -static bfd_boolean add_archive_element +static bool add_archive_element (struct bfd_link_info *, bfd *, const char *, bfd **); static void multiple_definition (struct bfd_link_info *, struct bfd_link_hash_entry *, @@ -113,7 +113,7 @@ static void add_to_set (struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_reloc_code_real_type, bfd *, asection *, bfd_vma); static void constructor_callback - (struct bfd_link_info *, bfd_boolean, const char *, bfd *, + (struct bfd_link_info *, bool, const char *, bfd *, asection *, bfd_vma); static void warning_callback (struct bfd_link_info *, const char *, const char *, bfd *, @@ -122,7 +122,7 @@ static void warning_find_reloc (bfd *, asection *, void *); static void undefined_symbol (struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma, - bfd_boolean); + bool); static void reloc_overflow (struct bfd_link_info *, struct bfd_link_hash_entry *, const char *, const char *, bfd_vma, bfd *, asection *, bfd_vma); @@ -130,7 +130,7 @@ static void reloc_dangerous (struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma); static void unattached_reloc (struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma); -static bfd_boolean notice +static bool notice (struct bfd_link_info *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *, bfd *, asection *, bfd_vma, flagword); @@ -226,7 +226,7 @@ static void ld_bfd_assert_handler (const char *fmt, const char *bfdver, const char *file, int line) { - config.make_executable = FALSE; + config.make_executable = false; (*default_bfd_assert_handler) (fmt, bfdver, file, line); } @@ -236,7 +236,7 @@ static void ld_bfd_error_handler (const char *fmt, va_list ap) { if (config.fatal_warnings) - config.make_executable = FALSE; + config.make_executable = false; (*default_bfd_error_handler) (fmt, ap); } @@ -310,18 +310,18 @@ main (int argc, char **argv) } #endif - config.build_constructors = TRUE; + config.build_constructors = true; config.rpath_separator = ':'; config.split_by_reloc = (unsigned) -1; config.split_by_file = (bfd_size_type) -1; - config.make_executable = TRUE; - config.magic_demand_paged = TRUE; - config.text_read_only = TRUE; - config.print_map_discarded = TRUE; + config.make_executable = true; + config.magic_demand_paged = true; + config.text_read_only = true; + config.print_map_discarded = true; link_info.disable_target_specific_optimizations = -1; - command_line.warn_mismatch = TRUE; - command_line.warn_search_mismatch = TRUE; + command_line.warn_mismatch = true; + command_line.warn_search_mismatch = true; command_line.check_section_addresses = -1; /* We initialize DEMANGLING based on the environment variable @@ -331,11 +331,11 @@ main (int argc, char **argv) interface by default. */ demangling = getenv ("COLLECT_NO_DEMANGLE") == NULL; - link_info.allow_undefined_version = TRUE; - link_info.keep_memory = TRUE; - link_info.combreloc = TRUE; - link_info.strip_discarded = TRUE; - link_info.prohibit_multiple_definition_absolute = FALSE; + link_info.allow_undefined_version = true; + link_info.keep_memory = true; + link_info.combreloc = true; + link_info.strip_discarded = true; + link_info.prohibit_multiple_definition_absolute = false; link_info.textrel_check = DEFAULT_LD_TEXTREL_CHECK; link_info.emit_hash = DEFAULT_EMIT_SYSV_HASH; link_info.emit_gnu_hash = DEFAULT_EMIT_GNU_HASH; @@ -357,7 +357,7 @@ main (int argc, char **argv) #ifdef DEFAULT_NEW_DTAGS link_info.new_dtags = DEFAULT_NEW_DTAGS; #endif - link_info.start_stop_gc = FALSE; + link_info.start_stop_gc = false; link_info.start_stop_visibility = STV_PROTECTED; ldfile_add_arch (""); @@ -367,7 +367,7 @@ main (int argc, char **argv) lang_init (); ldexp_init (); ldemul_before_parse (); - lang_has_input_file = FALSE; + lang_has_input_file = false; parse_args (argc, argv); if (config.hash_table_size != 0) @@ -444,9 +444,9 @@ main (int argc, char **argv) if (command_line.force_group_allocation || !bfd_link_relocatable (&link_info)) - link_info.resolve_section_groups = TRUE; + link_info.resolve_section_groups = true; else - link_info.resolve_section_groups = FALSE; + link_info.resolve_section_groups = false; if (command_line.print_output_format) info_msg ("%s\n", lang_get_output_target ()); @@ -491,7 +491,7 @@ main (int argc, char **argv) config.map_filename); } } - link_info.has_map_file = TRUE; + link_info.has_map_file = true; } lang_process (); @@ -749,7 +749,7 @@ add_ysym (const char *name) einfo (_("%F%P: bfd_hash_table_init failed: %E\n")); } - if (bfd_hash_lookup (link_info.notice_hash, name, TRUE, TRUE) == NULL) + if (bfd_hash_lookup (link_info.notice_hash, name, true, true) == NULL) einfo (_("%F%P: bfd_hash_lookup failed: %E\n")); } @@ -766,7 +766,7 @@ add_ignoresym (struct bfd_link_info *info, const char *name) einfo (_("%F%P: bfd_hash_table_init failed: %E\n")); } - if (bfd_hash_lookup (info->ignore_hash, name, TRUE, TRUE) == NULL) + if (bfd_hash_lookup (info->ignore_hash, name, true, true) == NULL) einfo (_("%F%P: bfd_hash_lookup failed: %E\n")); } @@ -786,7 +786,7 @@ add_wrap (const char *name) einfo (_("%F%P: bfd_hash_table_init failed: %E\n")); } - if (bfd_hash_lookup (link_info.wrap_hash, name, TRUE, TRUE) == NULL) + if (bfd_hash_lookup (link_info.wrap_hash, name, true, true) == NULL) einfo (_("%F%P: bfd_hash_lookup failed: %E\n")); } @@ -844,7 +844,7 @@ add_keepsyms_file (const char *filename) buf[len] = '\0'; - if (bfd_hash_lookup (link_info.keep_hash, buf, TRUE, TRUE) == NULL) + if (bfd_hash_lookup (link_info.keep_hash, buf, true, true) == NULL) einfo (_("%F%P: bfd_hash_lookup for insertion failed: %E\n")); } } @@ -862,7 +862,7 @@ add_keepsyms_file (const char *filename) /* This is called when BFD has decided to include an archive member in a link. */ -static bfd_boolean +static bool add_archive_element (struct bfd_link_info *info, bfd *abfd, const char *name, @@ -898,9 +898,9 @@ add_archive_element (struct bfd_link_info *info, info_msg ("%pI: no new IR symbols to claim\n", &orig_input); input->flags.claimed = 0; - return FALSE; + return false; } - input->flags.claim_archive = TRUE; + input->flags.claim_archive = true; *subsbfd = input->the_bfd; } } @@ -914,7 +914,7 @@ add_archive_element (struct bfd_link_info *info, match actual symbols defined by the element. */ free (input); bfd_set_error (bfd_error_malformed_archive); - return FALSE; + return false; } /* Set the file_chain pointer of archives to the last element loaded @@ -927,16 +927,16 @@ add_archive_element (struct bfd_link_info *info, if (config.map_file != NULL) { - static bfd_boolean header_printed; + static bool header_printed; struct bfd_link_hash_entry *h; bfd *from; int len; - h = bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, TRUE); + h = bfd_link_hash_lookup (info->hash, name, false, false, true); if (h == NULL && info->pei386_auto_import && startswith (name, "__imp_")) - h = bfd_link_hash_lookup (info->hash, name + 6, FALSE, FALSE, TRUE); + h = bfd_link_hash_lookup (info->hash, name + 6, false, false, true); if (h == NULL) from = NULL; @@ -967,7 +967,7 @@ add_archive_element (struct bfd_link_info *info, if (!header_printed) { minfo (_("Archive member included to satisfy reference by file (symbol)\n\n")); - header_printed = TRUE; + header_printed = true; } if (abfd->my_archive == NULL @@ -1008,7 +1008,7 @@ add_archive_element (struct bfd_link_info *info, || trace_files > 1 || (trace_files && bfd_is_thin_archive (orig_input.the_bfd->my_archive))) info_msg ("%pI\n", &orig_input); - return TRUE; + return true; } /* This is called when BFD has discovered a symbol which is defined @@ -1233,7 +1233,7 @@ add_to_set (struct bfd_link_info *info ATTRIBUTE_UNUSED, static void constructor_callback (struct bfd_link_info *info, - bfd_boolean constructor, + bool constructor, const char *name, bfd *abfd, asection *section, @@ -1264,7 +1264,7 @@ constructor_callback (struct bfd_link_info *info, else strcpy (s, "__DTOR_LIST__"); - h = bfd_link_hash_lookup (info->hash, set_name, TRUE, TRUE, TRUE); + h = bfd_link_hash_lookup (info->hash, set_name, true, true, true); if (h == (struct bfd_link_hash_entry *) NULL) einfo (_("%F%P: bfd_link_hash_lookup failed: %E\n")); if (h->type == bfd_link_hash_new) @@ -1284,7 +1284,7 @@ constructor_callback (struct bfd_link_info *info, struct warning_callback_info { - bfd_boolean found; + bool found; const char *warning; const char *symbol; asymbol **asymbols; @@ -1293,7 +1293,7 @@ struct warning_callback_info /* Look through the relocs to see if we can find a plausible address for SYMBOL in ABFD. Return TRUE if found. Otherwise return FALSE. */ -static bfd_boolean +static bool symbol_warning (const char *warning, const char *symbol, bfd *abfd) { struct warning_callback_info cinfo; @@ -1301,7 +1301,7 @@ symbol_warning (const char *warning, const char *symbol, bfd *abfd) if (!bfd_generic_link_read_symbols (abfd)) einfo (_("%F%P: %pB: could not read symbols: %E\n"), abfd); - cinfo.found = FALSE; + cinfo.found = false; cinfo.warning = warning; cinfo.symbol = symbol; cinfo.asymbols = bfd_get_outsymbols (abfd); @@ -1383,7 +1383,7 @@ warning_find_reloc (bfd *abfd, asection *sec, void *iarg) /* We found a reloc for the symbol we are looking for. */ einfo ("%P: %C: %s%s\n", abfd, sec, q->address, _("warning: "), info->warning); - info->found = TRUE; + info->found = true; break; } } @@ -1403,7 +1403,7 @@ undefined_symbol (struct bfd_link_info *info, bfd *abfd, asection *section, bfd_vma address, - bfd_boolean error) + bool error) { static char *error_name; static unsigned int error_count; @@ -1411,7 +1411,7 @@ undefined_symbol (struct bfd_link_info *info, #define MAX_ERRORS_IN_A_ROW 5 if (info->ignore_hash != NULL - && bfd_hash_lookup (info->ignore_hash, name, FALSE, FALSE) != NULL) + && bfd_hash_lookup (info->ignore_hash, name, false, false) != NULL) return; if (config.warn_once) @@ -1616,7 +1616,7 @@ unattached_reloc (struct bfd_link_info *info ATTRIBUTE_UNUSED, linker script; and if plugins are active, since they need to monitor all references from non-IR files. */ -static bfd_boolean +static bool notice (struct bfd_link_info *info, struct bfd_link_hash_entry *h, struct bfd_link_hash_entry *inh ATTRIBUTE_UNUSED, @@ -1631,12 +1631,12 @@ notice (struct bfd_link_info *info, { if (command_line.cref || nocrossref_list != NULL) return handle_asneeded_cref (abfd, (enum notice_asneeded_action) value); - return TRUE; + return true; } name = h->root.string; if (info->notice_hash != NULL - && bfd_hash_lookup (info->notice_hash, name, FALSE, FALSE) != NULL) + && bfd_hash_lookup (info->notice_hash, name, false, false) != NULL) { if (bfd_is_und_section (section)) einfo (_("%P: %pB: reference to %s\n"), abfd, name); @@ -1647,5 +1647,5 @@ notice (struct bfd_link_info *info, if (command_line.cref || nocrossref_list != NULL) add_cref (name, abfd, section, value); - return TRUE; + return true; } diff --git a/ld/ldmain.h b/ld/ldmain.h index 38e63922d31..39d08a6c378 100644 --- a/ld/ldmain.h +++ b/ld/ldmain.h @@ -27,12 +27,12 @@ extern char *ld_canon_sysroot; extern int ld_canon_sysroot_len; extern FILE *saved_script_handle; extern FILE *previous_script_handle; -extern bfd_boolean force_make_executable; +extern bool force_make_executable; extern char *default_target; extern unsigned int trace_files; -extern bfd_boolean verbose; -extern bfd_boolean version_printed; -extern bfd_boolean demangling; +extern bool verbose; +extern bool version_printed; +extern bool demangling; extern int g_switch_value; extern const char *output_filename; extern struct bfd_link_info link_info; diff --git a/ld/ldmisc.c b/ld/ldmisc.c index 8e77f6b2b10..28b9448d8f1 100644 --- a/ld/ldmisc.c +++ b/ld/ldmisc.c @@ -66,9 +66,9 @@ */ void -vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning) +vfinfo (FILE *fp, const char *fmt, va_list ap, bool is_warning) { - bfd_boolean fatal = FALSE; + bool fatal = false; const char *scan; int arg_type; unsigned int arg_count = 0; @@ -235,7 +235,7 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning) case 'X': /* no object output, fail return */ - config.make_executable = FALSE; + config.make_executable = false; break; case 'V': @@ -291,7 +291,7 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning) case 'F': /* Error is fatal. */ - fatal = TRUE; + fatal = true; break; case 'P': @@ -321,8 +321,8 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning) const char *filename; const char *functionname; unsigned int linenumber; - bfd_boolean discard_last; - bfd_boolean done; + bool discard_last; + bool done; bfd_error_type last_bfd_error = bfd_get_error (); abfd = args[arg_no].reladdr.abfd; @@ -346,7 +346,7 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning) We do not always have a line number available so if we cannot find them we print out the section name and offset instead. */ - discard_last = TRUE; + discard_last = true; if (abfd != NULL && bfd_find_nearest_line (abfd, section, asymbols, offset, &filename, &functionname, @@ -383,7 +383,7 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning) free (last_function); last_function = xstrdup (functionname); } - discard_last = FALSE; + discard_last = false; } else lfinfo (fp, "%pB:", abfd); @@ -397,12 +397,12 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning) else if (filename != NULL && linenumber != 0) fprintf (fp, "%u%s", linenumber, done ? "" : ":"); else - done = FALSE; + done = false; } else { lfinfo (fp, "%pB:", abfd); - done = FALSE; + done = false; } if (!done) lfinfo (fp, "(%pA+0x%v)", section, offset); @@ -581,7 +581,7 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning) } if (is_warning && config.fatal_warnings) - config.make_executable = FALSE; + config.make_executable = false; if (fatal) xexit (1); @@ -598,7 +598,7 @@ info_msg (const char *fmt, ...) va_list arg; va_start (arg, fmt); - vfinfo (stdout, fmt, arg, FALSE); + vfinfo (stdout, fmt, arg, false); va_end (arg); } @@ -611,7 +611,7 @@ einfo (const char *fmt, ...) fflush (stdout); va_start (arg, fmt); - vfinfo (stderr, fmt, arg, TRUE); + vfinfo (stderr, fmt, arg, true); va_end (arg); fflush (stderr); } @@ -647,7 +647,7 @@ minfo (const char *fmt, ...) asneeded_list_tail = &m->next; } else - vfinfo (config.map_file, fmt, arg, FALSE); + vfinfo (config.map_file, fmt, arg, false); va_end (arg); } } @@ -658,7 +658,7 @@ lfinfo (FILE *file, const char *fmt, ...) va_list arg; va_start (arg, fmt); - vfinfo (file, fmt, arg, FALSE); + vfinfo (file, fmt, arg, false); va_end (arg); } diff --git a/ld/ldmisc.h b/ld/ldmisc.h index 3f1f7797b6d..3b8a13f0725 100644 --- a/ld/ldmisc.h +++ b/ld/ldmisc.h @@ -21,7 +21,7 @@ #ifndef LDMISC_H #define LDMISC_H -extern void vfinfo (FILE *fp, const char *fmt, va_list arg, bfd_boolean is_warning); +extern void vfinfo (FILE *fp, const char *fmt, va_list arg, bool is_warning); extern void einfo (const char *, ...); extern void minfo (const char *, ...); extern void info_msg (const char *, ...); diff --git a/ld/ldwrite.c b/ld/ldwrite.c index ef1d88c6ce2..73bac2e80a4 100644 --- a/ld/ldwrite.c +++ b/ld/ldwrite.c @@ -278,7 +278,7 @@ build_link_order (lang_statement_union_type *statement) /* Return true if NAME is the name of an unsplittable section. These are the stabs strings, dwarf strings. */ -static bfd_boolean +static bool unsplittable_name (const char *name) { if (startswith (name, ".stab")) @@ -287,11 +287,11 @@ unsplittable_name (const char *name) ".stab...str" */ unsigned len = strlen (name); if (strcmp (&name[len-3], "str") == 0) - return TRUE; + return true; } else if (strcmp (name, "$GDB_STRINGS$") == 0) - return TRUE; - return FALSE; + return true; + return false; } /* Wander around the input sections, make sure that @@ -339,7 +339,7 @@ clone_section (bfd *abfd, asection *s, const char *name, int *count) if ((sname = bfd_get_unique_section_name (abfd, tname, count)) == NULL || (n = bfd_make_section_anyway (abfd, sname)) == NULL || (h = bfd_link_hash_lookup (link_info.hash, - sname, TRUE, TRUE, FALSE)) == NULL) + sname, true, true, false)) == NULL) { einfo (_("%F%P: clone section failed: %E\n")); /* Silence gcc warnings. einfo exits, so we never reach here. */ diff --git a/ld/lexsup.c b/ld/lexsup.c index 51b2a3ed263..f6b6b2ec202 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -805,10 +805,10 @@ parse_args (unsigned argc, char **argv) ``use only shared libraries'' but, then, we don't currently support shared libraries on HP/UX anyhow. */ if (strcmp (optarg, "archive") == 0) - input_flags.dynamic = FALSE; + input_flags.dynamic = false; else if (strcmp (optarg, "shared") == 0 || strcmp (optarg, "default") == 0) - input_flags.dynamic = TRUE; + input_flags.dynamic = true; else einfo (_("%F%P: unrecognized -a option `%s'\n"), optarg); break; @@ -837,20 +837,20 @@ parse_args (unsigned argc, char **argv) yyparse (); break; case OPTION_CALL_SHARED: - input_flags.dynamic = TRUE; + input_flags.dynamic = true; break; case OPTION_NON_SHARED: - input_flags.dynamic = FALSE; + input_flags.dynamic = false; break; case OPTION_CREF: - command_line.cref = TRUE; - link_info.notice_all = TRUE; + command_line.cref = true; + link_info.notice_all = true; break; case 'd': - command_line.force_common_definition = TRUE; + command_line.force_common_definition = true; break; case OPTION_FORCE_GROUP_ALLOCATION: - command_line.force_group_allocation = TRUE; + command_line.force_group_allocation = true; break; case OPTION_DEFSYM: lex_string = optarg; @@ -860,7 +860,7 @@ parse_args (unsigned argc, char **argv) lex_string = NULL; break; case OPTION_DEMANGLE: - demangling = TRUE; + demangling = true; if (optarg != NULL) { enum demangling_styles style; @@ -891,23 +891,23 @@ parse_args (unsigned argc, char **argv) command_line.endian = ENDIAN_LITTLE; break; case OPTION_EMBEDDED_RELOCS: - command_line.embedded_relocs = TRUE; + command_line.embedded_relocs = true; break; case OPTION_EXPORT_DYNAMIC: case 'E': /* HP/UX compatibility. */ - link_info.export_dynamic = TRUE; + link_info.export_dynamic = true; break; case OPTION_NO_EXPORT_DYNAMIC: - link_info.export_dynamic = FALSE; + link_info.export_dynamic = false; break; case OPTION_NON_CONTIGUOUS_REGIONS: - link_info.non_contiguous_regions = TRUE; + link_info.non_contiguous_regions = true; break; case OPTION_NON_CONTIGUOUS_REGIONS_WARNINGS: - link_info.non_contiguous_regions_warnings = TRUE; + link_info.non_contiguous_regions_warnings = true; break; case 'e': - lang_add_entry (optarg, TRUE); + lang_add_entry (optarg, true); break; case 'f': if (command_line.auxiliary_filters == NULL) @@ -936,7 +936,7 @@ parse_args (unsigned argc, char **argv) command_line.filter_shlib = optarg; break; case OPTION_FORCE_EXE_SUFFIX: - command_line.force_exe_suffix = TRUE; + command_line.force_exe_suffix = true; break; case 'G': { @@ -950,20 +950,20 @@ parse_args (unsigned argc, char **argv) /* Ignore. */ break; case OPTION_GC_SECTIONS: - link_info.gc_sections = TRUE; + link_info.gc_sections = true; break; case OPTION_PRINT_GC_SECTIONS: - link_info.print_gc_sections = TRUE; + link_info.print_gc_sections = true; break; case OPTION_GC_KEEP_EXPORTED: - link_info.gc_keep_exported = TRUE; + link_info.gc_keep_exported = true; break; case OPTION_HELP: help (); xexit (0); break; case 'L': - ldfile_add_library_path (optarg, TRUE); + ldfile_add_library_path (optarg, true); break; case 'l': lang_add_input_file (optarg, lang_input_file_is_l_enum, NULL); @@ -978,35 +978,35 @@ parse_args (unsigned argc, char **argv) config.map_filename = optarg; break; case 'N': - config.text_read_only = FALSE; - config.magic_demand_paged = FALSE; - input_flags.dynamic = FALSE; + config.text_read_only = false; + config.magic_demand_paged = false; + input_flags.dynamic = false; break; case OPTION_NO_OMAGIC: - config.text_read_only = TRUE; - config.magic_demand_paged = TRUE; + config.text_read_only = true; + config.magic_demand_paged = true; /* NB/ Does not set input_flags.dynamic to TRUE. Use --call-shared or -Bdynamic for this. */ break; case 'n': - config.text_read_only = TRUE; - config.magic_demand_paged = FALSE; - input_flags.dynamic = FALSE; + config.text_read_only = true; + config.magic_demand_paged = false; + input_flags.dynamic = false; break; case OPTION_NO_DEFINE_COMMON: - link_info.inhibit_common_definition = TRUE; + link_info.inhibit_common_definition = true; break; case OPTION_NO_DEMANGLE: - demangling = FALSE; + demangling = false; break; case OPTION_NO_GC_SECTIONS: - link_info.gc_sections = FALSE; + link_info.gc_sections = false; break; case OPTION_NO_PRINT_GC_SECTIONS: - link_info.print_gc_sections = FALSE; + link_info.print_gc_sections = false; break; case OPTION_NO_KEEP_MEMORY: - link_info.keep_memory = FALSE; + link_info.keep_memory = false; break; case OPTION_NO_UNDEFINED: link_info.unresolved_syms_in_objects = RM_DIAGNOSE; @@ -1042,13 +1042,13 @@ parse_args (unsigned argc, char **argv) einfo (_("%F%P: bad --unresolved-symbols option: %s\n"), optarg); break; case OPTION_WARN_UNRESOLVED_SYMBOLS: - link_info.warn_unresolved_syms = TRUE; + link_info.warn_unresolved_syms = true; break; case OPTION_ERROR_UNRESOLVED_SYMBOLS: - link_info.warn_unresolved_syms = FALSE; + link_info.warn_unresolved_syms = false; break; case OPTION_ALLOW_MULTIPLE_DEFINITION: - link_info.allow_multiple_definition = TRUE; + link_info.allow_multiple_definition = true; break; #if SUPPORT_ERROR_HANDLING_SCRIPT @@ -1060,28 +1060,28 @@ parse_args (unsigned argc, char **argv) #endif case OPTION_NO_UNDEFINED_VERSION: - link_info.allow_undefined_version = FALSE; + link_info.allow_undefined_version = false; break; case OPTION_DEFAULT_SYMVER: - link_info.create_default_symver = TRUE; + link_info.create_default_symver = true; break; case OPTION_DEFAULT_IMPORTED_SYMVER: - link_info.default_imported_symver = TRUE; + link_info.default_imported_symver = true; break; case OPTION_NO_WARN_MISMATCH: - command_line.warn_mismatch = FALSE; + command_line.warn_mismatch = false; break; case OPTION_NO_WARN_SEARCH_MISMATCH: - command_line.warn_search_mismatch = FALSE; + command_line.warn_search_mismatch = false; break; case OPTION_NOINHIBIT_EXEC: - force_make_executable = TRUE; + force_make_executable = true; break; case OPTION_NOSTDLIB: - config.only_cmd_line_lib_dirs = TRUE; + config.only_cmd_line_lib_dirs = true; break; case OPTION_NO_WHOLE_ARCHIVE: - input_flags.whole_archive = FALSE; + input_flags.whole_archive = false; break; case 'O': /* FIXME "-O " used to set the address of @@ -1108,7 +1108,7 @@ parse_args (unsigned argc, char **argv) xexit (0); break; case OPTION_PRINT_OUTPUT_FORMAT: - command_line.print_output_format = TRUE; + command_line.print_output_format = true; break; #if BFD_SUPPORTS_PLUGINS case OPTION_PLUGIN: @@ -1120,7 +1120,7 @@ parse_args (unsigned argc, char **argv) break; #endif /* BFD_SUPPORTS_PLUGINS */ case 'q': - link_info.emitrelocations = TRUE; + link_info.emitrelocations = true; break; case 'i': case 'r': @@ -1140,10 +1140,10 @@ parse_args (unsigned argc, char **argv) bfd_link_dll (&link_info) ? "-shared" : "-pie"); link_info.type = type_relocatable; - config.build_constructors = FALSE; - config.magic_demand_paged = FALSE; - config.text_read_only = FALSE; - input_flags.dynamic = FALSE; + config.build_constructors = false; + config.magic_demand_paged = false; + config.text_read_only = false; + input_flags.dynamic = false; break; case 'R': /* The GNU linker traditionally uses -R to mean to include @@ -1234,13 +1234,13 @@ parse_args (unsigned argc, char **argv) link_info.strip = strip_all; break; case OPTION_STRIP_DISCARDED: - link_info.strip_discarded = TRUE; + link_info.strip_discarded = true; break; case OPTION_NO_STRIP_DISCARDED: - link_info.strip_discarded = FALSE; + link_info.strip_discarded = false; break; case OPTION_DISABLE_MULTIPLE_DEFS_ABS: - link_info.prohibit_multiple_definition_absolute = TRUE; + link_info.prohibit_multiple_definition_absolute = true; break; case OPTION_SHARED: if (config.has_shared) @@ -1299,7 +1299,7 @@ parse_args (unsigned argc, char **argv) optarg); break; case OPTION_STATS: - config.stats = TRUE; + config.stats = true; break; case OPTION_SYMBOLIC: opt_symbolic = symbolic; @@ -1373,10 +1373,10 @@ parse_args (unsigned argc, char **argv) set_segment_start (".ldata-segment", optarg); break; case OPTION_TRADITIONAL_FORMAT: - link_info.traditional_format = TRUE; + link_info.traditional_format = true; break; case OPTION_TASK_LINK: - link_info.task_link = TRUE; + link_info.task_link = true; /* Fall through. */ case OPTION_UR: if (bfd_link_pic (&link_info)) @@ -1384,13 +1384,13 @@ parse_args (unsigned argc, char **argv) bfd_link_dll (&link_info) ? "-shared" : "-pie"); link_info.type = type_relocatable; - config.build_constructors = TRUE; - config.magic_demand_paged = FALSE; - config.text_read_only = FALSE; - input_flags.dynamic = FALSE; + config.build_constructors = true; + config.magic_demand_paged = false; + config.text_read_only = false; + input_flags.dynamic = false; break; case 'u': - ldlang_add_undef (optarg, TRUE); + ldlang_add_undef (optarg, true); break; case OPTION_REQUIRE_DEFINED_SYMBOL: ldlang_add_require_defined (optarg); @@ -1399,12 +1399,12 @@ parse_args (unsigned argc, char **argv) if (optarg != NULL) lang_add_unique (optarg); else - config.unique_orphan_sections = TRUE; + config.unique_orphan_sections = true; break; case OPTION_VERBOSE: ldversion (1); - version_printed = TRUE; - verbose = TRUE; + version_printed = true; + verbose = true; overflow_cutoff_limit = -2; if (optarg != NULL) { @@ -1419,11 +1419,11 @@ parse_args (unsigned argc, char **argv) break; case 'v': ldversion (0); - version_printed = TRUE; + version_printed = true; break; case 'V': ldversion (1); - version_printed = TRUE; + version_printed = true; break; case OPTION_VERSION: ldversion (2); @@ -1483,7 +1483,7 @@ parse_args (unsigned argc, char **argv) { struct bfd_elf_version_expr *expr = lang_new_vers_pattern (NULL, xstrdup (optarg), NULL, - FALSE); + false); lang_append_dynamic_list (&export_list, expr); } break; @@ -1503,46 +1503,46 @@ parse_args (unsigned argc, char **argv) } break; case OPTION_WARN_COMMON: - config.warn_common = TRUE; + config.warn_common = true; break; case OPTION_WARN_CONSTRUCTORS: - config.warn_constructors = TRUE; + config.warn_constructors = true; break; case OPTION_WARN_FATAL: - config.fatal_warnings = TRUE; + config.fatal_warnings = true; break; case OPTION_NO_WARN_FATAL: - config.fatal_warnings = FALSE; + config.fatal_warnings = false; break; case OPTION_WARN_MULTIPLE_GP: - config.warn_multiple_gp = TRUE; + config.warn_multiple_gp = true; break; case OPTION_WARN_ONCE: - config.warn_once = TRUE; + config.warn_once = true; break; case OPTION_WARN_SECTION_ALIGN: - config.warn_section_align = TRUE; + config.warn_section_align = true; break; case OPTION_WARN_TEXTREL: link_info.textrel_check = textrel_check_warning; break; case OPTION_WARN_ALTERNATE_EM: - link_info.warn_alternate_em = TRUE; + link_info.warn_alternate_em = true; break; case OPTION_WHOLE_ARCHIVE: - input_flags.whole_archive = TRUE; + input_flags.whole_archive = true; break; case OPTION_ADD_DT_NEEDED_FOR_DYNAMIC: - input_flags.add_DT_NEEDED_for_dynamic = TRUE; + input_flags.add_DT_NEEDED_for_dynamic = true; break; case OPTION_NO_ADD_DT_NEEDED_FOR_DYNAMIC: - input_flags.add_DT_NEEDED_for_dynamic = FALSE; + input_flags.add_DT_NEEDED_for_dynamic = false; break; case OPTION_ADD_DT_NEEDED_FOR_REGULAR: - input_flags.add_DT_NEEDED_for_regular = TRUE; + input_flags.add_DT_NEEDED_for_regular = true; break; case OPTION_NO_ADD_DT_NEEDED_FOR_REGULAR: - input_flags.add_DT_NEEDED_for_regular = FALSE; + input_flags.add_DT_NEEDED_for_regular = false; break; case OPTION_WRAP: add_wrap (optarg); @@ -1590,10 +1590,10 @@ parse_args (unsigned argc, char **argv) command_line.check_section_addresses = 0; break; case OPTION_ACCEPT_UNKNOWN_INPUT_ARCH: - command_line.accept_unknown_input_arch = TRUE; + command_line.accept_unknown_input_arch = true; break; case OPTION_NO_ACCEPT_UNKNOWN_INPUT_ARCH: - command_line.accept_unknown_input_arch = FALSE; + command_line.accept_unknown_input_arch = false; break; case '(': lang_enter_group (); @@ -1616,7 +1616,7 @@ parse_args (unsigned argc, char **argv) break; case OPTION_REDUCE_MEMORY_OVERHEADS: - link_info.reduce_memory_overheads = TRUE; + link_info.reduce_memory_overheads = true; if (config.hash_table_size == 0) config.hash_table_size = 1021; break; @@ -1651,7 +1651,7 @@ parse_args (unsigned argc, char **argv) break; case OPTION_PRINT_MEMORY_USAGE: - command_line.print_memory_usage = TRUE; + command_line.print_memory_usage = true; break; case OPTION_ORPHAN_HANDLING: @@ -1669,11 +1669,11 @@ parse_args (unsigned argc, char **argv) break; case OPTION_NO_PRINT_MAP_DISCARDED: - config.print_map_discarded = FALSE; + config.print_map_discarded = false; break; case OPTION_PRINT_MAP_DISCARDED: - config.print_map_discarded = TRUE; + config.print_map_discarded = true; break; case OPTION_DEPENDENCY_FILE: @@ -1681,18 +1681,18 @@ parse_args (unsigned argc, char **argv) break; case OPTION_CTF_VARIABLES: - config.ctf_variables = TRUE; + config.ctf_variables = true; break; case OPTION_NO_CTF_VARIABLES: - config.ctf_variables = FALSE; + config.ctf_variables = false; break; case OPTION_CTF_SHARE_TYPES: if (strcmp (optarg, "share-unconflicted") == 0) - config.ctf_share_duplicated = FALSE; + config.ctf_share_duplicated = false; else if (strcmp (optarg, "share-duplicated") == 0) - config.ctf_share_duplicated = TRUE; + config.ctf_share_duplicated = true; else einfo (_("%F%P: bad --ctf-share-types option: %s\n"), optarg); break; @@ -1851,10 +1851,10 @@ parse_args (unsigned argc, char **argv) case dynamic_list_unset: break; case dynamic_list_data: - link_info.dynamic_data = TRUE; + link_info.dynamic_data = true; /* Fall through. */ case dynamic_list: - link_info.dynamic = TRUE; + link_info.dynamic = true; opt_symbolic = symbolic_unset; break; } @@ -1866,7 +1866,7 @@ parse_args (unsigned argc, char **argv) case symbolic_unset: break; case symbolic: - link_info.symbolic = TRUE; + link_info.symbolic = true; if (link_info.dynamic_list) { struct bfd_elf_version_expr *ent, *next; @@ -1880,8 +1880,8 @@ parse_args (unsigned argc, char **argv) } break; case symbolic_functions: - link_info.dynamic = TRUE; - link_info.dynamic_data = TRUE; + link_info.dynamic = true; + link_info.dynamic_data = true; break; } @@ -1918,7 +1918,7 @@ set_default_dirlist (char *dirlist_ptr) if (p != NULL) *p = '\0'; if (*dirlist_ptr != '\0') - ldfile_add_library_path (dirlist_ptr, TRUE); + ldfile_add_library_path (dirlist_ptr, true); if (p == NULL) break; dirlist_ptr = p + 1; @@ -1960,7 +1960,7 @@ set_segment_start (const char *section, char *valstr) seg = stat_alloc (sizeof (*seg)); seg->name = name; seg->value = val; - seg->used = FALSE; + seg->used = false; /* Add it to the linked list of segments. */ seg->next = segments; segments = seg; @@ -2149,8 +2149,7 @@ elf_plt_unwind_list_options (FILE *file) } static void -ld_list_options (FILE *file, bfd_boolean elf, bfd_boolean shlib, - bfd_boolean plt_unwind) +ld_list_options (FILE *file, bool elf, bool shlib, bool plt_unwind) { if (!elf) return; @@ -2179,12 +2178,12 @@ help (void) { if (ld_options[i].doc != NULL) { - bfd_boolean comma; + bool comma; unsigned j; printf (" "); - comma = FALSE; + comma = false; len = 2; j = i; @@ -2205,7 +2204,7 @@ help (void) printf ("%s", _(ld_options[j].arg)); len += strlen (_(ld_options[j].arg)); } - comma = TRUE; + comma = true; } ++j; } @@ -2234,7 +2233,7 @@ help (void) printf (" %s", _(ld_options[j].arg)); len += 1 + strlen (_(ld_options[j].arg)); } - comma = TRUE; + comma = true; } ++j; } diff --git a/ld/mri.c b/ld/mri.c index 3a58d930dd5..bbaf42c6c4b 100644 --- a/ld/mri.c +++ b/ld/mri.c @@ -219,7 +219,7 @@ mri_draw_tree (void) tmp->spec.exclude_name_list = NULL; tmp->spec.sorted = none; tmp->spec.section_flag_list = NULL; - lang_add_wild (NULL, tmp, FALSE); + lang_add_wild (NULL, tmp, false); /* If there is an alias for this section, add it too. */ for (aptr = alias; aptr; aptr = aptr->next) @@ -231,7 +231,7 @@ mri_draw_tree (void) tmp->spec.exclude_name_list = NULL; tmp->spec.sorted = none; tmp->spec.section_flag_list = NULL; - lang_add_wild (NULL, tmp, FALSE); + lang_add_wild (NULL, tmp, false); } lang_leave_output_section_statement (0, "*default*", NULL, NULL); @@ -294,7 +294,7 @@ mri_format (const char *name) void mri_public (const char *name, etree_type *exp) { - lang_add_assignment (exp_assign (name, exp, FALSE)); + lang_add_assignment (exp_assign (name, exp, false)); } void diff --git a/ld/pe-dll.c b/ld/pe-dll.c index 56b4375d8ce..cdb343bb98b 100644 --- a/ld/pe-dll.c +++ b/ld/pe-dll.c @@ -170,7 +170,7 @@ static struct bfd_section *edata_s, *reloc_s; static unsigned char *edata_d, *reloc_d; static size_t edata_sz, reloc_sz; static int runtime_pseudo_relocs_created = 0; -static bfd_boolean runtime_pseudp_reloc_v2_init = FALSE; +static bool runtime_pseudp_reloc_v2_init = false; typedef struct { @@ -186,7 +186,7 @@ typedef struct unsigned int imagebase_reloc; int pe_arch; int bfd_arch; - bfd_boolean underscored; + bool underscored; const autofilter_entry_type* autofilter_symbollist; } pe_details_type; @@ -264,9 +264,9 @@ static pe_details_type pe_detail_list[] = PE_ARCH_i386, bfd_arch_i386, #ifdef pe_use_x86_64 - FALSE, + false, #else - TRUE, + true, #endif autofilter_symbollist_i386 }, @@ -277,7 +277,7 @@ static pe_details_type pe_detail_list[] = 3 /* R_IMAGEBASE */, PE_ARCH_i386, bfd_arch_i386, - FALSE, + false, autofilter_symbollist_i386 }, #else @@ -287,7 +287,7 @@ static pe_details_type pe_detail_list[] = 7 /* R_IMAGEBASE */, PE_ARCH_i386, bfd_arch_i386, - TRUE, + true, autofilter_symbollist_i386 }, #endif @@ -297,7 +297,7 @@ static pe_details_type pe_detail_list[] = 16 /* R_SH_IMAGEBASE */, PE_ARCH_sh, bfd_arch_sh, - TRUE, + true, autofilter_symbollist_generic }, { @@ -306,7 +306,7 @@ static pe_details_type pe_detail_list[] = 34 /* MIPS_R_RVA */, PE_ARCH_mips, bfd_arch_mips, - FALSE, + false, autofilter_symbollist_generic }, { @@ -315,7 +315,7 @@ static pe_details_type pe_detail_list[] = 11 /* ARM_RVA32 */, PE_ARCH_arm, bfd_arch_arm, - TRUE, + true, autofilter_symbollist_generic }, { @@ -324,10 +324,10 @@ static pe_details_type pe_detail_list[] = 2, /* ARM_RVA32 on Windows CE, see bfd/coff-arm.c. */ PE_ARCH_arm_wince, bfd_arch_arm, - FALSE, + false, autofilter_symbollist_generic }, - { NULL, NULL, 0, 0, 0, FALSE, NULL } + { NULL, NULL, 0, 0, 0, false, NULL } }; static const pe_details_type *pe_details; @@ -542,7 +542,7 @@ pe_dll_add_excludes (const char *new_excludes, const exclude_type type) free (local_copy); } -static bfd_boolean +static bool is_import (const char* n) { return (startswith (n, "__imp_")); @@ -674,7 +674,7 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info * bfd *b; struct bfd_section *s; def_file_export *e = 0; - bfd_boolean resort_needed; + bool resort_needed; if (!pe_def_file) pe_def_file = def_file_empty (); @@ -707,7 +707,7 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info * { struct coff_link_hash_entry *sym_hash; sym_hash = coff_link_hash_lookup (coff_hash_table (info), - ac->symbol_name, FALSE, FALSE, FALSE); + ac->symbol_name, false, false, false); if (sym_hash && sym_hash->root.type == bfd_link_hash_common && sym_hash->root.u.c.p->alignment_power < (unsigned) ac->alignment) { @@ -746,7 +746,7 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info * /* We should export symbols which are either global or not anything at all. (.bss data is the latter) We should not export undefined symbols. */ - bfd_boolean would_export + bool would_export = (symbols[j]->section != bfd_und_section_ptr && ((symbols[j]->flags & BSF_GLOBAL) || (symbols[j]->flags == 0))); @@ -768,7 +768,7 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info * sprintf (name, "%s%s", "__imp_", sn); blhe = bfd_link_hash_lookup (info->hash, name, - FALSE, FALSE, FALSE); + false, false, false); free (name); if (blhe && blhe->type == bfd_link_hash_defined) @@ -801,7 +801,7 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info * if (NE == 0) return; - resort_needed = FALSE; + resort_needed = false; /* Canonicalize the export list. */ if (pe_dll_kill_ats) @@ -826,7 +826,7 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info * einfo (_("%X%P: cannot export %s: invalid export name\n"), pe_def_file->exports[i].name); pe_def_file->exports[i].name = tmp; - resort_needed = TRUE; + resort_needed = true; } } } @@ -937,7 +937,7 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info * blhe = bfd_link_hash_lookup (info->hash, name, - FALSE, FALSE, TRUE); + false, false, true); if (blhe && (blhe->type == bfd_link_hash_defined @@ -1186,7 +1186,7 @@ fill_exported_offsets (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info) blhe = bfd_link_hash_lookup (info->hash, name, - FALSE, FALSE, TRUE); + false, false, true); if (blhe && blhe->type == bfd_link_hash_defined) exported_symbol_offsets[i] = blhe->u.def.value; @@ -1342,7 +1342,7 @@ pe_walk_relocs (struct bfd_link_info *info, /* Warning: the callback needs to be passed NAME directly. */ if (import_hash) { - if (bfd_hash_lookup (import_hash, sym->name, FALSE, FALSE)) + if (bfd_hash_lookup (import_hash, sym->name, false, false)) { strcpy (name, sym->name); cb (relocs[i], s, name, symname); @@ -1423,7 +1423,7 @@ pe_find_data_imports (const char *symhead, if (sym && sym->type == bfd_link_hash_defined) { if (import_hash) - bfd_hash_lookup (import_hash, undef->root.string, TRUE, FALSE); + bfd_hash_lookup (import_hash, undef->root.string, true, false); else { bfd *b = sym->u.def.section->owner; @@ -1471,7 +1471,7 @@ pe_find_data_imports (const char *symhead, if (link_info.pei386_auto_import == -1) { - static bfd_boolean warned = FALSE; + static bool warned = false; info_msg (_("Info: resolving %s by linking to %s " "(auto-import)\n"), name, impname); @@ -1484,7 +1484,7 @@ pe_find_data_imports (const char *symhead, "command line; this should work unless it " "involves constant data structures referencing " "symbols from auto-imported DLLs\n")); - warned = TRUE; + warned = true; } } } @@ -1581,7 +1581,7 @@ generate_reloc (bfd *abfd, struct bfd_link_info *info) struct bfd_symbol *sym = *relocs[i]->sym_ptr_ptr; const struct bfd_link_hash_entry *blhe = bfd_wrapped_link_hash_lookup (abfd, info, sym->name, - FALSE, FALSE, FALSE); + false, false, false); /* Don't create relocs for undefined weak symbols. */ if (sym->flags == BSF_WEAK) @@ -2271,7 +2271,7 @@ static const unsigned char jmp_arm_bytes[] = static bfd * -make_one (def_file_export *exp, bfd *parent, bfd_boolean include_jmp_stub) +make_one (def_file_export *exp, bfd *parent, bool include_jmp_stub) { asection *tx, *id7, *id5, *id4, *id6; unsigned char *td = NULL, *d7, *d5, *d4, *d6 = NULL; @@ -2552,7 +2552,7 @@ make_import_fixup_mark (arelent *rel, char *name) bh = NULL; bfd_coff_link_add_one_symbol (&link_info, abfd, fixup_name, BSF_GLOBAL, current_sec, /* sym->section, */ - rel->address, NULL, TRUE, FALSE, &bh); + rel->address, NULL, true, false, &bh); return bh->root.string; } @@ -2664,7 +2664,7 @@ make_runtime_pseudo_reloc (const char *name ATTRIBUTE_UNUSED, if (!runtime_pseudp_reloc_v2_init) { size += 12; - runtime_pseudp_reloc_v2_init = TRUE; + runtime_pseudp_reloc_v2_init = true; } quick_symbol (abfd, "__imp_", name, "", UNDSEC, BSF_GLOBAL, 0); @@ -2774,7 +2774,7 @@ pe_create_import_fixup (arelent *rel, asection *s, bfd_vma addend, char *name, add_bfd_to_link (b, bfd_get_filename (b), &link_info); /* If we ever use autoimport, we have to cast text section writable. */ - config.text_read_only = FALSE; + config.text_read_only = false; link_info.output_bfd->flags &= ~WP_TEXT; } @@ -2926,7 +2926,7 @@ pe_dll_generate_implib (def_file *def, const char *impfilename, struct bfd_link_ struct coff_link_hash_entry *h; h = coff_link_hash_lookup (coff_hash_table (info), internal, - FALSE, FALSE, FALSE); + false, false, false); if (h != NULL /* If the symbol is hidden and undefined then it has been swept up by garbage collection. */ @@ -2943,7 +2943,7 @@ pe_dll_generate_implib (def_file *def, const char *impfilename, struct bfd_link_ sprintf (name, "_%s", internal); h = coff_link_hash_lookup (coff_hash_table (info), name, - FALSE, FALSE, FALSE); + false, false, false); free (name); if (h != NULL @@ -3024,7 +3024,7 @@ pe_find_cdecl_alias_match (struct bfd_link_info *linfo, char *name) if (kv) { - h = bfd_link_hash_lookup (linfo->hash, kv->oname, FALSE, FALSE, FALSE); + h = bfd_link_hash_lookup (linfo->hash, kv->oname, false, false, false); if (h->type == bfd_link_hash_undefined) goto return_h; } @@ -3047,7 +3047,7 @@ pe_find_cdecl_alias_match (struct bfd_link_info *linfo, char *name) sizeof (struct key_value), undef_sort_cmp); if (kv) { - h = bfd_link_hash_lookup (linfo->hash, kv->oname, FALSE, FALSE, FALSE); + h = bfd_link_hash_lookup (linfo->hash, kv->oname, false, false, false); if (h->type == bfd_link_hash_undefined) goto return_h; } @@ -3059,7 +3059,7 @@ pe_find_cdecl_alias_match (struct bfd_link_info *linfo, char *name) sizeof (struct key_value), undef_sort_cmp); if (kv) { - h = bfd_link_hash_lookup (linfo->hash, kv->oname, FALSE, FALSE, FALSE); + h = bfd_link_hash_lookup (linfo->hash, kv->oname, false, false, false); if (h->type == bfd_link_hash_undefined) goto return_h; } @@ -3073,7 +3073,7 @@ pe_find_cdecl_alias_match (struct bfd_link_info *linfo, char *name) if (kv) { - h = bfd_link_hash_lookup (linfo->hash, kv->oname, FALSE, FALSE, FALSE); + h = bfd_link_hash_lookup (linfo->hash, kv->oname, false, false, false); if (h->type == bfd_link_hash_undefined) goto return_h; } @@ -3092,7 +3092,7 @@ pe_find_cdecl_alias_match (struct bfd_link_info *linfo, char *name) if (kv) { - h = bfd_link_hash_lookup (linfo->hash, kv->oname, FALSE, FALSE, FALSE); + h = bfd_link_hash_lookup (linfo->hash, kv->oname, false, false, false); if (h->type == bfd_link_hash_undefined) goto return_h; } @@ -3104,16 +3104,16 @@ pe_find_cdecl_alias_match (struct bfd_link_info *linfo, char *name) return h; } -static bfd_boolean +static bool pe_undef_count (struct bfd_link_hash_entry *h ATTRIBUTE_UNUSED, void *inf ATTRIBUTE_UNUSED) { if (h->type == bfd_link_hash_undefined) undef_count++; - return TRUE; + return true; } -static bfd_boolean +static bool pe_undef_fill (struct bfd_link_hash_entry *h, void *inf ATTRIBUTE_UNUSED) { if (h->type == bfd_link_hash_undefined) @@ -3128,7 +3128,7 @@ pe_undef_fill (struct bfd_link_hash_entry *h, void *inf ATTRIBUTE_UNUSED) udef_table[undef_count].oname = h->root.string; undef_count++; } - return TRUE; + return true; } static void @@ -3204,12 +3204,12 @@ pe_process_import_defs (bfd *output_bfd, struct bfd_link_info *linfo) /* See if we need this import. */ size_t len = strlen (imp[i].internal_name); char *name = xmalloc (len + 2 + 6); - bfd_boolean include_jmp_stub = FALSE; - bfd_boolean is_cdecl = FALSE; - bfd_boolean is_undef = FALSE; + bool include_jmp_stub = false; + bool is_cdecl = false; + bool is_undef = false; if (!lead_at && strchr (imp[i].internal_name, '@') == NULL) - is_cdecl = TRUE; + is_cdecl = true; if (lead_at) sprintf (name, "%s", imp[i].internal_name); @@ -3217,7 +3217,7 @@ pe_process_import_defs (bfd *output_bfd, struct bfd_link_info *linfo) sprintf (name, "%s%s",U (""), imp[i].internal_name); blhe = bfd_link_hash_lookup (linfo->hash, name, - FALSE, FALSE, FALSE); + false, false, false); /* Include the jump stub for only if the is undefined. */ @@ -3230,13 +3230,13 @@ pe_process_import_defs (bfd *output_bfd, struct bfd_link_info *linfo) imp[i].internal_name); blhe = bfd_link_hash_lookup (linfo->hash, name, - FALSE, FALSE, FALSE); + false, false, false); if (blhe) is_undef = (blhe->type == bfd_link_hash_undefined); } else { - include_jmp_stub = TRUE; + include_jmp_stub = true; is_undef = (blhe->type == bfd_link_hash_undefined); } @@ -3244,7 +3244,7 @@ pe_process_import_defs (bfd *output_bfd, struct bfd_link_info *linfo) { sprintf (name, "%s%s",U (""), imp[i].internal_name); blhe = pe_find_cdecl_alias_match (linfo, name); - include_jmp_stub = TRUE; + include_jmp_stub = true; if (blhe) is_undef = (blhe->type == bfd_link_hash_undefined); } @@ -3323,7 +3323,7 @@ pe_as32 (void *ptr) return b[0] + (b[1] << 8) + (b[2] << 16) + ((unsigned) b[3] << 24); } -bfd_boolean +bool pe_implied_import_dll (const char *filename) { bfd *dll; @@ -3350,7 +3350,7 @@ pe_implied_import_dll (const char *filename) if (!dll) { einfo (_("%X%P: open %s: %E\n"), filename); - return FALSE; + return false; } track_dependency_files (filename); @@ -3359,7 +3359,7 @@ pe_implied_import_dll (const char *filename) if (!bfd_check_format (dll, bfd_object)) { einfo (_("%X%P: %s: this doesn't appear to be a DLL\n"), filename); - return FALSE; + return false; } /* Get pe_header, optional header and numbers of directory entries. */ @@ -3373,7 +3373,7 @@ pe_implied_import_dll (const char *filename) /* No import or export directory entry. */ if (num_entries < 1) - return FALSE; + return false; #ifdef pe_use_x86_64 export_rva = pe_get32 (dll, opthdr_ofs + 96 + 4 * 4); @@ -3385,7 +3385,7 @@ pe_implied_import_dll (const char *filename) /* No export table - nothing to export. */ if (export_size == 0) - return FALSE; + return false; nsections = pe_get16 (dll, pe_header_offset + 4 + 2); secptr = (pe_header_offset + 4 + 20 + @@ -3482,7 +3482,7 @@ pe_implied_import_dll (const char *filename) { if (pe_dll_extra_pe_debug) printf ("%s is already loaded\n", dllname); - return TRUE; + return true; } /* This is an optimized version of the insertion loop, which avoids lots of @@ -3516,7 +3516,7 @@ pe_implied_import_dll (const char *filename) (unsigned long) func_rva, is_data ? "(data)" : ""); } - return TRUE; + return true; } /* Iterate through the list of symbols. */ @@ -3554,7 +3554,7 @@ pe_implied_import_dll (const char *filename) } } - return TRUE; + return true; } void @@ -3631,7 +3631,7 @@ pe_exe_fill_sections (bfd *abfd, struct bfd_link_info *info) /* Resize the sections. */ lang_reset_memory_regions (); - lang_size_sections (NULL, TRUE); + lang_size_sections (NULL, true); /* Redo special stuff. */ ldemul_after_allocation (); @@ -3643,7 +3643,7 @@ pe_exe_fill_sections (bfd *abfd, struct bfd_link_info *info) reloc_s->contents = reloc_d; } -bfd_boolean +bool pe_bfd_is_dll (bfd *abfd) { return (bfd_get_format (abfd) == bfd_object diff --git a/ld/pe-dll.h b/ld/pe-dll.h index 180bf8c6d0b..ce5e9455949 100644 --- a/ld/pe-dll.h +++ b/ld/pe-dll.h @@ -52,7 +52,7 @@ extern void pe_dll_generate_implib (def_file *, const char *, struct bfd_link_info *); extern void pe_process_import_defs (bfd *, struct bfd_link_info *); -extern bfd_boolean pe_implied_import_dll +extern bool pe_implied_import_dll (const char *); extern void pe_dll_build_sections (bfd *, struct bfd_link_info *); @@ -66,7 +66,7 @@ extern void pe_find_data_imports (const char *, void (*cb) (arelent *, asection *, char *, const char *)); extern void pe_create_import_fixup (arelent * rel, asection *, bfd_vma, char *, const char *); -extern bfd_boolean pe_bfd_is_dll +extern bool pe_bfd_is_dll (bfd *); extern void pe_output_file_set_long_section_names (bfd *); diff --git a/ld/pep-dll.h b/ld/pep-dll.h index 67f26c5f887..943637b77a5 100644 --- a/ld/pep-dll.h +++ b/ld/pep-dll.h @@ -48,7 +48,7 @@ extern void pep_dll_add_excludes (const char *, const exclude_type); extern void pep_dll_generate_def_file (const char *); extern void pep_dll_generate_implib (def_file *, const char *, struct bfd_link_info *); extern void pep_process_import_defs (bfd *, struct bfd_link_info *); -extern bfd_boolean pep_implied_import_dll (const char *); +extern bool pep_implied_import_dll (const char *); extern void pep_dll_build_sections (bfd *, struct bfd_link_info *); extern void pep_exe_build_sections (bfd *, struct bfd_link_info *); extern void pep_dll_fill_sections (bfd *, struct bfd_link_info *); @@ -58,7 +58,7 @@ extern void pep_find_data_imports (const char *, const char *)); extern void pep_create_import_fixup (arelent * rel, asection *, bfd_vma, char *, const char *); -extern bfd_boolean pep_bfd_is_dll (bfd *); +extern bool pep_bfd_is_dll (bfd *); extern void pep_output_file_set_long_section_names (bfd *); #endif /* PEP_DLL_H */ diff --git a/ld/plugin.c b/ld/plugin.c index 173aa1d0718..adaba32edaa 100644 --- a/ld/plugin.c +++ b/ld/plugin.c @@ -56,7 +56,7 @@ extern int errno; #endif /* Report plugin symbols. */ -bfd_boolean report_plugin_symbols; +bool report_plugin_symbols; /* The suffix to append to the name of the real (claimed) object file when generating a dummy BFD to hold the IR symbols sent from the @@ -88,7 +88,7 @@ typedef struct plugin ld_plugin_all_symbols_read_handler all_symbols_read_handler; ld_plugin_cleanup_handler cleanup_handler; /* TRUE if the cleanup handlers have been called. */ - bfd_boolean cleanup_done; + bool cleanup_done; } plugin_t; typedef struct view_buffer @@ -106,7 +106,7 @@ typedef struct plugin_input_file view_buffer_t view_buffer; char *name; int fd; - bfd_boolean use_mmap; + bool use_mmap; off_t offset; off_t filesize; } plugin_input_file_t; @@ -130,7 +130,7 @@ static plugin_t *called_plugin = NULL; static const char *error_plugin = NULL; /* State of linker "notice" interface before we poked at it. */ -static bfd_boolean orig_notice_all; +static bool orig_notice_all; /* Original linker callbacks, and the plugin version. */ static const struct bfd_link_callbacks *orig_callbacks; @@ -138,7 +138,7 @@ static struct bfd_link_callbacks plugin_callbacks; /* Set at all symbols read time, to avoid recursively offering the plugin its own newly-added input files and libs to claim. */ -bfd_boolean no_more_claiming = FALSE; +bool no_more_claiming = false; #if HAVE_MMAP && HAVE_GETPAGESIZE /* Page size used by mmap. */ @@ -171,10 +171,10 @@ static const enum ld_plugin_tag tv_header_tags[] = static const size_t tv_header_size = ARRAY_SIZE (tv_header_tags); /* Forward references. */ -static bfd_boolean plugin_notice (struct bfd_link_info *, - struct bfd_link_hash_entry *, - struct bfd_link_hash_entry *, - bfd *, asection *, bfd_vma, flagword); +static bool plugin_notice (struct bfd_link_info *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *, + bfd *, asection *, bfd_vma, flagword); static bfd_cleanup plugin_object_p (bfd *); @@ -220,7 +220,7 @@ set_plugin_error (const char *plugin) } /* Test if an error occurred. */ -static bfd_boolean +static bool plugin_error_p (void) { return error_plugin != NULL; @@ -309,7 +309,7 @@ static bfd * plugin_get_ir_dummy_bfd (const char *name, bfd *srctemplate) { bfd *abfd; - bfd_boolean bfd_plugin_target; + bool bfd_plugin_target; bfd_use_reserved_id = 1; bfd_plugin_target = bfd_plugin_target_p (srctemplate->xvec); @@ -343,7 +343,7 @@ plugin_get_ir_dummy_bfd (const char *name, bfd *srctemplate) } /* Check if the BFD passed in is an IR dummy object file. */ -static inline bfd_boolean +static inline bool is_ir_dummy_bfd (const bfd *abfd) { /* ABFD can sometimes legitimately be NULL, e.g. when called from one @@ -563,7 +563,7 @@ get_view (const void *handle, const void **viewp) buffer = mmap (NULL, size, PROT_READ, MAP_PRIVATE, input->fd, offset); if (buffer != MAP_FAILED) { - input->use_mmap = TRUE; + input->use_mmap = true; # if HAVE_GETPAGESIZE buffer += bias; # endif @@ -573,7 +573,7 @@ get_view (const void *handle, const void **viewp) { char *p; - input->use_mmap = FALSE; + input->use_mmap = false; if (lseek (input->fd, offset, SEEK_SET) < 0) return LDPS_ERR; @@ -621,12 +621,12 @@ release_input_file (const void *handle) /* Return TRUE if a defined symbol might be reachable from outside the universe of claimed objects. */ -static inline bfd_boolean +static inline bool is_visible_from_outside (struct ld_plugin_symbol *lsym, struct bfd_link_hash_entry *blhe) { if (bfd_link_relocatable (&link_info)) - return TRUE; + return true; if (blhe->non_ir_ref_dynamic || link_info.export_dynamic || bfd_link_dll (&link_info)) @@ -634,7 +634,7 @@ is_visible_from_outside (struct ld_plugin_symbol *lsym, /* Check if symbol is hidden by version script. */ if (bfd_hide_sym_by_version (link_info.version_info, blhe->root.string)) - return FALSE; + return false; /* Only ELF symbols really have visibility. */ if (bfd_get_flavour (link_info.output_bfd) == bfd_target_elf_flavour) { @@ -656,7 +656,7 @@ is_visible_from_outside (struct ld_plugin_symbol *lsym, || lsym->visibility == LDPV_PROTECTED); } - return FALSE; + return false; } /* Return LTO kind string name that corresponds to IDX enum value. */ @@ -743,7 +743,7 @@ get_symbols (const void *handle, int nsyms, struct ld_plugin_symbol *syms, int res; struct bfd_link_hash_entry *h = bfd_link_hash_lookup (link_info.hash, syms[n].name, - FALSE, FALSE, TRUE); + false, false, true); enum { wrap_none, wrapper, wrapped } wrap_status = wrap_none; if (syms[n].def != LDPK_UNDEF && syms[n].def != LDPK_WEAKUNDEF) @@ -762,7 +762,7 @@ get_symbols (const void *handle, int nsyms, struct ld_plugin_symbol *syms, { blhe = bfd_wrapped_link_hash_lookup (link_info.output_bfd, &link_info, syms[n].name, - FALSE, FALSE, TRUE); + false, false, true); /* Check if a symbol is a wrapped symbol. */ if (blhe && blhe != h) wrap_status = wrapped; @@ -922,7 +922,7 @@ static enum ld_plugin_status set_extra_library_path (const char *path) { ASSERT (called_plugin); - ldfile_add_library_path (xstrdup (path), FALSE); + ldfile_add_library_path (xstrdup (path), false); return LDPS_OK; } @@ -936,14 +936,14 @@ message (int level, const char *format, ...) switch (level) { case LDPL_INFO: - vfinfo (stdout, format, args, FALSE); + vfinfo (stdout, format, args, false); putchar ('\n'); break; case LDPL_WARNING: { char *newfmt = concat (_("%P: warning: "), format, "\n", (const char *) NULL); - vfinfo (stdout, newfmt, args, TRUE); + vfinfo (stdout, newfmt, args, true); free (newfmt); } break; @@ -955,7 +955,7 @@ message (int level, const char *format, ...) _("%P: error: "), format, "\n", (const char *) NULL); fflush (stdout); - vfinfo (stderr, newfmt, args, TRUE); + vfinfo (stderr, newfmt, args, true); fflush (stderr); free (newfmt); } @@ -1115,8 +1115,8 @@ plugin_load_plugins (void) orig_callbacks = link_info.callbacks; plugin_callbacks = *orig_callbacks; plugin_callbacks.notice = &plugin_notice; - link_info.notice_all = TRUE; - link_info.lto_plugin_active = TRUE; + link_info.notice_all = true; + link_info.lto_plugin_active = true; link_info.callbacks = &plugin_callbacks; register_ld_plugin_object_p (plugin_object_p); @@ -1131,7 +1131,7 @@ static int plugin_call_claim_file (const struct ld_plugin_input_file *file, int *claimed) { plugin_t *curplug = plugins_list; - *claimed = FALSE; + *claimed = false; while (curplug && !*claimed) { if (curplug->claim_file_handler) @@ -1215,7 +1215,7 @@ plugin_object_p (bfd *ibfd) input->view_buffer.filesize = 0; input->view_buffer.offset = 0; input->fd = file.fd; - input->use_mmap = FALSE; + input->use_mmap = false; input->offset = file.offset; input->filesize = file.filesize; input->name = plugin_strdup (abfd, bfd_get_filename (ibfd)); @@ -1301,7 +1301,7 @@ plugin_call_all_symbols_read (void) plugin_t *curplug = plugins_list; /* Disable any further file-claiming. */ - no_more_claiming = TRUE; + no_more_claiming = true; while (curplug) { @@ -1329,7 +1329,7 @@ plugin_call_cleanup (void) if (curplug->cleanup_handler && !curplug->cleanup_done) { enum ld_plugin_status rv; - curplug->cleanup_done = TRUE; + curplug->cleanup_done = true; called_plugin = curplug; rv = (*curplug->cleanup_handler) (); called_plugin = NULL; @@ -1349,7 +1349,7 @@ plugin_call_cleanup (void) non_ir_ref_dynamic as appropriate. We have to notice_all symbols, because we won't necessarily know until later which ones will be contributed by IR files. */ -static bfd_boolean +static bool plugin_notice (struct bfd_link_info *info, struct bfd_link_hash_entry *h, struct bfd_link_hash_entry *inh, @@ -1363,7 +1363,7 @@ plugin_notice (struct bfd_link_info *info, if (h != NULL) { bfd *sym_bfd; - bfd_boolean ref = FALSE; + bool ref = false; if (h->type == bfd_link_hash_warning) h = h->u.i.link; @@ -1383,13 +1383,13 @@ plugin_notice (struct bfd_link_info *info, || inh->type == bfd_link_hash_new) { if ((abfd->flags & DYNAMIC) == 0) - inh->non_ir_ref_regular = TRUE; + inh->non_ir_ref_regular = true; else - inh->non_ir_ref_dynamic = TRUE; + inh->non_ir_ref_dynamic = true; } if (h->type != bfd_link_hash_new) - ref = TRUE; + ref = true; } /* Nothing to do here for warning symbols. */ @@ -1409,7 +1409,7 @@ plugin_notice (struct bfd_link_info *info, && (h->u.undef.abfd == NULL || (h->u.undef.abfd->flags & BFD_PLUGIN) != 0)) h->u.undef.abfd = abfd; - ref = TRUE; + ref = true; } @@ -1425,7 +1425,7 @@ plugin_notice (struct bfd_link_info *info, h->type = bfd_link_hash_undefweak; h->u.undef.abfd = sym_bfd; } - ref = TRUE; + ref = true; } /* Otherwise, it must be a new def. @@ -1453,9 +1453,9 @@ plugin_notice (struct bfd_link_info *info, if (ref) { if ((abfd->flags & DYNAMIC) == 0) - h->non_ir_ref_regular = TRUE; + h->non_ir_ref_regular = true; else - h->non_ir_ref_dynamic = TRUE; + h->non_ir_ref_dynamic = true; } } @@ -1464,9 +1464,9 @@ plugin_notice (struct bfd_link_info *info, || orig_notice_all || (info->notice_hash != NULL && bfd_hash_lookup (info->notice_hash, orig_h->root.string, - FALSE, FALSE) != NULL)) + false, false) != NULL)) return (*orig_callbacks->notice) (info, orig_h, inh, abfd, section, value, flags); - return TRUE; + return true; } #endif /* BFD_SUPPORTS_PLUGINS */ diff --git a/ld/plugin.h b/ld/plugin.h index 00256267750..775dbb4e902 100644 --- a/ld/plugin.h +++ b/ld/plugin.h @@ -22,11 +22,11 @@ #define GLD_PLUGIN_H /* Report plugin symbols. */ -extern bfd_boolean report_plugin_symbols; +extern bool report_plugin_symbols; /* Set at all symbols read time, to avoid recursively offering the plugin its own newly-added input files and libs to claim. */ -extern bfd_boolean no_more_claiming; +extern bool no_more_claiming; /* This is the only forward declaration we need to avoid having to include the plugin-api.h header in order to use this file. */ diff --git a/ld/sysdep.h b/ld/sysdep.h index 206c02c8c5e..27bce0adf38 100644 --- a/ld/sysdep.h +++ b/ld/sysdep.h @@ -123,4 +123,6 @@ extern char *getenv (); extern char **environ; #endif +#define POISON_BFD_BOOLEAN 1 + #endif /* ! defined (LD_SYSDEP_H) */ diff --git a/ld/testplug.c b/ld/testplug.c index 645004ef177..c1d7c22e6b4 100644 --- a/ld/testplug.c +++ b/ld/testplug.c @@ -41,7 +41,7 @@ typedef struct claim_file { struct claim_file *next; struct ld_plugin_input_file file; - bfd_boolean claimed; + bool claimed; struct ld_plugin_symbol *symbols; int n_syms_allocated; int n_syms_used; @@ -122,10 +122,10 @@ static enum ld_plugin_status onload_ret = LDPS_OK; static enum ld_plugin_status claim_file_ret = LDPS_OK; static enum ld_plugin_status all_symbols_read_ret = LDPS_OK; static enum ld_plugin_status cleanup_ret = LDPS_OK; -static bfd_boolean register_claimfile_hook = FALSE; -static bfd_boolean register_allsymbolsread_hook = FALSE; -static bfd_boolean register_cleanup_hook = FALSE; -static bfd_boolean dumpresolutions = FALSE; +static bool register_claimfile_hook = false; +static bool register_allsymbolsread_hook = false; +static bool register_cleanup_hook = false; +static bool dumpresolutions = false; /* The master list of all claimable/claimed files. */ static claim_file_t *claimfiles_list = NULL; @@ -324,7 +324,7 @@ set_ret_val (const char *whichval, enum ld_plugin_status retval) /* Records hooks which should be registered. */ static enum ld_plugin_status -set_register_hook (const char *whichhook, bfd_boolean yesno) +set_register_hook (const char *whichhook, bool yesno) { if (!strcmp ("claimfile", whichhook)) register_claimfile_hook = yesno; @@ -346,9 +346,9 @@ parse_option (const char *opt) else if (!strncmp ("pass", opt, 4)) return set_ret_val (opt + 4, LDPS_OK); else if (!strncmp ("register", opt, 8)) - return set_register_hook (opt + 8, TRUE); + return set_register_hook (opt + 8, true); else if (!strncmp ("noregister", opt, 10)) - return set_register_hook (opt + 10, FALSE); + return set_register_hook (opt + 10, false); else if (!strncmp ("claim:", opt, 6)) return record_claim_file (opt + 6); else if (!strncmp ("read:", opt, 5)) @@ -362,7 +362,7 @@ parse_option (const char *opt) else if (!strncmp ("dir:", opt, 4)) return record_add_file (opt + 4, ADD_DIR); else if (!strcmp ("dumpresolutions", opt)) - dumpresolutions = TRUE; + dumpresolutions = true; else return LDPS_ERR; return LDPS_OK; @@ -589,7 +589,7 @@ onclaim_file (const struct ld_plugin_input_file *file, int *claimed) *claimed = (claimfile != 0); if (claimfile) { - claimfile->claimed = TRUE; + claimfile->claimed = true; claimfile->file = *file; if (claimfile->n_syms_used && !tv_add_symbols) return LDPS_ERR; diff --git a/ld/testplug2.c b/ld/testplug2.c index 0488b31c26a..ddf2ea3d92e 100644 --- a/ld/testplug2.c +++ b/ld/testplug2.c @@ -41,7 +41,7 @@ typedef struct claim_file { struct claim_file *next; struct ld_plugin_input_file file; - bfd_boolean claimed; + bool claimed; struct ld_plugin_symbol *symbols; int n_syms_allocated; int n_syms_used; @@ -122,11 +122,11 @@ static enum ld_plugin_status onload_ret = LDPS_OK; static enum ld_plugin_status claim_file_ret = LDPS_OK; static enum ld_plugin_status all_symbols_read_ret = LDPS_OK; static enum ld_plugin_status cleanup_ret = LDPS_OK; -static bfd_boolean register_claimfile_hook = TRUE; -static bfd_boolean register_allsymbolsread_hook = FALSE; -static bfd_boolean register_cleanup_hook = FALSE; -static bfd_boolean dumpresolutions = FALSE; -static bfd_boolean allsymbolsread_silent = FALSE; +static bool register_claimfile_hook = true; +static bool register_allsymbolsread_hook = false; +static bool register_cleanup_hook = false; +static bool dumpresolutions = false; +static bool allsymbolsread_silent = false; /* The master list of all claimable/claimed files. */ static claim_file_t *claimfiles_list = NULL; @@ -306,7 +306,7 @@ set_ret_val (const char *whichval, enum ld_plugin_status retval) /* Records hooks which should be registered. */ static enum ld_plugin_status -set_register_hook (const char *whichhook, bfd_boolean yesno) +set_register_hook (const char *whichhook, bool yesno) { if (!strcmp ("claimfile", whichhook)) register_claimfile_hook = yesno; @@ -315,7 +315,7 @@ set_register_hook (const char *whichhook, bfd_boolean yesno) else if (!strcmp ("allsymbolsreadsilent", whichhook)) { register_allsymbolsread_hook = yesno; - allsymbolsread_silent = TRUE; + allsymbolsread_silent = true; } else if (!strcmp ("cleanup", whichhook)) register_cleanup_hook = yesno; @@ -348,9 +348,9 @@ parse_option (const char *opt) else if (!strncmp ("pass", opt, 4)) return set_ret_val (opt + 4, LDPS_OK); else if (!strncmp ("register", opt, 8)) - return set_register_hook (opt + 8, TRUE); + return set_register_hook (opt + 8, true); else if (!strncmp ("noregister", opt, 10)) - return set_register_hook (opt + 10, FALSE); + return set_register_hook (opt + 10, false); else if (!strncmp ("claim:", opt, 6)) return record_claim_file (opt + 6, 0); else if (!strncmp ("sym:", opt, 4)) @@ -362,7 +362,7 @@ parse_option (const char *opt) else if (!strncmp ("dir:", opt, 4)) return record_add_file (opt + 4, ADD_DIR); else if (!strcmp ("dumpresolutions", opt)) - dumpresolutions = TRUE; + dumpresolutions = true; else return LDPS_ERR; return LDPS_OK; @@ -518,7 +518,7 @@ onclaim_file (const struct ld_plugin_input_file *file, int *claimed) size_t len = strlen (file->name); char *name = xstrdup (file->name); char *p = name + len; - bfd_boolean islib; + bool islib; /* Only match the file name without the directory part. */ islib = *p == 'a' && *(p - 1) == '.'; @@ -547,7 +547,7 @@ onclaim_file (const struct ld_plugin_input_file *file, int *claimed) *claimed = (claimfile != 0); if (claimfile) { - claimfile->claimed = TRUE; + claimfile->claimed = true; claimfile->file = *file; if (claimfile->n_syms_used && !tv_add_symbols) return LDPS_ERR; diff --git a/ld/testplug3.c b/ld/testplug3.c index 6b8b34a4ab9..155b5df523a 100644 --- a/ld/testplug3.c +++ b/ld/testplug3.c @@ -41,7 +41,7 @@ typedef struct claim_file { struct claim_file *next; struct ld_plugin_input_file file; - bfd_boolean claimed; + bool claimed; struct ld_plugin_symbol *symbols; int n_syms_allocated; int n_syms_used; @@ -122,10 +122,10 @@ static enum ld_plugin_status onload_ret = LDPS_OK; static enum ld_plugin_status claim_file_ret = LDPS_OK; static enum ld_plugin_status all_symbols_read_ret = LDPS_OK; static enum ld_plugin_status cleanup_ret = LDPS_OK; -static bfd_boolean register_claimfile_hook = TRUE; -static bfd_boolean register_allsymbolsread_hook = FALSE; -static bfd_boolean register_cleanup_hook = FALSE; -static bfd_boolean dumpresolutions = FALSE; +static bool register_claimfile_hook = true; +static bool register_allsymbolsread_hook = false; +static bool register_cleanup_hook = false; +static bool dumpresolutions = false; /* The master list of all claimable/claimed files. */ static claim_file_t *claimfiles_list = NULL; @@ -305,7 +305,7 @@ set_ret_val (const char *whichval, enum ld_plugin_status retval) /* Records hooks which should be registered. */ static enum ld_plugin_status -set_register_hook (const char *whichhook, bfd_boolean yesno) +set_register_hook (const char *whichhook, bool yesno) { if (!strcmp ("claimfile", whichhook)) register_claimfile_hook = yesno; @@ -327,9 +327,9 @@ parse_option (const char *opt) else if (!strncmp ("pass", opt, 4)) return set_ret_val (opt + 4, LDPS_OK); else if (!strncmp ("register", opt, 8)) - return set_register_hook (opt + 8, TRUE); + return set_register_hook (opt + 8, true); else if (!strncmp ("noregister", opt, 10)) - return set_register_hook (opt + 10, FALSE); + return set_register_hook (opt + 10, false); else if (!strncmp ("claim:", opt, 6)) return record_claim_file (opt + 6, 0); else if (!strncmp ("sym:", opt, 4)) @@ -341,7 +341,7 @@ parse_option (const char *opt) else if (!strncmp ("dir:", opt, 4)) return record_add_file (opt + 4, ADD_DIR); else if (!strcmp ("dumpresolutions", opt)) - dumpresolutions = TRUE; + dumpresolutions = true; else return LDPS_ERR; return LDPS_OK; @@ -497,7 +497,7 @@ onclaim_file (const struct ld_plugin_input_file *file, int *claimed) size_t len = strlen (file->name); char *name = xstrdup (file->name); char *p = name + len; - bfd_boolean islib; + bool islib; /* Only match the file name without the directory part. */ islib = *p == 'a' && *(p - 1) == '.'; @@ -532,7 +532,7 @@ onclaim_file (const struct ld_plugin_input_file *file, int *claimed) TV_MESSAGE (LDPL_INFO, "Claimed: %s [@%ld/%ld]", file->name, (long)file->offset, (long)file->filesize); - claimfile->claimed = TRUE; + claimfile->claimed = true; claimfile->file = *file; if (claimfile->n_syms_used && !tv_add_symbols) claim_file_ret = LDPS_ERR; diff --git a/ld/testplug4.c b/ld/testplug4.c index 426186af327..9cbb9276c8f 100644 --- a/ld/testplug4.c +++ b/ld/testplug4.c @@ -41,7 +41,7 @@ typedef struct claim_file { struct claim_file *next; struct ld_plugin_input_file file; - bfd_boolean claimed; + bool claimed; struct ld_plugin_symbol *symbols; int n_syms_allocated; int n_syms_used; @@ -122,11 +122,11 @@ static enum ld_plugin_status onload_ret = LDPS_OK; static enum ld_plugin_status claim_file_ret = LDPS_OK; static enum ld_plugin_status all_symbols_read_ret = LDPS_OK; static enum ld_plugin_status cleanup_ret = LDPS_OK; -static bfd_boolean register_claimfile_hook = TRUE; -static bfd_boolean register_allsymbolsread_hook = FALSE; -static bfd_boolean register_cleanup_hook = FALSE; -static bfd_boolean dumpresolutions = FALSE; -static bfd_boolean allsymbolsread_silent = FALSE; +static bool register_claimfile_hook = true; +static bool register_allsymbolsread_hook = false; +static bool register_cleanup_hook = false; +static bool dumpresolutions = false; +static bool allsymbolsread_silent = false; /* The master list of all claimable/claimed files. */ static claim_file_t *claimfiles_list = NULL; @@ -306,7 +306,7 @@ set_ret_val (const char *whichval, enum ld_plugin_status retval) /* Records hooks which should be registered. */ static enum ld_plugin_status -set_register_hook (const char *whichhook, bfd_boolean yesno) +set_register_hook (const char *whichhook, bool yesno) { if (!strcmp ("claimfile", whichhook)) register_claimfile_hook = yesno; @@ -315,7 +315,7 @@ set_register_hook (const char *whichhook, bfd_boolean yesno) else if (!strcmp ("allsymbolsreadsilent", whichhook)) { register_allsymbolsread_hook = yesno; - allsymbolsread_silent = TRUE; + allsymbolsread_silent = true; } else if (!strcmp ("cleanup", whichhook)) register_cleanup_hook = yesno; @@ -348,9 +348,9 @@ parse_option (const char *opt) else if (!strncmp ("pass", opt, 4)) return set_ret_val (opt + 4, LDPS_OK); else if (!strncmp ("register", opt, 8)) - return set_register_hook (opt + 8, TRUE); + return set_register_hook (opt + 8, true); else if (!strncmp ("noregister", opt, 10)) - return set_register_hook (opt + 10, FALSE); + return set_register_hook (opt + 10, false); else if (!strncmp ("claim:", opt, 6)) return record_claim_file (opt + 6, 0); else if (!strncmp ("sym:", opt, 4)) @@ -362,7 +362,7 @@ parse_option (const char *opt) else if (!strncmp ("dir:", opt, 4)) return record_add_file (opt + 4, ADD_DIR); else if (!strcmp ("dumpresolutions", opt)) - dumpresolutions = TRUE; + dumpresolutions = true; else return LDPS_ERR; return LDPS_OK; @@ -524,7 +524,7 @@ onclaim_file (const struct ld_plugin_input_file *file, int *claimed) size_t len = strlen (file->name); char *name = xstrdup (file->name); char *p = name + len; - bfd_boolean islib; + bool islib; /* Only match the file name without the directory part. */ islib = *p == 'a' && *(p - 1) == '.'; @@ -553,7 +553,7 @@ onclaim_file (const struct ld_plugin_input_file *file, int *claimed) *claimed = (claimfile != 0); if (claimfile) { - claimfile->claimed = TRUE; + claimfile->claimed = true; claimfile->file = *file; if (claimfile->n_syms_used && !tv_add_symbols) return LDPS_ERR;