* 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 <amodra@gmail.com>
+
+ * 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 <amodra@gmail.com>
* elf-hints-local.h: Include stdint.h in place of bfd_stdint.h.
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`
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
;;
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`
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
;;
{
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)
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)
{
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);
'
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)
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"
TEXT_START_ADDR=0xa0020000
unset SHLIB_TEXT_START_ADDR
EXECUTABLE_SYMBOLS='_DYNAMIC_LINK = 0;'
-DYNAMIC_LINK=FALSE
+DYNAMIC_LINK=false
EMBEDDED=yes
TEMPLATE_NAME=elf
TEXT_START_ADDR=0x0000
-DYNAMIC_LINK=FALSE
+DYNAMIC_LINK=false
ALIGNMENT=4
MACHINE=
MAXPAGESIZE=128
EMBEDDED=yes
-DYNAMIC_LINK=FALSE
+DYNAMIC_LINK=false
unset DATA_ADDR
SHLIB_TEXT_START_ADDR=0
MACHINE=
MAXPAGESIZE=128
EMBEDDED=yes
-DYNAMIC_LINK=FALSE
+DYNAMIC_LINK=false
OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
OTHER_SECTIONS="
ARCH=visium
MACHINE=
TEMPLATE_NAME=elf
-DYNAMIC_LINK=FALSE
+DYNAMIC_LINK=false
'
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"
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;
'
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;
'
'
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"
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;
"
'
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)
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)
#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 <<EOF
/* 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)
{
after its associated input section. */
*(info->add.tail) = l->header.next;
l->header.next = info->add.head;
- return TRUE;
+ return true;
}
break;
break;
}
}
- return FALSE;
+ return false;
}
/* 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;
}
#include "libxcoff.h"
#include "xcofflink.h"
-static void gld${EMULATION_NAME}_read_file (const char *, bfd_boolean);
+static void gld${EMULATION_NAME}_read_file (const char *, bool);
static void gld${EMULATION_NAME}_free (void *);
static void gld${EMULATION_NAME}_find_relocs (lang_statement_union_type *);
static void gld${EMULATION_NAME}_find_exp_assignment (etree_type *);
{
ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
- input_flags.dynamic = TRUE;
- config.has_shared = TRUE;
+ input_flags.dynamic = true;
+ config.has_shared = true;
/* The link_info.[init|fini]_functions are initialized in ld/lexsup.c.
Override them here so we can use the link_info.init_function as a
memcpy (*longopts + nl, &xtra_long, sizeof (xtra_long));
}
-static bfd_boolean
+static bool
gld${EMULATION_NAME}_parse_args (int argc, char **argv)
{
int indx;
}
}
}
- return FALSE;
+ return false;
}
/* Helper for option '-f', which specify a list of input files.
fclose (f);
}
-static bfd_boolean
+static bool
gld${EMULATION_NAME}_handle_option (int optc)
{
bfd_signed_vma val;
switch (optc)
{
default:
- return FALSE;
+ return false;
case 0:
/* Long option which just sets a flag. */
ignore the AIX option, because gcc passes it to the linker. */
val = bfd_scan_vma (optarg, &end, 0);
if (*end != '\0')
- return FALSE;
+ return false;
lang_section_start (".text", exp_intop (val), NULL);
break;
break;
case OPTION_AUTOIMP:
- link_info.static_link = FALSE;
+ link_info.static_link = false;
break;
case OPTION_ERNOTOK:
break;
case OPTION_EXPORT:
- gld${EMULATION_NAME}_read_file (optarg, FALSE);
+ gld${EMULATION_NAME}_read_file (optarg, false);
break;
case OPTION_IMPORT:
break;
case OPTION_NOAUTOIMP:
- link_info.static_link = TRUE;
+ link_info.static_link = true;
break;
case OPTION_NOEXPALL:
break;
case OPTION_NOSTRCMPCT:
- link_info.traditional_format = TRUE;
+ link_info.traditional_format = true;
break;
case OPTION_PD:
break;
case OPTION_STRCMPCT:
- link_info.traditional_format = FALSE;
+ link_info.traditional_format = false;
break;
case OPTION_UNIX:
- unix_ld = TRUE;
+ unix_ld = true;
break;
case OPTION_32:
}
- return TRUE;
+ return true;
}
/* This is called when an input file can not be recognized as a BFD
object or an archive. If the file starts with #!, we must treat it
as an import file. This is for AIX compatibility. */
-static bfd_boolean
+static bool
gld${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry)
{
FILE *e;
- bfd_boolean ret;
+ bool ret;
e = fopen (entry->filename, FOPEN_RT);
if (e == NULL)
- return FALSE;
+ return false;
- ret = FALSE;
+ ret = false;
if (getc (e) == '#' && getc (e) == '!')
{
flpp = &(*flpp)->next;
*flpp = n;
- ret = TRUE;
- entry->flags.loaded = TRUE;
+ ret = true;
+ entry->flags.loaded = true;
}
fclose (e);
/* 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))
/* 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"));
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)
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;
}
{
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 ();
}
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;
return;
}
- keep = FALSE;
+ keep = false;
imppath = NULL;
impfile = NULL;
char *start;
(void) obstack_finish (o);
- keep = TRUE;
+ keep = true;
start = s;
while (!ISSPACE (*s) && *s != '(' && *s != '\0')
++s;
{
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;
}
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
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. */
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)
char *path;
if (!entry->flags.maybe_archive)
- return FALSE;
+ return false;
if (entry->flags.full_name_provided)
path = concat (search->name, "/", entry->filename,
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)
{
minfo (" %pT\n", hash_entry->root.string);
}
- return TRUE;
+ return true;
}
struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = {
#include "elf/alpha.h"
#include "elf-bfd.h"
-static bfd_boolean limit_32bit;
+static bool limit_32bit;
-extern bfd_boolean elf64_alpha_use_secureplt;
+extern bool elf64_alpha_use_secureplt;
/* Set the start address as in the Tru64 ld. */
limit_32bit = 1;
break;
case OPTION_SECUREPLT:
- elf64_alpha_use_secureplt = TRUE;
+ elf64_alpha_use_secureplt = true;
break;
case OPTION_NO_SECUREPLT:
- elf64_alpha_use_secureplt = FALSE;
+ elf64_alpha_use_secureplt = false;
break;
'
fprintf (file, _(" --thumb-entry=<sym> Set the entry point to be Thumb symbol <sym>\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;
break;
}
- return TRUE;
+ return true;
}
\f
static 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
#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 <<EOF
/* 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)
{
after its associated input section. */
*(info->add.tail) = l->header.next;
l->header.next = info->add.head;
- return TRUE;
+ return true;
}
break;
break;
}
}
- return FALSE;
+ return false;
}
/* 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;
}
if (params.thumb_entry_symbol)
{
h = bfd_link_hash_lookup (link_info.hash, params.thumb_entry_symbol,
- FALSE, FALSE, TRUE);
+ false, false, true);
}
else
{
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)
/* 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. */
if (bfd_get_flavour (link_info.output_bfd) != bfd_target_elf_flavour)
{
- avr_no_stubs = TRUE;
+ avr_no_stubs = true;
return;
}
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;
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"));
}
{
/* 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"));
}
{
/* 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 ();
}
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
& EF_AVR_LINKRELAX_PREPARED) == 0
&& abfd != stub_file->the_bfd)
{
- avr_link_relax = FALSE;
+ avr_link_relax = false;
break;
}
}
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;
'
}
-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);
set_pe_value ("__image_base__");
break;
}
- return TRUE;
+ return true;
}
\f
/* Assign values to the special symbols before the linker script is
{
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))
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\$)". */
#include "elf32-bfin.h"
/* Whether to put code in Blackfin L1 SRAM. */
-extern bfd_boolean elf32_bfin_code_in_l1;
+extern bool elf32_bfin_code_in_l1;
/* Whether to put (writable) data in Blackfin L1 SRAM. */
-extern bfd_boolean elf32_bfin_data_in_l1;
+extern bool elf32_bfin_data_in_l1;
EOF
PARSE_AND_LIST_ARGS_CASES='
case OPTION_CODE_IN_L1:
- elf32_bfin_code_in_l1 = TRUE;
+ elf32_bfin_code_in_l1 = true;
break;
case OPTION_DATA_IN_L1:
- elf32_bfin_data_in_l1 = TRUE;
+ elf32_bfin_data_in_l1 = true;
break;
'
option.
This is to emulate the CRTools' method of keeping variables
of different alignment in separate sections. */
- config.sort_common = TRUE;
+ config.sort_common = true;
/* Don't create a demand-paged executable, since this feature isn't
meaninful in CR16 embedded systems. Moreover, when magic_demand_paged
is true the link sometimes fails. */
- config.magic_demand_paged = FALSE;
+ config.magic_demand_paged = false;
ldelf_after_parse ();
}
option.
This is to emulate the CRTools' method of keeping variables
of different alignment in separate sections. */
- config.sort_common = TRUE;
+ config.sort_common = true;
/* Don't create a demand-paged executable, since this feature isn't
meaninful in CRX embedded systems. Moreover, when magic_demand_paged
is true the link sometimes fails. */
- config.magic_demand_paged = FALSE;
+ config.magic_demand_paged = false;
ldelf_after_parse ();
}
#include "elf32-csky.h"
/* To use branch stub or not. */
-extern bfd_boolean use_branch_stub;
+extern bool use_branch_stub;
/* Fake input file for stubs. */
static lang_input_statement_type *stub_file;
};
/* 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; l != NULL; lp = &l->header.next, l = *lp)
switch (l->header.type)
after its associated input section. */
*(info->add.tail) = l->header.next;
l->header.next = info->add.head;
- return TRUE;
+ return true;
}
break;
break;
}
- return FALSE;
+ return false;
}
EOF
static void
csky_elf_before_parse (void)
{
- use_branch_stub = FALSE;
+ use_branch_stub = false;
gld${EMULATION_NAME}_before_parse ();
}
EOF
{
if (!(bfd_get_flavour (link_info.output_bfd) == bfd_target_elf_flavour
&& elf_object_id (link_info.output_bfd) == CSKY_ELF_DATA))
- use_branch_stub = FALSE;
+ use_branch_stub = false;
/* If don't use branch stub, just do not emit stub_file. */
if (!use_branch_stub)
/* 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;
}
PARSE_AND_LIST_ARGS_CASES='
case OPTION_BRANCH_STUB:
- use_branch_stub = TRUE;
+ use_branch_stub = true;
break;
case OPTION_NO_BRANCH_STUB:
- use_branch_stub = FALSE;
+ use_branch_stub = false;
break;
case OPTION_STUBGROUP_SIZE:
gld${EMULATION_NAME}_before_parse (void)
{
ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
- 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 <<EOF
if test x"$LDEMUL_AFTER_OPEN" != xgld"$EMULATION_NAME"_after_open; then
- IS_LINUX_TARGET=FALSE
- IS_FREEBSD_TARGET=FALSE
+ IS_LINUX_TARGET=false
+ IS_FREEBSD_TARGET=false
case ${target} in
*-*-linux-* | *-*-k*bsd*-* | *-*-gnu*)
- IS_LINUX_TARGET=TRUE ;;
+ IS_LINUX_TARGET=true ;;
*-*-freebsd* | *-*-dragonfly*)
- IS_FREEBSD_TARGET=TRUE ;;
+ IS_FREEBSD_TARGET=true ;;
esac
- IS_LIBPATH=FALSE
+ IS_LIBPATH=false
if test "x${USE_LIBPATH}" = xyes; then
- IS_LIBPATH=TRUE
+ IS_LIBPATH=true
fi
- IS_NATIVE=FALSE
+ IS_NATIVE=false
if test "x${NATIVE}" = xyes; then
- IS_NATIVE=TRUE
+ IS_NATIVE=true
fi
fragment <<EOF
#define DEFAULT_BUILD_ID_STYLE "sha1"
-static bfd_boolean
+static bool
gld${EMULATION_NAME}_handle_option (int optc)
{
switch (optc)
{
default:
- return FALSE;
+ return false;
case OPTION_BUILD_ID:
free ((char *) ldelf_emit_note_gnu_build_id);
break;
case OPTION_DISABLE_NEW_DTAGS:
- link_info.new_dtags = FALSE;
+ link_info.new_dtags = false;
break;
case OPTION_ENABLE_NEW_DTAGS:
- link_info.new_dtags = TRUE;
+ link_info.new_dtags = true;
break;
case OPTION_EH_FRAME_HDR:
break;
case OPTION_HASH_STYLE:
- link_info.emit_hash = FALSE;
- link_info.emit_gnu_hash = FALSE;
+ link_info.emit_hash = false;
+ link_info.emit_gnu_hash = false;
if (strcmp (optarg, "sysv") == 0)
- link_info.emit_hash = TRUE;
+ link_info.emit_hash = true;
else if (strcmp (optarg, "gnu") == 0)
- link_info.emit_gnu_hash = TRUE;
+ link_info.emit_gnu_hash = true;
else if (strcmp (optarg, "both") == 0)
{
- link_info.emit_hash = TRUE;
- link_info.emit_gnu_hash = TRUE;
+ link_info.emit_hash = true;
+ link_info.emit_gnu_hash = true;
}
else
einfo (_("%F%P: invalid hash style \`%s'\n"), optarg);
else if (strcmp (optarg, "undefs") == 0)
link_info.unresolved_syms_in_objects = RM_IGNORE;
else if (strcmp (optarg, "muldefs") == 0)
- link_info.allow_multiple_definition = TRUE;
+ link_info.allow_multiple_definition = true;
else if (startswith (optarg, "max-page-size="))
{
char *end;
}
else if (strcmp (optarg, "execstack") == 0)
{
- link_info.execstack = TRUE;
- link_info.noexecstack = FALSE;
+ link_info.execstack = true;
+ link_info.noexecstack = false;
}
else if (strcmp (optarg, "noexecstack") == 0)
{
- link_info.noexecstack = TRUE;
- link_info.execstack = FALSE;
+ link_info.noexecstack = true;
+ link_info.execstack = false;
}
else if (strcmp (optarg, "unique-symbol") == 0)
- link_info.unique_symbol = TRUE;
+ link_info.unique_symbol = true;
else if (strcmp (optarg, "nounique-symbol") == 0)
- link_info.unique_symbol = FALSE;
+ link_info.unique_symbol = false;
else if (strcmp (optarg, "globalaudit") == 0)
{
link_info.flags_1 |= DF_1_GLOBAUDIT;
}
else if (startswith (optarg, "start-stop-gc"))
- link_info.start_stop_gc = TRUE;
+ link_info.start_stop_gc = true;
else if (startswith (optarg, "nostart-stop-gc"))
- link_info.start_stop_gc = FALSE;
+ link_info.start_stop_gc = false;
else if (startswith (optarg, "start-stop-visibility="))
{
if (strcmp (optarg, "start-stop-visibility=default") == 0)
else if (strcmp (optarg, "nounique") == 0)
link_info.gnu_flags_1 &= ~(bfd_vma) DF_GNU_1_UNIQUE;
else if (strcmp (optarg, "combreloc") == 0)
- link_info.combreloc = TRUE;
+ link_info.combreloc = true;
else if (strcmp (optarg, "nocombreloc") == 0)
- link_info.combreloc = FALSE;
+ link_info.combreloc = false;
else if (strcmp (optarg, "nocopyreloc") == 0)
- link_info.nocopyreloc = TRUE;
+ link_info.nocopyreloc = true;
EOF
if test -n "$COMMONPAGESIZE"; then
fragment <<EOF
else if (strcmp (optarg, "relro") == 0)
- link_info.relro = TRUE;
+ link_info.relro = true;
else if (strcmp (optarg, "norelro") == 0)
- link_info.relro = FALSE;
+ link_info.relro = false;
EOF
fi
fragment <<EOF
else if (strcmp (optarg, "separate-code") == 0)
- link_info.separate_code = TRUE;
+ link_info.separate_code = true;
else if (strcmp (optarg, "noseparate-code") == 0)
- link_info.separate_code = FALSE;
+ link_info.separate_code = false;
else if (strcmp (optarg, "common") == 0)
link_info.elf_stt_common = elf_stt_common;
else if (strcmp (optarg, "nocommon") == 0)
fragment <<EOF
}
- return TRUE;
+ return true;
}
EOF
static void
gld${EMULATION_NAME}_after_allocation (void)
{
- ldelf_map_segments (FALSE);
+ ldelf_map_segments (false);
}
EOF
# Put these extra routines in ld_${EMULATION_NAME}_emulation
/* 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)
{
before its associated input section. */
*lp = info->add.head;
*(info->add.tail) = l;
- return TRUE;
+ return true;
}
break;
break;
}
}
- return FALSE;
+ return false;
}
/* 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;
}
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 <<EOF
/* Try to open a dynamic archive. This is where we know that Linux
dynamic libraries have an extension of .sa. */
-static bfd_boolean
+static bool
gld${EMULATION_NAME}_open_dynamic_archive
(const char *arch, search_dirs_type *search, lang_input_statement_type *entry)
{
char *string;
if (! entry->flags.maybe_archive || entry->flags.full_name_provided)
- return FALSE;
+ return false;
string = (char *) xmalloc (strlen (search->name)
+ strlen (entry->filename)
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
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)
/* 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)
{
before its associated input section. */
*lp = info->add.head;
*(info->add.tail) = l;
- return TRUE;
+ return true;
}
break;
break;
}
}
- return FALSE;
+ return false;
}
/* 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)
{
before its associated input section. */
*lp = info->add.head;
*(info->add.tail) = l;
- return TRUE;
+ return true;
}
break;
break;
}
}
- return FALSE;
+ return false;
}
/* 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;
}
case ${target} in
*-*-*gnu*)
- gnu_target=TRUE
+ gnu_target=true
;;
*)
- gnu_target=FALSE
+ gnu_target=false
;;
esac
static lang_input_statement_type *stub_file;
static bfd *stub_bfd;
-static bfd_boolean insn32;
-static bfd_boolean ignore_branch_isa;
-static bfd_boolean compact_branches;
+static bool insn32;
+static bool ignore_branch_isa;
+static bool compact_branches;
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)
{
before its associated input section. */
*lp = info->add.head;
*(info->add.tail) = l;
- return TRUE;
+ return true;
}
break;
break;
}
}
- return FALSE;
+ return false;
}
/* Create a new stub section called STUB_SEC_NAME and arrange for it to
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;
'
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 ();
}
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
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);
}
\f
/* To get on-demand global register allocation right, we need to parse the
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
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",
fragment <<EOF
-static bfd_boolean
+static bool
change_output_section (lang_statement_union_type **head,
asection *s,
lang_output_section_statement_type *new_os,
if (old_list->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;
prev = curr;
curr = curr->header.next;
}
- return FALSE;
+ return false;
}
static void
add the {either,lower,upper,none} prefixes\n"));
}
-static bfd_boolean
+static bool
gld${EMULATION_NAME}_handle_option (int optc)
{
switch (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;
{
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
while (i--)
{
- bfd_boolean relax_again;
+ bool relax_again;
link_info.relax_trip = -1;
do
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);
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:
}
l = l->header.next;
}
- return FALSE;
+ return false;
}
/* Some MSP430 linker scripts do not include ALIGN directives to ensure
|| (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)
{
/* 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)
{
*lp = info->add.head;
*(info->add.tail) = l;
}
- return TRUE;
+ return true;
}
break;
break;
}
}
- return FALSE;
+ return false;
}
/* Call-back for elf32_nios2_size_stubs. */
static asection *
nios2elf_add_stub_section (const char *stub_sec_name, asection *input_section,
- bfd_boolean afterp)
+ bool afterp)
{
asection *stub_sec;
flagword flags;
/* 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;
}
{
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. */
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:
break;
}
- return TRUE;
+ return true;
}
/* We need a special case to prepare an additional linker script for option
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
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
/* 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
{
/* 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}
};
#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);
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;
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:
/* Set DLLCharacteristics bits */
set_pe_name ("__dll_characteristics__", pe_dll_characteristics);
- return TRUE;
+ return true;
}
\f
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))
#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;
&& 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. */
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;
{
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;
}
}
*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);
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 */
*found = 1;
}
-static bfd_boolean
+static bool
pecoff_checksum_contents (bfd *abfd,
void (*process) (const void *, size_t, void *),
void *arg)
filepos += 1;
}
- return TRUE;
+ return true;
}
-static bfd_boolean
+static bool
write_build_id (bfd *abfd)
{
struct pe_tdata *t = pe_data (abfd);
{
einfo (_("%P: warning: .buildid section discarded,"
" --build-id ignored\n"));
- return TRUE;
+ return true;
}
if (t->build_id.sec->contents == NULL)
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;
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
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
/* 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)
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. */
}
#endif /* DLL_SUPPORT */
-static bfd_boolean
+static bool
gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED)
{
#ifdef DLL_SUPPORT
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)
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
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
if (pe_bfd_is_dll (entry->the_bfd))
return pe_implied_import_dll (entry->filename);
#endif
- return FALSE;
+ return false;
}
static 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
return os;
}
-static bfd_boolean
+static bool
gld_${EMULATION_NAME}_open_dynamic_archive
(const char *arch ATTRIBUTE_UNUSED,
search_dirs_type *search,
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 "<prefix>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;
if (! entry->flags.maybe_archive || entry->flags.full_name_provided)
- return FALSE;
+ return false;
filename = entry->filename;
if (!libname_fmt[i].format)
{
free (full_string);
- return FALSE;
+ return false;
}
entry->filename = full_string;
- return TRUE;
+ return true;
}
static int
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
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. */
/* 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) \
{
/* 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}
};
#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);
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;
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:
/* Set DLLCharacteristics bits */
set_pep_name ("__dll_characteristics__", pe_dll_characteristics);
- return TRUE;
+ return true;
}
\f
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))
#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;
&& h->root.string[sl] == '@')
{
pep_undef_found_sym = h;
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
static void
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 */
*found = 1;
}
-static bfd_boolean
+static bool
pecoff_checksum_contents (bfd *abfd,
void (*process) (const void *, size_t, void *),
void *arg)
filepos += 1;
}
- return TRUE;
+ return true;
}
-static bfd_boolean
+static bool
write_build_id (bfd *abfd)
{
struct pe_tdata *t = pe_data (abfd);
{
einfo (_("%P: warning: .buildid section discarded,"
" --build-id ignored\n"));
- return TRUE;
+ return true;
}
if (t->build_id.sec->contents == NULL)
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;
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
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
/* 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)
}
#endif /* DLL_SUPPORT */
-static bfd_boolean
+static bool
gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED)
{
#ifdef DLL_SUPPORT
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)
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
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 ();
if (pep_bfd_is_dll (entry->the_bfd))
return pep_implied_import_dll (entry->filename);
#endif
- return FALSE;
+ return false;
}
static void
return os;
}
-static bfd_boolean
+static bool
gld_${EMULATION_NAME}_open_dynamic_archive
(const char *arch ATTRIBUTE_UNUSED,
search_dirs_type *search,
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 "<prefix>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;
if (! entry->flags.maybe_archive || entry->flags.full_name_provided)
- return FALSE;
+ return false;
filename = entry->filename;
if (!libname_fmt[i].format)
{
free (full_string);
- return FALSE;
+ return false;
}
entry->filename = full_string;
- return TRUE;
+ return true;
}
static int
{
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 ();
}
if grep -q 'ld_elf32_spu_emulation' ldemul-list.h; then
fragment <<EOF
/* Special handling for embedded SPU executables. */
-extern bfd_boolean embedded_spu_file (lang_input_statement_type *, const char *);
+extern bool embedded_spu_file (lang_input_statement_type *, const char *);
-static bfd_boolean
+static bool
ppc_recognized_file (lang_input_statement_type *entry)
{
if (embedded_spu_file (entry, "-m32"))
- return TRUE;
+ return true;
return ldelf_load_symbols (entry);
}
case OPTION_TRADITIONAL_FORMAT:
notlsopt = 1;
params.no_tls_get_addr_opt = 1;
- return FALSE;
+ return false;
case OPTION_PPC476_WORKAROUND:
params.ppc476_workaround = 1;
{
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 ();
}
/* 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)
{
before its associated input section. */
*lp = info->add.head;
*(info->add.tail) = l;
- return TRUE;
+ return true;
}
break;
break;
}
}
- return FALSE;
+ return false;
}
/* 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);
if grep -q 'ld_elf32_spu_emulation' ldemul-list.h; then
fragment <<EOF
/* Special handling for embedded SPU executables. */
-extern bfd_boolean embedded_spu_file (lang_input_statement_type *, const char *);
+extern bool embedded_spu_file (lang_input_statement_type *, const char *);
-static bfd_boolean
+static bool
ppc64_recognized_file (lang_input_statement_type *entry)
{
if (embedded_spu_file (entry, "-m64"))
- return TRUE;
+ return true;
return ldelf_load_symbols (entry);
}
no_toc_sort = 1;
params.plt_static_chain = 1;
params.no_pcrel_opt = 1;
- return FALSE;
+ return false;
'
# Put these extra ppc64elf routines in ld_${EMULATION_NAME}_emulation
#include "elf32-rx.h"
-static bfd_boolean no_flag_mismatch_warnings = TRUE;
-static bfd_boolean ignore_lma = TRUE;
+static bool no_flag_mismatch_warnings = true;
+static bool ignore_lma = true;
/* This is a convenient point to tell BFD about target specific flags.
After the output has been created, but before inputs are read. */
static void
rx_elf_create_output_section_statements (void)
{
- extern void bfd_elf32_rx_set_target_flags (bfd_boolean, bfd_boolean);
+ extern void bfd_elf32_rx_set_target_flags (bool, bool);
bfd_elf32_rx_set_target_flags (no_flag_mismatch_warnings, ignore_lma);
}
PARSE_AND_LIST_ARGS_CASES='
case OPTION_NO_FLAG_MISMATCH_WARNINGS:
- no_flag_mismatch_warnings = TRUE;
+ no_flag_mismatch_warnings = true;
break;
case OPTION_FLAG_MISMATCH_WARNINGS:
- no_flag_mismatch_warnings = FALSE;
+ no_flag_mismatch_warnings = false;
break;
case OPTION_IGNORE_LMA:
- ignore_lma = TRUE;
+ ignore_lma = true;
break;
case OPTION_NO_IGNORE_LMA:
- ignore_lma = FALSE;
+ ignore_lma = false;
break;
'
static void
rx_linux_create_output_section_statements (void)
{
- extern void bfd_elf32_rx_set_target_flags (bfd_boolean, bfd_boolean);
+ extern void bfd_elf32_rx_set_target_flags (bool, bool);
- bfd_elf32_rx_set_target_flags (FALSE, FALSE);
+ bfd_elf32_rx_set_target_flags (false, false);
}
EOF
#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 <<EOF
/* Lookup symbol. */
h = elf_link_hash_lookup (elf_hash_table (&link_info), *sym,
- FALSE, FALSE, FALSE);
+ false, false, false);
if (h == NULL)
continue;
/* Lookup symbol. */
h = elf_link_hash_lookup (elf_hash_table (&link_info), *sym,
- FALSE, FALSE, FALSE);
+ false, false, false);
if (h == NULL)
continue;
{
/* Create a version pattern for this symbol. Some of them start
off as local, others as global, so try both. */
- globals = lang_new_vers_pattern (globals, *sym, NULL, TRUE);
- locals = lang_new_vers_pattern (locals, *sym, NULL, TRUE);
+ globals = lang_new_vers_pattern (globals, *sym, NULL, true);
+ locals = lang_new_vers_pattern (locals, *sym, NULL, true);
}
/* New version node for those symbols. */
push_stat_ptr (&os->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);
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
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);
/* 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];
|| 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));
fd = new_tmp_file (&oname);
if (fd == -1)
- return FALSE;
+ return false;
close (fd);
for (search = (void *) input_file_chain.head;
}
}
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. */
/* 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
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')
}
break;
}
- return FALSE;
+ return false;
}
static void
#include "ldctor.h"
#include "elf32-v850.h"
-static bfd_boolean
+static bool
is_v850_target (void)
{
extern const bfd_target v850_elf32_vec;
gld${EMULATION_NAME}_before_parse (void)
{
ldfile_set_output_arch ("${ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
- input_flags.dynamic = TRUE;
- config.has_shared = FALSE; /* Not yet. */
+ input_flags.dynamic = true;
+ config.has_shared = false; /* Not yet. */
/* For ia64, harmless for alpha. */
- link_info.emit_hash = FALSE;
+ link_info.emit_hash = false;
link_info.spare_dynamic_tags = 0;
}
/* Try to open a dynamic archive. This is where we know that VMS
shared images (dynamic libraries) have an extension of .exe. */
-static bfd_boolean
+static bool
gld${EMULATION_NAME}_open_dynamic_archive (const char *arch ATTRIBUTE_UNUSED,
search_dirs_type *search,
lang_input_statement_type *entry)
char *string;
if (! entry->flags.maybe_archive || entry->flags.full_name_provided)
- return FALSE;
+ return false;
string = (char *) xmalloc (strlen (search->name)
+ strlen (entry->filename)
if (! ldfile_try_open_bfd (string, entry))
{
free (string);
- return FALSE;
+ return false;
}
entry->filename = string;
- return TRUE;
+ return true;
}
static int
fprintf (file, _(" --identification <string> 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
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
}
-static bfd_boolean
+static bool
replace_insn_sec_with_prop_sec (bfd *abfd,
const char *insn_sec_name,
const char *prop_sec_name,
*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)
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)
free (insn_contents);
- return TRUE;
+ return true;
cleanup:
if (prop_sec && prop_sec->owner)
free (insn_contents);
free (internal_relocs);
- return FALSE;
+ return false;
}
}
-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)
}
else if (num != elf32xtensa_abi)
{
- *pmismatch = TRUE;
+ *pmismatch = true;
*pmsg = "ABI does not match";
}
}
{
if (num != XSHAL_USE_ABSOLUTE_LITERALS)
{
- *pmismatch = TRUE;
+ *pmismatch = true;
*pmsg = "incompatible use of the Extended L32R option";
}
}
goto error;
}
- return TRUE;
+ return true;
error:
- return FALSE;
+ return false;
}
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))
{
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
{
reloc_deps_e *preds;
reloc_deps_e *succs;
- bfd_boolean is_only_literal;
+ bool is_only_literal;
};
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
}
-static bfd_boolean
+static bool
section_is_source (const reloc_deps_graph *deps ATTRIBUTE_UNUSED,
lang_statement_union_type *s)
{
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);
}
-static bfd_boolean
+static bool
section_is_target (const reloc_deps_graph *deps ATTRIBUTE_UNUSED,
lang_statement_union_type *s)
{
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);
}
-static bfd_boolean
+static bool
section_is_source_or_target (const reloc_deps_graph *deps ATTRIBUTE_UNUSED,
lang_statement_union_type *s)
{
/* 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)
{
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));
if (*stack_p != NULL)
(*stack_p)->prev = stack;
*stack_p = stack;
- return TRUE;
+ return true;
}
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;
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)
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:
}
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)
{
iter_stack_copy_current (stack_p, front_p);
if (!is_target)
- in_literals = FALSE;
+ in_literals = false;
}
else
{
front_p->loc = &(*front_p->loc)->header.next;
/* Do not increment the current pointer. */
- skip_increment = TRUE;
+ skip_increment = true;
}
}
}
}
-static bfd_boolean
+static bool
deps_has_sec_edge (const reloc_deps_graph *deps, asection *src, asection *tgt)
{
const reloc_deps_section *sec_deps;
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;
{
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);
/* 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
{
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;
static int linkonce_len = sizeof (".gnu.linkonce.") - 1;
-static bfd_boolean
+static bool
is_inconsistent_linkonce_section (asection *sec)
{
bfd *abfd = sec->owner;
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. */
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;
}
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)
{
if (l->spec.sorted == by_name)
{
- no_reorder = TRUE;
+ no_reorder = true;
break;
}
}
&& ((strcmp (".init", l->spec.name) == 0)
|| (strcmp (".fini", l->spec.name) == 0)))
{
- no_reorder = TRUE;
+ no_reorder = true;
break;
}
}
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;
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);
/* Place it here. */
lit->header.next = *s_p;
*s_p = lit;
- placed = TRUE;
+ placed = true;
break;
}
}
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);
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. */
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);
{
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);
}
}
-static bfd_boolean
+static bool
ld_local_file_relocations_fit (lang_statement_union_type *statement,
const reloc_deps_graph *deps ATTRIBUTE_UNUSED)
{
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;
}
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);
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)
{
|| (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)
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;
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);
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. */
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;
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;
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;
#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
return 0;
}
-bfd_boolean
+bool
generate_build_id (bfd *abfd,
const char *style,
checksum_fn checksum_contents,
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"))
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"))
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;
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,
else
abort (); /* Should have been validated earlier. */
- return TRUE;
+ return true;
}
#ifndef LDBUILDID_H
#define LDBUILDID_H
-extern bfd_boolean
+extern bool
validate_build_id_style (const char *);
extern bfd_size_type
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 */
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 *);
#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. */
/* Whether the cref hash table has been initialized. */
-static bfd_boolean cref_initialized;
+static bool cref_initialized;
/* The number of symbols seen so far. */
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"));
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)
{
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;
}
}
}
- return TRUE;
+ return true;
}
if (act == notice_not_needed)
/* 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;
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;
++*pph;
- return TRUE;
+ return true;
}
/* Sort an array of cref hash table entries by name. */
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);
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)
/* 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;
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)
{
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. */
break;
}
- return TRUE;
+ return true;
}
/* The struct is used to pass information from check_refs to
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
static void
check_refs (const char *name,
- bfd_boolean global,
+ bool global,
asection *sec,
bfd *abfd,
struct lang_nocrossrefs *ncrs)
const char *outdefsecname;
struct lang_nocrossref *ncr;
const char *symname;
- bfd_boolean global;
+ bool global;
long relsize;
arelent **relpp;
long relcount;
/* 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;
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)
{
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;
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)
if (!header_printed)
{
minfo (_("\nSet Symbol\n\n"));
- header_printed = TRUE;
+ header_printed = true;
}
minfo ("%s", p->h->root.string);
/* 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. */
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)
/* Handle the generation of DT_NEEDED tags. */
-bfd_boolean
+bool
ldelf_load_symbols (lang_input_statement_type *entry)
{
int link_class = 0;
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
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;
}
}
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;
{
if (verbose)
info_msg (_("attempt to open %s failed\n"), name);
- return FALSE;
+ return false;
}
track_dependency_files (name);
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
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
if (l == NULL)
{
bfd_close (abfd);
- return FALSE;
+ return false;
}
}
}
{
/* 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. */
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)
{
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;
needed.name = filename;
if (ldelf_try_needed (&needed, force, is_linux))
- return TRUE;
+ return true;
free (filename);
path = s + 1;
}
- return FALSE;
+ return false;
}
/* Prefix the sysroot to absolute paths in PATH, a string containing
#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;
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
size_t len, alloc;
};
-static bfd_boolean
+static bool
ldelf_parse_ld_so_conf (struct ldelf_ld_so_conf *, const char *);
static void
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);
size_t linelen;
if (f == NULL)
- return FALSE;
+ return false;
linelen = 256;
line = xmalloc (linelen);
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;
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. */
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)
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
elfbfd = abfd;
- warn_eh_frame = TRUE;
+ warn_eh_frame = true;
}
}
&& bfd_set_section_alignment (s, 2))
{
htab->eh_info.hdr_sec = s;
- warn_eh_frame = FALSE;
+ warn_eh_frame = false;
}
}
if (warn_eh_frame)
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;
}
return size;
}
-static bfd_boolean
+static bool
write_build_id (bfd *abfd)
{
const struct elf_backend_data *bed = get_elf_backend_data (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;
/* Make .note.gnu.build-id section, and set up elf_tdata->build_id. */
-bfd_boolean
+bool
ldelf_setup_build_id (bfd *ibfd)
{
asection *s;
if (size == 0)
{
einfo (_("%P: warning: unrecognized --build-id style ignored\n"));
- return FALSE;
+ return false;
}
flags = (SEC_ALLOC | SEC_LOAD | SEC_IN_MEMORY
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. */
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.
{
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. */
{
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
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);
if (!opened && !ldfile_try_open_bfd (string, entry))
{
free (string);
- return FALSE;
+ return false;
}
entry->filename = string;
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. */
/* 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
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. */
&& (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);
}
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);
/* 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)
{
&& (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)
{
{
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;
|| ((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;
/* 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;
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
}
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)
{
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)
{
}
if (os_info->count > 1
&& fixup_link_order (os))
- need_layout = TRUE;
+ need_layout = true;
}
}
}
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;
}
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);
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 *
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 *
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)
{
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;
}
}
void
after_allocation_default (void)
{
- lang_relax_sections (FALSE);
+ lang_relax_sections (false);
}
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);
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)
(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**);
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 {
/* 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);
/* 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. */
/* 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. */
/* 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
/* 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;
{
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);
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;
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;
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;
{
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;
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
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;
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)
/* OK. */
}
else
- expld.result.valid_p = FALSE;
+ expld.result.valid_p = false;
}
static void
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:
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:
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;
seg->relro_end = 0;
}
else
- expld.result.valid_p = FALSE;
+ expld.result.valid_p = false;
}
}
}
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
seg->phase = exp_seg_relro_seen;
}
else
- expld.result.valid_p = FALSE;
+ expld.result.valid_p = false;
}
static void
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;
}
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
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)
{
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
{
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
/* Return true if TREE is '.'. */
-static bfd_boolean
+static bool
is_dot (const etree_type *tree)
{
return (tree->type.node_class == etree_name
/* 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
/* 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;
&& (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
/* 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
/* 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
/* 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
&& is_dot_ne_0 (tree->trinary.cond)
&& is_value (tree->trinary.rhs, 1));
}
- return FALSE;
+ return false;
}
static void
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
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
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);
{
expld.result.value = 0;
expld.result.section = NULL;
- expld.result.valid_p = TRUE;
+ expld.result.valid_p = true;
}
if (expld.result.valid_p)
{
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;
}
}
}
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;
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;
exp_assop (const char *dst,
etree_type *src,
enum node_tree_enum class,
- bfd_boolean hidden)
+ bool hidden)
{
etree_type *n;
/* 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);
}
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);
}
void
exp_print_tree (etree_type *tree)
{
- bfd_boolean function_like;
+ bool function_like;
if (config.map_file == NULL)
config.map_file = stderr;
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:
fputc (')', config.map_file);
break;
case etree_binary:
- function_like = FALSE;
+ function_like = false;
switch (tree->type.node_code)
{
case MAX_K:
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);
}
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);
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;
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, " (");
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);
}
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;
{
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)
h->u.def.section = def->final_sec;
}
}
- return TRUE;
+ return true;
}
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
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
bfd_vma value;
char *str;
asection *section;
- bfd_boolean valid_p;
+ bool valid_p;
} etree_value_type;
enum node_tree_enum {
node_type type;
const char *dst;
union etree_union *src;
- bfd_boolean hidden;
+ bool hidden;
} assign;
struct {
node_type type;
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.
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. */
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
(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
#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;
/* 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]))
{
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;
/* 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)
{
{
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);
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)
/* 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;
token = yylex ();
}
ldlex_popstate ();
- ldfile_assumed_script = FALSE;
+ ldfile_assumed_script = false;
fclose (yyin);
yyin = NULL;
if (skip)
attempt, entry->local_sym_name);
bfd_close (entry->the_bfd);
entry->the_bfd = NULL;
- return FALSE;
+ return false;
}
}
goto success;
attempt);
bfd_close (entry->the_bfd);
entry->the_bfd = NULL;
- return FALSE;
+ return false;
}
if (entry->flags.search_dirs
attempt, entry->local_sym_name);
bfd_close (entry->the_bfd);
entry->the_bfd = NULL;
- return FALSE;
+ return false;
}
}
}
/* 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,
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)
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)
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.
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
if (ldfile_try_open_bfd (path, entry))
{
entry->filename = path;
- entry->flags.search_dirs = FALSE;
+ entry->flags.search_dirs = false;
return;
}
/* 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
}
}
- entry->flags.missing_file = TRUE;
- input_flags.missing_file = TRUE;
+ entry->flags.missing_file = true;
+ input_flags.missing_file = true;
}
}
}
/* Try to open NAME. */
static FILE *
-try_open (const char *name, bfd_boolean *sysrooted)
+try_open (const char *name, bool *sysrooted)
{
FILE *result;
/* 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);
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;
{
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;
}
}
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;
#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;
/* 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;
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
(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);
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
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;
mri_script_lines END
{ ldlex_popstate (); }
| START NAME
- { lang_add_entry ($2, FALSE); }
+ { lang_add_entry ($2, false); }
|
;
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:
| 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 ')'
| 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 (); }
(char *)NULL); }
| AS_NEEDED '('
{ $<integer>$ = 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 = $<integer>3; }
| input_list1 ',' AS_NEEDED '('
{ $<integer>$ = 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 = $<integer>5; }
| input_list1 AS_NEEDED '('
{ $<integer>$ = 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 = $<integer>4; }
;
statement_anywhere:
ENTRY '(' NAME ')'
- { lang_add_entry ($3, FALSE); }
+ { lang_add_entry ($3, false); }
| assignment end
| ASSERT_K {ldlex_expression ();} '(' exp ',' NAME ')'
{ ldlex_popstate ();
n->with = with_flags;
n->name = $1;
}
- n->valid = FALSE;
+ n->valid = false;
n->next = NULL;
$$ = n;
}
n->with = with_flags;
n->name = $3;
}
- n->valid = FALSE;
+ n->valid = false;
n->next = $1;
$$ = n;
}
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;
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:
}
| SORT_BY_NAME '(' CONSTRUCTORS ')'
{
- constructors_sorted = TRUE;
+ constructors_sorted = true;
lang_add_attribute (lang_constructors_statement_enum);
}
| input_section_spec
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
{
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));
}
;
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
{}
floating_point_support:
FLOAT
- { lang_float(TRUE); }
+ { lang_float(true); }
| NOFLOAT
- { lang_float(FALSE); }
+ { lang_float(false); }
;
nocrossref_list:
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
n = ((struct lang_output_section_phdr_list *)
xmalloc (sizeof *n));
n->name = $3;
- n->used = FALSE;
+ n->used = false;
n->next = $1;
$$ = n;
}
{
$$ = $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
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 '{'
{
}
| 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);
}
;
#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;
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;
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;
/* 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)
{
return match;
}
-static bfd_boolean
+static bool
unique_section_p (const asection *sec,
const lang_output_section_statement_type *os)
{
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. */
/* 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)
{
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
&& 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
while (sec != NULL)
{
- bfd_boolean skip = FALSE;
+ bool skip = false;
if (sec->spec.name != NULL)
{
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);
/* 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
(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);
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);
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)
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,
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)
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);
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)
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,
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, "?*[");
{
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,
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;
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;
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 ();
= &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;
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;
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. */
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)
{
/* .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)
previous section. */
break;
found = look;
- seen_thread_local = TRUE;
+ seen_thread_local = true;
}
else if (seen_thread_local)
break;
{
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;
{
if (!ignore_first)
assign = where;
- ignore_first = FALSE;
+ ignore_first = false;
}
}
continue;
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)
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;
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;
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
/* 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;
{
if (stmt->bfd_section == after_sec)
{
- place_after = TRUE;
- found = TRUE;
+ place_after = true;
+ found = true;
after = stmt;
break;
}
AFTER_SEC output statement. */
if (next && next->bfd_section == after_sec)
{
- place_after = TRUE;
- found = TRUE;
+ place_after = true;
+ found = true;
after = stmt;
break;
}
{
if (stmt->bfd_section == after_sec)
{
- place_after = TRUE;
+ place_after = true;
after = stmt;
break;
}
AFTER_SEC output statement. */
if (stmt->next->bfd_section == after_sec)
{
- place_after = TRUE;
+ place_after = true;
after = stmt;
break;
}
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)
{
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);
}
}
config.map_file);
}
-static bfd_boolean
+static bool
sort_def_symbol (struct bfd_link_hash_entry *hash_entry,
void *info ATTRIBUTE_UNUSED)
{
ud->map_symbol_def_tail = &def->next;
ud->map_symbol_def_count++;
}
- return TRUE;
+ return true;
}
/* Initialize an output section. */
/* 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. */
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;
}
{
flagword flags = section->flags;
- bfd_boolean discard;
+ bool discard;
lang_input_section_type *new_section;
bfd *abfd = link_info.output_bfd;
/* 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)
{
if (sflag_info)
{
- bfd_boolean keep;
+ bool keep;
keep = bfd_lookup_section_flags (&link_info, sflag_info, section);
if (!keep)
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
&& 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);
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
if (strcmp (lib->name, "ALL") == 0)
{
- abfd->no_export = TRUE;
+ abfd->no_export = true;
return;
}
|| (filename[len] == '.' && filename[len + 1] == 'a'
&& filename[len + 2] == '\0')))
{
- abfd->no_export = TRUE;
+ abfd->no_export = true;
return;
}
/* 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);
/* See if the emulation has some special knowledge. */
if (ldemul_unrecognized_file (entry))
- return TRUE;
+ return true;
if (err == bfd_error_file_ambiguously_recognized)
{
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
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
if (entry->flags.whole_archive)
{
bfd *member = NULL;
- bfd_boolean loaded = TRUE;
+ bool loaded = true;
for (;;)
{
{
einfo (_("%F%P: %pB: member %pB in archive is not an object\n"),
entry->the_bfd, member);
- loaded = FALSE;
+ loaded = false;
}
subsbfd = member;
if (!bfd_link_add_symbols (subsbfd, &link_info))
{
einfo (_("%F%P: %pB: error adding symbols: %E\n"), member);
- loaded = FALSE;
+ loaded = false;
}
}
}
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);
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);
&& 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)
{
#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;
{
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);
}
}
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;
}
{
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);
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))
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;
{
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 ();
}
os = os->next)
{
asection *output_section;
- bfd_boolean exclude;
+ bool exclude;
if (os->constraint < 0)
continue;
&& ((s->flags & SEC_LINKER_CREATED) != 0
|| link_info.emitrelocations))
{
- exclude = FALSE;
+ exclude = false;
break;
}
}
/* 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--;
/* 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
lang_output_section_statement_type *output_section)
{
unsigned int i;
- bfd_boolean is_dot;
+ bool is_dot;
etree_type *tree;
asection *osec;
if (assignment->exp->type.node_class == etree_assert)
{
- is_dot = FALSE;
+ is_dot = false;
tree = assignment->exp->assert_s.child;
}
else
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)
{
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))
/* 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;
minfo (" %pT\n", hash_entry->root.string);
}
- return TRUE;
+ return true;
}
static int
/* 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;
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);
(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);
struct check_sec
{
asection *sec;
- bfd_boolean warned;
+ bool warned;
};
static int
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 <<
continue;
sections[count].sec = s;
- sections[count].warned = FALSE;
+ sections[count].warned = false;
count++;
}
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;
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;
}
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,
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)
{
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)
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,
/* 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)
{
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
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);
/* 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)
{
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
else
{
prev = &s->header.next;
- removed_prev_s = FALSE;
+ removed_prev_s = false;
}
}
return dot;
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;
/* 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)
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
}
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)
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
&& 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
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;
}
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;
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)
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. */
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)
{
if ((os->bfd_section->flags & SEC_ALLOC) != 0)
{
current_section = os;
- prefer_next_section = FALSE;
+ prefer_next_section = false;
}
dot = os->bfd_section->vma;
}
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
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,
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;
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. */
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)
/* 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)
/* 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;
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))
if (config.map_file != NULL)
{
- static bfd_boolean header_printed;
+ static bool header_printed;
int len;
char *name;
char buf[50];
{
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,
minfo ("%pB\n", section->owner);
}
- return TRUE;
+ return true;
}
/* Handle a single orphan section S, placing the orphan into an appropriate
if (!had_output_filename || !from_script)
{
output_filename = name;
- had_output_filename = TRUE;
+ had_output_filename = true;
}
}
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)
&& !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;
}
}
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;
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. */
&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)
{
while (i--)
{
/* Keep relaxing until bfd_relax_section gives up. */
- bfd_boolean relax_again;
+ bool relax_again;
link_info.relax_trip = -1;
do
/* 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)
/* 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);
}
}
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;
/* 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;
}
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. */
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;
/* 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)
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);
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
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;
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)
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
switch (*name)
{
case 'F':
- map_option_f = TRUE;
+ map_option_f = true;
break;
}
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;
}
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
&& 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"),
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;
{
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;
}
secs[c] = os->bfd_section;
++c;
- pl->used = TRUE;
+ pl->used = true;
}
}
}
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. */
lang_add_nocrossref_to (lang_nocrossref_type *l)
{
lang_add_nocrossref (l);
- nocrossref_list->onlyfirst = TRUE;
+ nocrossref_list->onlyfirst = true;
}
\f
/* Overlay handling. We handle overlays with some static variables. */
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);
exp_binop ('+',
exp_nameop (LOADADDR, name),
exp_nameop (SIZEOF, name)),
- FALSE));
+ false));
free (clean);
}
lang_get_regions (®ion, &lma_region,
memspec, lma_memspec,
- lma_expr != NULL, FALSE);
+ lma_expr != NULL, false);
nocrossref = NULL;
{
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;
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)
{
/* Remove the preceding backslash. */
*(s - 1) = *p;
- backslash = FALSE;
- changed = TRUE;
+ backslash = false;
+ changed = true;
}
else
{
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;
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)
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;
}
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);
}
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;
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);
}
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);
}
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;
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
{
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
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);
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. */
{
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;
{
lang_statement_header_type header;
const char *where;
- bfd_boolean is_before;
+ bool is_before;
} lang_insert_statement_type;
typedef union lang_statement_union
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;
};
{
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
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;
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
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
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 *);
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
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
(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 *);
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
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;
(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 *);
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
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";
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;
(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 *,
(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 *,
(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);
(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);
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);
}
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);
}
}
#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
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;
#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 ("");
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)
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 ());
config.map_filename);
}
}
- link_info.has_map_file = TRUE;
+ link_info.has_map_file = true;
}
lang_process ();
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"));
}
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"));
}
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"));
}
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"));
}
}
/* 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,
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;
}
}
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
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;
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
|| 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
static void
constructor_callback (struct bfd_link_info *info,
- bfd_boolean constructor,
+ bool constructor,
const char *name,
bfd *abfd,
asection *section,
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)
struct warning_callback_info
{
- bfd_boolean found;
+ bool found;
const char *warning;
const char *symbol;
asymbol **asymbols;
/* 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;
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);
/* 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;
}
}
bfd *abfd,
asection *section,
bfd_vma address,
- bfd_boolean error)
+ bool error)
{
static char *error_name;
static unsigned int error_count;
#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)
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,
{
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);
if (command_line.cref || nocrossref_list != NULL)
add_cref (name, abfd, section, value);
- return TRUE;
+ return true;
}
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;
*/
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;
case 'X':
/* no object output, fail return */
- config.make_executable = FALSE;
+ config.make_executable = false;
break;
case 'V':
case 'F':
/* Error is fatal. */
- fatal = TRUE;
+ fatal = true;
break;
case 'P':
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;
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,
free (last_function);
last_function = xstrdup (functionname);
}
- discard_last = FALSE;
+ discard_last = false;
}
else
lfinfo (fp, "%pB:", abfd);
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);
}
if (is_warning && config.fatal_warnings)
- config.make_executable = FALSE;
+ config.make_executable = false;
if (fatal)
xexit (1);
va_list arg;
va_start (arg, fmt);
- vfinfo (stdout, fmt, arg, FALSE);
+ vfinfo (stdout, fmt, arg, false);
va_end (arg);
}
fflush (stdout);
va_start (arg, fmt);
- vfinfo (stderr, fmt, arg, TRUE);
+ vfinfo (stderr, fmt, arg, true);
va_end (arg);
fflush (stderr);
}
asneeded_list_tail = &m->next;
}
else
- vfinfo (config.map_file, fmt, arg, FALSE);
+ vfinfo (config.map_file, fmt, arg, false);
va_end (arg);
}
}
va_list arg;
va_start (arg, fmt);
- vfinfo (file, fmt, arg, FALSE);
+ vfinfo (file, fmt, arg, false);
va_end (arg);
}
\f
#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 *, ...);
/* 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"))
".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
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. */
``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;
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;
lex_string = NULL;
break;
case OPTION_DEMANGLE:
- demangling = TRUE;
+ demangling = true;
if (optarg != NULL)
{
enum demangling_styles style;
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)
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':
{
/* 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);
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;
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
#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<non-digits> <value>" used to set the address of
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:
break;
#endif /* BFD_SUPPORTS_PLUGINS */
case 'q':
- link_info.emitrelocations = TRUE;
+ link_info.emitrelocations = true;
break;
case 'i':
case 'r':
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
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)
optarg);
break;
case OPTION_STATS:
- config.stats = TRUE;
+ config.stats = true;
break;
case OPTION_SYMBOLIC:
opt_symbolic = symbolic;
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))
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);
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)
{
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);
{
struct bfd_elf_version_expr *expr
= lang_new_vers_pattern (NULL, xstrdup (optarg), NULL,
- FALSE);
+ false);
lang_append_dynamic_list (&export_list, expr);
}
break;
}
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);
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 ();
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;
break;
case OPTION_PRINT_MEMORY_USAGE:
- command_line.print_memory_usage = TRUE;
+ command_line.print_memory_usage = true;
break;
case OPTION_ORPHAN_HANDLING:
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:
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;
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;
}
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;
}
break;
case symbolic_functions:
- link_info.dynamic = TRUE;
- link_info.dynamic_data = TRUE;
+ link_info.dynamic = true;
+ link_info.dynamic_data = true;
break;
}
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;
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;
}
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;
{
if (ld_options[i].doc != NULL)
{
- bfd_boolean comma;
+ bool comma;
unsigned j;
printf (" ");
- comma = FALSE;
+ comma = false;
len = 2;
j = i;
printf ("%s", _(ld_options[j].arg));
len += strlen (_(ld_options[j].arg));
}
- comma = TRUE;
+ comma = true;
}
++j;
}
printf (" %s", _(ld_options[j].arg));
len += 1 + strlen (_(ld_options[j].arg));
}
- comma = TRUE;
+ comma = true;
}
++j;
}
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)
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);
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
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
{
unsigned int imagebase_reloc;
int pe_arch;
int bfd_arch;
- bfd_boolean underscored;
+ bool underscored;
const autofilter_entry_type* autofilter_symbollist;
}
pe_details_type;
PE_ARCH_i386,
bfd_arch_i386,
#ifdef pe_use_x86_64
- FALSE,
+ false,
#else
- TRUE,
+ true,
#endif
autofilter_symbollist_i386
},
3 /* R_IMAGEBASE */,
PE_ARCH_i386,
bfd_arch_i386,
- FALSE,
+ false,
autofilter_symbollist_i386
},
#else
7 /* R_IMAGEBASE */,
PE_ARCH_i386,
bfd_arch_i386,
- TRUE,
+ true,
autofilter_symbollist_i386
},
#endif
16 /* R_SH_IMAGEBASE */,
PE_ARCH_sh,
bfd_arch_sh,
- TRUE,
+ true,
autofilter_symbollist_generic
},
{
34 /* MIPS_R_RVA */,
PE_ARCH_mips,
bfd_arch_mips,
- FALSE,
+ false,
autofilter_symbollist_generic
},
{
11 /* ARM_RVA32 */,
PE_ARCH_arm,
bfd_arch_arm,
- TRUE,
+ true,
autofilter_symbollist_generic
},
{
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;
free (local_copy);
}
-static bfd_boolean
+static bool
is_import (const char* n)
{
return (startswith (n, "__imp_"));
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 ();
{
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)
{
/* 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)));
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)
if (NE == 0)
return;
- resort_needed = FALSE;
+ resort_needed = false;
/* Canonicalize the export list. */
if (pe_dll_kill_ats)
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;
}
}
}
blhe = bfd_link_hash_lookup (info->hash,
name,
- FALSE, FALSE, TRUE);
+ false, false, true);
if (blhe
&& (blhe->type == bfd_link_hash_defined
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;
/* 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);
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;
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);
"command line; this should work unless it "
"involves constant data structures referencing "
"symbols from auto-imported DLLs\n"));
- warned = TRUE;
+ warned = true;
}
}
}
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)
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;
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;
}
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);
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;
}
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. */
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
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;
}
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;
}
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;
}
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;
}
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;
}
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)
udef_table[undef_count].oname = h->root.string;
undef_count++;
}
- return TRUE;
+ return true;
}
static void
/* 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);
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 <sym> only if the <sym>
is undefined. */
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);
}
{
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);
}
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;
if (!dll)
{
einfo (_("%X%P: open %s: %E\n"), filename);
- return FALSE;
+ return false;
}
track_dependency_files (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. */
/* 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);
/* 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 +
{
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
(unsigned long) func_rva, is_data ? "(data)" : "");
}
- return TRUE;
+ return true;
}
/* Iterate through the list of symbols. */
}
}
- return TRUE;
+ return true;
}
void
/* Resize the sections. */
lang_reset_memory_regions ();
- lang_size_sections (NULL, TRUE);
+ lang_size_sections (NULL, true);
/* Redo special stuff. */
ldemul_after_allocation ();
reloc_s->contents = reloc_d;
}
-bfd_boolean
+bool
pe_bfd_is_dll (bfd *abfd)
{
return (bfd_get_format (abfd) == bfd_object
(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 *);
(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 *);
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 *);
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 */
#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
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
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;
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;
/* 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. */
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 *);
}
/* Test if an error occurred. */
-static bfd_boolean
+static bool
plugin_error_p (void)
{
return error_plugin != NULL;
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);
}
/* 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
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
{
char *p;
- input->use_mmap = FALSE;
+ input->use_mmap = false;
if (lseek (input->fd, offset, SEEK_SET) < 0)
return LDPS_ERR;
/* 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))
/* 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)
{
|| lsym->visibility == LDPV_PROTECTED);
}
- return FALSE;
+ return false;
}
/* Return LTO kind string name that corresponds to IDX enum value. */
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)
{
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;
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;
}
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;
_("%P: error: "), format, "\n",
(const char *) NULL);
fflush (stdout);
- vfinfo (stderr, newfmt, args, TRUE);
+ vfinfo (stderr, newfmt, args, true);
fflush (stderr);
free (newfmt);
}
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);
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)
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));
plugin_t *curplug = plugins_list;
/* Disable any further file-claiming. */
- no_more_claiming = TRUE;
+ no_more_claiming = true;
while (curplug)
{
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;
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,
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;
|| 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. */
&& (h->u.undef.abfd == NULL
|| (h->u.undef.abfd->flags & BFD_PLUGIN) != 0))
h->u.undef.abfd = abfd;
- ref = TRUE;
+ ref = true;
}
h->type = bfd_link_hash_undefweak;
h->u.undef.abfd = sym_bfd;
}
- ref = TRUE;
+ ref = true;
}
/* Otherwise, it must be a new def.
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;
}
}
|| 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 */
#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. */
extern char **environ;
#endif
+#define POISON_BFD_BOOLEAN 1
+
#endif /* ! defined (LD_SYSDEP_H) */
{
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;
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;
/* 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;
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))
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;
*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;
{
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;
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;
/* 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;
else if (!strcmp ("allsymbolsreadsilent", whichhook))
{
register_allsymbolsread_hook = yesno;
- allsymbolsread_silent = TRUE;
+ allsymbolsread_silent = true;
}
else if (!strcmp ("cleanup", whichhook))
register_cleanup_hook = yesno;
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))
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;
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) == '.';
*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;
{
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;
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;
/* 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;
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))
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;
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) == '.';
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;
{
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;
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;
/* 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;
else if (!strcmp ("allsymbolsreadsilent", whichhook))
{
register_allsymbolsread_hook = yesno;
- allsymbolsread_silent = TRUE;
+ allsymbolsread_silent = true;
}
else if (!strcmp ("cleanup", whichhook))
register_cleanup_hook = yesno;
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))
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;
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) == '.';
*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;