diff options
Diffstat (limited to 'ld')
46 files changed, 1352 insertions, 1215 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 7929f4cc48c..22de34ebb4a 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,19 @@ +2002-11-30 Alan Modra <amodra@bigpond.net.au> + + * ld.h, ldcref.c, ldctor.c, ldctor.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, ldwrite.c, lexsup.c, mri.c, pe-dll.c, pe-dll.h, + emulparams/elf32b4300.sh, emultempl/aix.em, emultempl/armcoff.em, + emultempl/armelf.em, emultempl/armelf_oabi.em, emultempl/beos.em, + emultempl/elf32.em, emultempl/generic.em, emultempl/gld960.em, + emultempl/gld960c.em, emultempl/hppaelf.em, emultempl/linux.em, + emultempl/lnk960.em, emultempl/m68kcoff.em, emultempl/mipsecoff.em, + emultempl/mmix-elfnmmo.em, emultempl/mmixelf.em, emultempl/mmo.em, + emultempl/needrelax.em, emultempl/pe.em, emultempl/ppc64elf.em, + emultempl/sh64elf.em, emultempl/sunos.em, emultempl/ticoff.em: Replace + boolean with bfd_boolean, true with TRUE, false with FALSE. Simplify + comparisons of bfd_boolean vars with TRUE/FALSE. Formatting. + 2002-11-27 David O'Brien <obrien@FreeBSD.org> * configure.host: Fix generic FreeBSD configuration entry. diff --git a/ld/emulparams/elf32b4300.sh b/ld/emulparams/elf32b4300.sh index 4bfdd6eb07c..d3e43547dd3 100644 --- a/ld/emulparams/elf32b4300.sh +++ b/ld/emulparams/elf32b4300.sh @@ -7,4 +7,4 @@ TEXT_START_ADDR=0xa0020000 unset NONPAGED_TEXT_START_ADDR unset SHLIB_TEXT_START_ADDR EXECUTABLE_SYMBOLS='_DYNAMIC_LINK = 0;' -DYNAMIC_LINK=false +DYNAMIC_LINK=FALSE diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em index c767f8b1157..b0a078a7549 100644 --- a/ld/emultempl/aix.em +++ b/ld/emultempl/aix.em @@ -56,25 +56,36 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libcoff.h" #include "libxcoff.h" -static void gld${EMULATION_NAME}_before_parse PARAMS ((void)); -static int gld${EMULATION_NAME}_parse_args PARAMS ((int, char **)); -static void gld${EMULATION_NAME}_after_open PARAMS ((void)); -static char *gld${EMULATION_NAME}_choose_target PARAMS ((int, char **)); -static void gld${EMULATION_NAME}_before_allocation PARAMS ((void)); -static void gld${EMULATION_NAME}_read_file PARAMS ((const char *, boolean)); -static void gld${EMULATION_NAME}_free PARAMS ((PTR)); +static void gld${EMULATION_NAME}_before_parse + PARAMS ((void)); +static int gld${EMULATION_NAME}_parse_args + PARAMS ((int, char **)); +static void gld${EMULATION_NAME}_after_open + PARAMS ((void)); +static char *gld${EMULATION_NAME}_choose_target + PARAMS ((int, char **)); +static void gld${EMULATION_NAME}_before_allocation + PARAMS ((void)); +static void gld${EMULATION_NAME}_read_file + PARAMS ((const char *, bfd_boolean)); +static void gld${EMULATION_NAME}_free + PARAMS ((PTR)); static void gld${EMULATION_NAME}_find_relocs -PARAMS ((lang_statement_union_type *)); -static void gld${EMULATION_NAME}_find_exp_assignment PARAMS ((etree_type *)); -static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile)); -static boolean gld${EMULATION_NAME}_unrecognized_file + PARAMS ((lang_statement_union_type *)); +static void gld${EMULATION_NAME}_find_exp_assignment + PARAMS ((etree_type *)); +static char *gld${EMULATION_NAME}_get_script + PARAMS ((int *isfile)); +static bfd_boolean gld${EMULATION_NAME}_unrecognized_file PARAMS ((lang_input_statement_type *)); static void gld${EMULATION_NAME}_create_output_section_statements PARAMS ((void)); -static void gld${EMULATION_NAME}_set_output_arch PARAMS ((void)); - -static int is_syscall PARAMS ((char *, unsigned int *)); -static int change_symbol_mode PARAMS ((char *)); +static void gld${EMULATION_NAME}_set_output_arch + PARAMS ((void)); +static int is_syscall + PARAMS ((char *, unsigned int *)); +static int change_symbol_mode + PARAMS ((char *)); /* The file alignment required for each section. */ static unsigned long file_align; @@ -157,7 +168,7 @@ gld${EMULATION_NAME}_before_parse () else ldfile_output_architecture = bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`; - config.has_shared = 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 @@ -395,19 +406,19 @@ gld${EMULATION_NAME}_parse_args (argc, argv) break; case OPTION_AUTOIMP: - link_info.static_link = false; + link_info.static_link = FALSE; break; case OPTION_ERNOTOK: - force_make_executable = false; + force_make_executable = FALSE; break; case OPTION_EROK: - force_make_executable = true; + force_make_executable = TRUE; break; case OPTION_EXPORT: - gld${EMULATION_NAME}_read_file (optarg, false); + gld${EMULATION_NAME}_read_file (optarg, FALSE); break; case OPTION_IMPORT: @@ -449,7 +460,7 @@ gld${EMULATION_NAME}_parse_args (argc, argv) case OPTION_MODTYPE: if (*optarg == 'S') { - link_info.shared = true; + link_info.shared = TRUE; ++optarg; } if (*optarg == '\0' || optarg[1] == '\0') @@ -459,11 +470,11 @@ gld${EMULATION_NAME}_parse_args (argc, argv) break; case OPTION_NOAUTOIMP: - link_info.static_link = true; + link_info.static_link = TRUE; break; case OPTION_NOSTRCMPCT: - link_info.traditional_format = true; + link_info.traditional_format = TRUE; break; case OPTION_PD: @@ -512,11 +523,11 @@ gld${EMULATION_NAME}_parse_args (argc, argv) 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: @@ -548,18 +559,18 @@ gld${EMULATION_NAME}_parse_args (argc, argv) object or an archive. If the file starts with #!, we must treat it as an import file. This is for AIX compatibility. */ -static boolean +static bfd_boolean gld${EMULATION_NAME}_unrecognized_file (entry) lang_input_statement_type *entry; { FILE *e; - boolean ret; + bfd_boolean ret; e = fopen (entry->filename, FOPEN_RT); if (e == NULL) - return false; + return FALSE; - ret = false; + ret = FALSE; if (getc (e) == '#' && getc (e) == '!') { @@ -574,8 +585,8 @@ gld${EMULATION_NAME}_unrecognized_file (entry) flpp = &(*flpp)->next; *flpp = n; - ret = true; - entry->loaded = true; + ret = TRUE; + entry->loaded = TRUE; } fclose (e); @@ -588,7 +599,7 @@ gld${EMULATION_NAME}_unrecognized_file (entry) static void gld${EMULATION_NAME}_after_open () { - boolean r; + bfd_boolean r; struct set_info *p; /* Call ldctor_build_sets, after pretending that this is a @@ -598,7 +609,7 @@ gld${EMULATION_NAME}_after_open () producing an XCOFF output file. */ r = link_info.relocateable; if (strstr (bfd_get_target (output_bfd), "xcoff") != NULL) - link_info.relocateable = true; + link_info.relocateable = TRUE; ldctor_build_sets (); link_info.relocateable = r; @@ -641,12 +652,12 @@ gld${EMULATION_NAME}_before_allocation () /* 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 ("%P%F: bfd_link_hash_lookup of export symbol failed: %E\n"); if (!bfd_xcoff_export_symbol (output_bfd, &link_info, h)) @@ -692,9 +703,9 @@ gld${EMULATION_NAME}_before_allocation () /* Let the XCOFF backend set up the .loader section. */ if (!bfd_xcoff_size_dynamic_sections (output_bfd, &link_info, libpath, entry_symbol.name, file_align, - maxstack, maxdata, gc && !unix_ld ? true : false, - modtype, textro ? true : false, unix_ld, special_sections, - rtld ? true : false)) + maxstack, maxdata, gc && !unix_ld ? TRUE : FALSE, + modtype, textro ? TRUE : FALSE, unix_ld, special_sections, + rtld ? TRUE : FALSE)) einfo ("%P%F: failed to set dynamic section sizes: %E\n"); /* Look through the special sections, and put them in the right @@ -706,7 +717,7 @@ gld${EMULATION_NAME}_before_allocation () lang_statement_union_type **pls; lang_input_section_type *is; const char *oname; - boolean start; + bfd_boolean start; sec = special_sections[i]; if (sec == NULL) @@ -766,32 +777,32 @@ gld${EMULATION_NAME}_before_allocation () 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; } @@ -939,13 +950,13 @@ is_syscall (input, flag) static void gld${EMULATION_NAME}_read_file (filename, import) const char *filename; - boolean import; + bfd_boolean import; { struct obstack *o; FILE *f; int lineno; int c; - boolean keep; + bfd_boolean keep; const char *imppath; const char *impfile; const char *impmember; @@ -960,7 +971,7 @@ gld${EMULATION_NAME}_read_file (filename, import) einfo ("%F%s: %E\n", filename); } - keep = false; + keep = FALSE; imppath = NULL; impfile = NULL; @@ -1026,7 +1037,7 @@ gld${EMULATION_NAME}_read_file (filename, import) char *file; (void) obstack_finish (o); - keep = true; + keep = TRUE; imppath = s; file = NULL; while (!ISSPACE (*s) && *s != '(' && *s != '\0') @@ -1143,8 +1154,8 @@ gld${EMULATION_NAME}_read_file (filename, import) } else { - h = bfd_link_hash_lookup (link_info.hash, symname, false, false, - true); + h = bfd_link_hash_lookup (link_info.hash, symname, FALSE, FALSE, + TRUE); if (h == NULL || h->type == bfd_link_hash_new) { /* We can just ignore attempts to import an unreferenced @@ -1221,7 +1232,7 @@ gld${EMULATION_NAME}_find_exp_assignment (exp) { case etree_provide: h = bfd_link_hash_lookup (link_info.hash, exp->assign.dst, - false, false, false); + FALSE, FALSE, FALSE); if (h == NULL) break; /* Fall through. */ @@ -1272,19 +1283,19 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 0; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return EOF -sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c -echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c -echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c -echo ' ; else return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c -echo '; }' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c +echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c +echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c +echo ' ; else return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c +echo '; }' >> e${EMULATION_NAME}.c else # Scripts read from the filesystem. @@ -1293,9 +1304,9 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 1; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable == true) + else if (link_info.relocateable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; @@ -1317,7 +1328,7 @@ gld${EMULATION_NAME}_create_output_section_statements () if ((bfd_get_flavour (output_bfd) == bfd_target_xcoff_flavour) && (link_info.init_function != NULL || link_info.fini_function != NULL - || rtld == true)) + || rtld)) { initfini_file = lang_add_input_file ("initfini", lang_input_file_is_file_enum, @@ -1334,17 +1345,17 @@ gld${EMULATION_NAME}_create_output_section_statements () } /* Call backend to fill in the rest */ - if (false == bfd_xcoff_link_generate_rtinit (initfini_file->the_bfd, - link_info.init_function, - link_info.fini_function, - rtld)) + if (! bfd_xcoff_link_generate_rtinit (initfini_file->the_bfd, + link_info.init_function, + link_info.fini_function, + rtld)) { einfo ("%X%P: can not create BFD %E\n"); return; } /* __rtld defined in /lib/librtl.a */ - if (true == rtld) + if (rtld) lang_add_input_file ("rtl", lang_input_file_is_l_enum, NULL); } } diff --git a/ld/emultempl/armcoff.em b/ld/emultempl/armcoff.em index 0b5e7bc9792..73828eb2f62 100644 --- a/ld/emultempl/armcoff.em +++ b/ld/emultempl/armcoff.em @@ -48,7 +48,7 @@ static void gld${EMULATION_NAME}_list_options PARAMS ((FILE *)); static void gld${EMULATION_NAME}_finish PARAMS ((void)); static void gld${EMULATION_NAME}_after_open PARAMS ((void)); -/* If true, then interworking stubs which support calls to old, non-interworking +/* If TRUE, then interworking stubs which support calls to old, non-interworking aware ARM code should be generated. */ static int support_old_code = 0; @@ -177,7 +177,8 @@ gld${EMULATION_NAME}_finish PARAMS((void)) if (thumb_entry_symbol == NULL) return; - h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol, false, false, true); + h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol, + FALSE, FALSE, TRUE); if (h != (struct bfd_link_hash_entry *) NULL && (h->type == bfd_link_hash_defined @@ -228,19 +229,19 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 0; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return EOF -sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c -echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c -echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c -echo ' ; else return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c -echo '; }' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c +echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c +echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c +echo ' ; else return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c +echo '; }' >> e${EMULATION_NAME}.c else # Scripts read from the filesystem. @@ -249,9 +250,9 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 1; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable == true) + else if (link_info.relocateable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em index 0e65c04ca64..05a7af0f8b5 100644 --- a/ld/emultempl/armelf.em +++ b/ld/emultempl/armelf.em @@ -35,8 +35,8 @@ gld${EMULATION_NAME}_before_parse () #ifndef TARGET_ /* I.e., if not generic. */ ldfile_set_output_arch ("`echo ${ARCH}`"); #endif /* not TARGET_ */ - config.dynamic_link = ${DYNAMIC_LINK-true}; - config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`; + config.dynamic_link = ${DYNAMIC_LINK-TRUE}; + config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`; } static void arm_elf_after_open PARAMS ((void)); @@ -73,7 +73,7 @@ arm_elf_set_bfd_for_interworking (statement) lang_statement_union_type *statement; { if (statement->header.type == lang_input_section_enum - && statement->input_section.ifile->just_syms_flag == false) + && !statement->input_section.ifile->just_syms_flag) { asection *i = statement->input_section.section; asection *output_section = i->output_section; @@ -85,7 +85,7 @@ arm_elf_set_bfd_for_interworking (statement) && ! i->owner->output_has_begun) { bfd_for_interwork = i->owner; - bfd_for_interwork->output_has_begun = true; + bfd_for_interwork->output_has_begun = TRUE; } } } @@ -105,12 +105,12 @@ arm_elf_before_allocation () /* The interworking bfd must be the last one in the link. */ bfd_for_interwork = NULL; for (tem = link_info.input_bfds; tem != NULL; tem = tem->link_next) - tem->output_has_begun = false; + tem->output_has_begun = FALSE; lang_for_each_statement (arm_elf_set_bfd_for_interworking); ASSERT (bfd_for_interwork != NULL); for (tem = link_info.input_bfds; tem != NULL; tem = tem->link_next) - tem->output_has_begun = false; + tem->output_has_begun = FALSE; bfd_elf32_arm_get_bfd_for_interworking (bfd_for_interwork, &link_info); } @@ -148,7 +148,7 @@ arm_elf_finish () return; h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol, - false, false, true); + FALSE, FALSE, TRUE); if (h != (struct bfd_link_hash_entry *) NULL && (h->type == bfd_link_hash_defined diff --git a/ld/emultempl/armelf_oabi.em b/ld/emultempl/armelf_oabi.em index aae7ea9f060..647ada3b526 100644 --- a/ld/emultempl/armelf_oabi.em +++ b/ld/emultempl/armelf_oabi.em @@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF /* This file is is generated by a shell script. DO NOT EDIT! */ /* emulate the original gld for the given ${EMULATION_NAME} - Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Written by Steve Chamberlain steve@cygnus.com @@ -113,19 +113,19 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 0; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return EOF -sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c -echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c -echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c -echo ' ; else return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c -echo '; }' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c +echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c +echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c +echo ' ; else return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c +echo '; }' >> e${EMULATION_NAME}.c else # Scripts read from the filesystem. @@ -134,9 +134,9 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 1; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable == true) + else if (link_info.relocateable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; diff --git a/ld/emultempl/beos.em b/ld/emultempl/beos.em index 0a1fbbd58c1..7e76f691139 100644 --- a/ld/emultempl/beos.em +++ b/ld/emultempl/beos.em @@ -55,7 +55,7 @@ static void gld_${EMULATION_NAME}_set_symbols PARAMS ((void)); static void gld_${EMULATION_NAME}_after_open PARAMS ((void)); static void gld_${EMULATION_NAME}_before_parse PARAMS ((void)); static void gld_${EMULATION_NAME}_before_allocation PARAMS ((void)); -static boolean gld${EMULATION_NAME}_place_orphan +static bfd_boolean gld${EMULATION_NAME}_place_orphan PARAMS ((lang_input_statement_type *, asection *)); static char *gld_${EMULATION_NAME}_get_script PARAMS ((int *)); static int gld_${EMULATION_NAME}_parse_args PARAMS ((int, char **)); @@ -731,7 +731,7 @@ gld_${EMULATION_NAME}_before_allocation() which are not mentioned in the linker script. */ /*ARGSUSED*/ -static boolean +static bfd_boolean gld${EMULATION_NAME}_place_orphan (file, s) lang_input_statement_type *file; asection *s; @@ -742,14 +742,14 @@ gld${EMULATION_NAME}_place_orphan (file, s) lang_statement_union_type *l; if ((s->flags & SEC_ALLOC) == 0) - return false; + return FALSE; /* Don't process grouped sections unless doing a final link. If they're marked as COMDAT sections, we don't want .text\$foo to end up in .text and then have .text disappear because it's marked link-once-discard. */ if (link_info.relocateable) - return false; + return FALSE; secname = bfd_get_section_name (s->owner, s); @@ -758,7 +758,7 @@ gld${EMULATION_NAME}_place_orphan (file, s) if (*secname == '\$') einfo ("%P%F: section %s has '\$' as first character\n", secname); if (strchr (secname + 1, '\$') == NULL) - return false; + return FALSE; /* Look up the output section. The Microsoft specs say sections names in image files never contain a '\$'. Fortunately, lang_..._lookup creates @@ -802,12 +802,12 @@ gld${EMULATION_NAME}_place_orphan (file, s) tmp->spec.name = xmalloc (strlen (output_secname) + 2); sprintf (tmp->spec.name, "%s\$", output_secname); tmp->spec.exclude_name_list = NULL; - tmp->sorted = false; + tmp->sorted = FALSE; new = new_stat (lang_wild_statement, &os->children); new->filename = NULL; - new->filenames_sorted = false; + new->filenames_sorted = FALSE; new->section_list = tmp; - new->keep_sections = false; + new->keep_sections = FALSE; lang_list_init (&new->children); l = new; } @@ -819,7 +819,7 @@ gld${EMULATION_NAME}_place_orphan (file, s) sort_sections. */ lang_add_section (&l->wild_statement.children, s, os, file); - return true; + return TRUE; } static char * @@ -834,19 +834,19 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 0; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return EOF -sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c -echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c -echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c -echo ' ; else return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c -echo '; }' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c +echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c +echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c +echo ' ; else return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c +echo '; }' >> e${EMULATION_NAME}.c cat >>e${EMULATION_NAME}.c <<EOF diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index 9bfed6eb67c..60a789eb372 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -58,9 +58,9 @@ static void gld${EMULATION_NAME}_vercheck PARAMS ((lang_input_statement_type *)); static void gld${EMULATION_NAME}_stat_needed PARAMS ((lang_input_statement_type *)); -static boolean gld${EMULATION_NAME}_try_needed +static bfd_boolean gld${EMULATION_NAME}_try_needed PARAMS ((const char *, int)); -static boolean gld${EMULATION_NAME}_search_needed +static bfd_boolean gld${EMULATION_NAME}_search_needed PARAMS ((const char *, const char *, int)); static void gld${EMULATION_NAME}_check_needed PARAMS ((lang_input_statement_type *)); @@ -72,13 +72,13 @@ static void gld${EMULATION_NAME}_find_statement_assignment PARAMS ((lang_statement_union_type *)); static void gld${EMULATION_NAME}_before_allocation PARAMS ((void)); -static boolean gld${EMULATION_NAME}_open_dynamic_archive +static bfd_boolean gld${EMULATION_NAME}_open_dynamic_archive PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *)); static lang_output_section_statement_type *output_rel_find PARAMS ((asection *)); static asection *output_prev_sec_find PARAMS ((lang_output_section_statement_type *)); -static boolean gld${EMULATION_NAME}_place_orphan +static bfd_boolean gld${EMULATION_NAME}_place_orphan PARAMS ((lang_input_statement_type *, asection *)); static void gld${EMULATION_NAME}_finish PARAMS ((void)); @@ -114,8 +114,8 @@ gld${EMULATION_NAME}_before_parse () } else ldfile_output_architecture = bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`; - config.dynamic_link = ${DYNAMIC_LINK-true}; - config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`; + config.dynamic_link = ${DYNAMIC_LINK-TRUE}; + config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`; } EOF @@ -128,9 +128,9 @@ cat >>e${EMULATION_NAME}.c <<EOF static struct bfd_link_needed_list *global_needed; static struct stat global_stat; -static boolean global_found; +static bfd_boolean global_found; static struct bfd_link_needed_list *global_vercheck_needed; -static boolean global_vercheck_failed; +static bfd_boolean global_vercheck_failed; /* On Linux, it's possible to have different versions of the same @@ -193,7 +193,7 @@ gld${EMULATION_NAME}_vercheck (s) FOO.SO.VER2, and VER1 and VER2 are different. This appears to be a version mismatch, so we tell the caller to try a different version of this library. */ - global_vercheck_failed = true; + global_vercheck_failed = TRUE; return; } } @@ -225,7 +225,7 @@ gld${EMULATION_NAME}_stat_needed (s) if (st.st_dev == global_stat.st_dev && st.st_ino == global_stat.st_ino) { - global_found = true; + global_found = TRUE; return; } @@ -259,7 +259,7 @@ gld${EMULATION_NAME}_stat_needed (s) named by a DT_NEEDED entry. The FORCE parameter indicates whether to skip the check for a conflicting version. */ -static boolean +static bfd_boolean gld${EMULATION_NAME}_try_needed (name, force) const char *name; int force; @@ -269,23 +269,23 @@ gld${EMULATION_NAME}_try_needed (name, force) abfd = bfd_openr (name, bfd_get_target (output_bfd)); if (abfd == NULL) - return false; + return FALSE; 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 != output_bfd->xvec) { bfd_close (abfd); - return false; + return FALSE; } /* Check whether this object would include any conflicting library @@ -303,14 +303,14 @@ gld${EMULATION_NAME}_try_needed (name, force) if (needed != NULL) { global_vercheck_needed = needed; - global_vercheck_failed = false; + global_vercheck_failed = FALSE; lang_for_each_input_file (gld${EMULATION_NAME}_vercheck); if (global_vercheck_failed) { bfd_close (abfd); - /* Return false to force the caller to move on to try + /* 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 @@ -333,7 +333,7 @@ case ${target} in if (l == NULL) { bfd_close (abfd); - return false; + return FALSE; } } @@ -363,13 +363,13 @@ cat >>e${EMULATION_NAME}.c <<EOF if (trace_file_tries) info_msg (_("found %s at %s\n"), soname, name); - global_found = false; + global_found = FALSE; lang_for_each_input_file (gld${EMULATION_NAME}_stat_needed); if (global_found) { - /* Return true to indicate that we found the file, even though + /* Return TRUE to indicate that we found the file, even though we aren't going to do anything with it. */ - return true; + return TRUE; } /* Tell the ELF backend that we don't want the output file to have a @@ -385,13 +385,13 @@ cat >>e${EMULATION_NAME}.c <<EOF if (! bfd_link_add_symbols (abfd, &link_info)) einfo ("%F%B: could not read symbols: %E\n", abfd); - return true; + return TRUE; } /* Search for a needed file in a path. */ -static boolean +static bfd_boolean gld${EMULATION_NAME}_search_needed (path, name, force) const char *path; const char *name; @@ -404,7 +404,7 @@ gld${EMULATION_NAME}_search_needed (path, name, force) return gld${EMULATION_NAME}_try_needed (name, force); if (path == NULL || *path == '\0') - return false; + return FALSE; len = strlen (name); while (1) { @@ -426,7 +426,7 @@ gld${EMULATION_NAME}_search_needed (path, name, force) strcpy (sset, name); if (gld${EMULATION_NAME}_try_needed (filename, force)) - return true; + return TRUE; free (filename); @@ -435,7 +435,7 @@ gld${EMULATION_NAME}_search_needed (path, name, force) path = s + 1; } - return false; + return FALSE; } EOF @@ -450,15 +450,15 @@ if [ "x${host}" = "x${target}" ] ; then in which we may find shared libraries. /etc/ld.so.conf is really only meaningful on Linux. */ -static boolean gld${EMULATION_NAME}_check_ld_so_conf +static bfd_boolean gld${EMULATION_NAME}_check_ld_so_conf PARAMS ((const char *, int)); -static boolean +static bfd_boolean gld${EMULATION_NAME}_check_ld_so_conf (name, force) const char *name; int force; { - static boolean initialized; + static bfd_boolean initialized; static char *ld_so_conf; if (! initialized) @@ -518,11 +518,11 @@ gld${EMULATION_NAME}_check_ld_so_conf (name, force) ld_so_conf = b; } - initialized = true; + initialized = TRUE; } if (ld_so_conf == NULL) - return false; + return FALSE; return gld${EMULATION_NAME}_search_needed (ld_so_conf, name, force); } @@ -550,7 +550,7 @@ gld${EMULATION_NAME}_check_needed (s) if (strcmp (s->filename, global_needed->name) == 0) { - global_found = true; + global_found = TRUE; return; } @@ -560,7 +560,7 @@ gld${EMULATION_NAME}_check_needed (s) if (f != NULL && strcmp (f + 1, global_needed->name) == 0) { - global_found = true; + global_found = TRUE; return; } } @@ -574,7 +574,7 @@ gld${EMULATION_NAME}_check_needed (s) if (soname != NULL && strcmp (soname, global_needed->name) == 0) { - global_found = true; + global_found = TRUE; return; } } @@ -620,7 +620,7 @@ gld${EMULATION_NAME}_after_open () /* See if this file was included in the link explicitly. */ global_needed = l; - global_found = false; + global_found = FALSE; lang_for_each_input_file (gld${EMULATION_NAME}_check_needed); if (global_found) continue; @@ -756,7 +756,7 @@ gld${EMULATION_NAME}_find_exp_assignment (exp) { case etree_provide: h = bfd_link_hash_lookup (link_info.hash, exp->assign.dst, - false, false, false); + FALSE, FALSE, FALSE); if (h == NULL) break; @@ -774,7 +774,7 @@ gld${EMULATION_NAME}_find_exp_assignment (exp) { if (! (bfd_elf${ELFSIZE}_record_link_assignment (output_bfd, &link_info, exp->assign.dst, - exp->type.node_class == etree_provide ? true : false))) + exp->type.node_class == etree_provide ? TRUE : FALSE))) einfo ("%P%F: failed to record assignment to %s: %E\n", exp->assign.dst); } @@ -877,7 +877,7 @@ ${ELF_INTERPRETER_SET_DEFAULT} asection *s; bfd_size_type sz; char *msg; - boolean ret; + bfd_boolean ret; if (is->just_syms_flag) continue; @@ -916,7 +916,7 @@ cat >>e${EMULATION_NAME}.c <<EOF dynamic libraries have an extension of .so (or .sl on oddball systems like hpux). */ -static boolean +static bfd_boolean gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry) const char *arch; search_dirs_type *search; @@ -926,7 +926,7 @@ gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry) char *string; if (! entry->is_archive) - return false; + return FALSE; filename = entry->filename; @@ -954,7 +954,7 @@ gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry) if (! ldfile_try_open_bfd (string, entry)) { free (string); - return false; + return FALSE; } entry->filename = string; @@ -984,7 +984,7 @@ gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry) bfd_elf_set_dt_needed_name (entry->the_bfd, filename); } - return true; + return TRUE; } EOF @@ -1073,7 +1073,7 @@ struct orphan_save { lang_statement_union_type **stmt; }; -static boolean +static bfd_boolean gld${EMULATION_NAME}_place_orphan (file, s) lang_input_statement_type *file; asection *s; @@ -1121,7 +1121,7 @@ gld${EMULATION_NAME}_place_orphan (file, s) /* We already have an output section statement with this name, and its bfd section, if any, has compatible flags. */ lang_add_section (&os->children, s, os, file); - return true; + return TRUE; } } @@ -1136,7 +1136,7 @@ gld${EMULATION_NAME}_place_orphan (file, s) && hold_text.os != NULL) { lang_add_section (&hold_text.os->children, s, hold_text.os, file); - return true; + return TRUE; } /* Decide which segment the section should go in based on the @@ -1151,7 +1151,7 @@ gld${EMULATION_NAME}_place_orphan (file, s) { if (s->output_section == NULL) s->output_section = bfd_abs_section_ptr; - return true; + return TRUE; } place = NULL; @@ -1334,7 +1334,7 @@ gld${EMULATION_NAME}_place_orphan (file, s) } } - return true; + return TRUE; } EOF fi @@ -1383,33 +1383,33 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 0; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return EOF -sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c -echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c +echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c if cmp -s ldscripts/${EMULATION_NAME}.x ldscripts/${EMULATION_NAME}.xn; then : ; else -echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c +echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c fi if test -n "$GENERATE_SHLIB_SCRIPT" ; then if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then echo ' ; else if (link_info.shared && link_info.combreloc) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xsc >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xsc >> e${EMULATION_NAME}.c fi -echo ' ; else if (link_info.shared) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xs >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.shared) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xs >> e${EMULATION_NAME}.c fi if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then -echo ' ; else if (link_info.combreloc) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xc >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.combreloc) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xc >> e${EMULATION_NAME}.c fi -echo ' ; else return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c -echo '; }' >> e${EMULATION_NAME}.c +echo ' ; else return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c +echo '; }' >> e${EMULATION_NAME}.c else # Scripts read from the filesystem. @@ -1418,9 +1418,9 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 1; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable == true) + else if (link_info.relocateable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; @@ -1521,21 +1521,21 @@ EOF if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then cat >>e${EMULATION_NAME}.c <<EOF 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: - link_info.eh_frame_hdr = true; + link_info.eh_frame_hdr = TRUE; break; case OPTION_GROUP: link_info.flags_1 |= (bfd_vma) DF_1_GROUP; /* Groups must be self-contained. */ - link_info.no_undefined = true; + link_info.no_undefined = TRUE; break; case 'z': @@ -1564,15 +1564,15 @@ cat >>e${EMULATION_NAME}.c <<EOF link_info.flags_1 |= (bfd_vma) DF_1_ORIGIN; } else if (strcmp (optarg, "defs") == 0) - link_info.no_undefined = true; + link_info.no_undefined = TRUE; else if (strcmp (optarg, "muldefs") == 0) - link_info.allow_multiple_definition = true; + link_info.allow_multiple_definition = TRUE; 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; /* What about the other Solaris -z options? FIXME. */ break; EOF diff --git a/ld/emultempl/generic.em b/ld/emultempl/generic.em index 397422ce670..c78b0476bec 100644 --- a/ld/emultempl/generic.em +++ b/ld/emultempl/generic.em @@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF /* This file is is generated by a shell script. DO NOT EDIT! */ /* emulate the original gld for the given ${EMULATION_NAME} - Copyright 1991, 1992, 1994, 1996, 2000, 2001 + Copyright 1991, 1992, 1994, 1996, 2000, 2001, 2002 Free Software Foundation, Inc. Written by Steve Chamberlain steve@cygnus.com @@ -83,19 +83,19 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 0; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return EOF -sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c -echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c -echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c -echo ' ; else return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c -echo '; }' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c +echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c +echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c +echo ' ; else return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c +echo '; }' >> e${EMULATION_NAME}.c else # Scripts read from the filesystem. @@ -104,9 +104,9 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 1; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable == true) + else if (link_info.relocateable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; diff --git a/ld/emultempl/gld960.em b/ld/emultempl/gld960.em index c37f4b39972..b390d83ae13 100644 --- a/ld/emultempl/gld960.em +++ b/ld/emultempl/gld960.em @@ -1,7 +1,7 @@ # This shell script emits a C file. -*- C -*- # It does some substitutions. cat >e${EMULATION_NAME}.c <<EOF -/* Copyright 1991, 1992, 1994, 1999, 2000, 2001 +/* Copyright 1991, 1992, 1994, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -59,7 +59,7 @@ gld960_before_parse() ldfile_add_library_path (concat (env, "/lib/libbout", (const char *) NULL), - false); + FALSE); } } ldfile_output_architecture = bfd_arch_i960; @@ -72,11 +72,11 @@ static void gld960_before_parse() char *env ; env = getenv("G960LIB"); if (env) { - ldfile_add_library_path(env, false); + ldfile_add_library_path(env, FALSE); } env = getenv("G960BASE"); if (env) - ldfile_add_library_path (concat (env, "/lib", (const char *) NULL), false); + ldfile_add_library_path (concat (env, "/lib", (const char *) NULL), FALSE); ldfile_output_architecture = bfd_arch_i960; } @@ -128,19 +128,19 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 0; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return EOF -sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c -echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c -echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c -echo ' ; else return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c -echo '; }' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c +echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c +echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c +echo ' ; else return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c +echo '; }' >> e${EMULATION_NAME}.c else # Scripts read from the filesystem. @@ -149,9 +149,9 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 1; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable == true) + else if (link_info.relocateable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; diff --git a/ld/emultempl/gld960c.em b/ld/emultempl/gld960c.em index 261a3f8cf36..50391a0c04d 100644 --- a/ld/emultempl/gld960c.em +++ b/ld/emultempl/gld960c.em @@ -1,7 +1,7 @@ # This shell script emits a C file. -*- C -*- # It does some substitutions. cat >e${EMULATION_NAME}.c <<EOF -/* Copyright 1991, 1993, 1994, 1996, 1999, 2000, 2001 +/* Copyright 1991, 1993, 1994, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -61,7 +61,7 @@ gld960_before_parse() ldfile_add_library_path (concat (env, "/lib/libcoff", (const char *) NULL), - false); + FALSE); } } ldfile_output_architecture = bfd_arch_i960; @@ -74,12 +74,12 @@ static void gld960_before_parse() char *env ; env = getenv("G960LIB"); if (env) { - ldfile_add_library_path(env, false); + ldfile_add_library_path(env, FALSE); } env = getenv("G960BASE"); if (env) ldfile_add_library_path (concat (env, "/lib", (const char *) NULL), - false); + FALSE); ldfile_output_architecture = bfd_arch_i960; } @@ -143,19 +143,19 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 0; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return EOF -sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c -echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c -echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c -echo ' ; else return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c -echo '; }' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c +echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c +echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c +echo ' ; else return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c +echo '; }' >> e${EMULATION_NAME}.c else # Scripts read from the filesystem. @@ -164,9 +164,9 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 1; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable == true) + else if (link_info.relocateable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; diff --git a/ld/emultempl/hppaelf.em b/ld/emultempl/hppaelf.em index 394f28e1668..c44b01a7b8a 100644 --- a/ld/emultempl/hppaelf.em +++ b/ld/emultempl/hppaelf.em @@ -99,16 +99,16 @@ struct hook_stub_info /* Traverse the linker tree to find the spot where the stub goes. */ -static boolean hook_in_stub +static bfd_boolean hook_in_stub PARAMS ((struct hook_stub_info *, lang_statement_union_type **)); -static boolean +static bfd_boolean hook_in_stub (info, lp) struct hook_stub_info *info; lang_statement_union_type **lp; { lang_statement_union_type *l; - boolean ret; + bfd_boolean ret; for (; (l = *lp) != NULL; lp = &l->header.next) { @@ -146,7 +146,7 @@ hook_in_stub (info, lp) before its associated input section. */ *lp = info->add.head; *(info->add.tail) = l; - return true; + return TRUE; } break; @@ -167,7 +167,7 @@ hook_in_stub (info, lp) break; } } - return false; + return FALSE; } diff --git a/ld/emultempl/linux.em b/ld/emultempl/linux.em index fda490b5da8..6ec02851088 100644 --- a/ld/emultempl/linux.em +++ b/ld/emultempl/linux.em @@ -1,6 +1,6 @@ # This shell script emits a C file. -*- C -*- # It does some substitutions. -if [ -z "$MACHINE" ]; then +if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH} else OUTPUT_ARCH=${ARCH}:${MACHINE} @@ -9,7 +9,7 @@ cat >e${EMULATION_NAME}.c <<EOF /* This file is is generated by a shell script. DO NOT EDIT! */ /* Linux a.out emulation code for ${EMULATION_NAME} - Copyright 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000 + Copyright 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. Written by Steve Chamberlain <sac@cygnus.com> Linux support by Eric Youngdale <ericy@cais.cais.com> @@ -45,7 +45,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ldemul.h" static void gld${EMULATION_NAME}_before_parse PARAMS ((void)); -static boolean gld${EMULATION_NAME}_open_dynamic_archive +static bfd_boolean gld${EMULATION_NAME}_open_dynamic_archive PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *)); static void gld${EMULATION_NAME}_find_address_statement PARAMS ((lang_statement_union_type *)); @@ -66,14 +66,14 @@ gld${EMULATION_NAME}_before_parse() } else ldfile_output_architecture = bfd_arch_${ARCH}; - config.dynamic_link = true; - config.has_shared = true; + config.dynamic_link = TRUE; + config.has_shared = TRUE; } /* Try to open a dynamic archive. This is where we know that Linux dynamic libraries have an extension of .sa. */ -static boolean +static bfd_boolean gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry) const char *arch; search_dirs_type *search; @@ -82,7 +82,7 @@ gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry) char *string; if (! entry->is_archive) - return false; + return FALSE; string = (char *) xmalloc (strlen (search->name) + strlen (entry->filename) @@ -94,12 +94,12 @@ gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry) 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 @@ -157,33 +157,33 @@ then sc="-f stringify.sed" cat >>e${EMULATION_NAME}.c <<EOF -{ +{ *isfile = 0; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return EOF -sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c -echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c -echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c -echo ' ; else return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c -echo '; }' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c +echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c +echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c +echo ' ; else return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c +echo '; }' >> e${EMULATION_NAME}.c else # Scripts read from the filesystem. cat >>e${EMULATION_NAME}.c <<EOF -{ +{ *isfile = 1; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable == true) + else if (link_info.relocateable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; @@ -198,7 +198,7 @@ fi cat >>e${EMULATION_NAME}.c <<EOF -struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = +struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = { gld${EMULATION_NAME}_before_parse, syslib_default, diff --git a/ld/emultempl/lnk960.em b/ld/emultempl/lnk960.em index f23f2bc85d7..b000fa976ed 100644 --- a/ld/emultempl/lnk960.em +++ b/ld/emultempl/lnk960.em @@ -61,62 +61,61 @@ static char *lnk960_get_script PARAMS ((int *)); static void -append(list, name) +append (list, name) lib_list_type ***list; char *name; { - lib_list_type *element = - (lib_list_type *)(xmalloc(sizeof(lib_list_type))); + lib_list_type *element = (lib_list_type *) xmalloc (sizeof (lib_list_type)); element->name = name; - element->next = (lib_list_type *)NULL; + element->next = (lib_list_type *) NULL; **list = element; *list = &element->next; } -static boolean had_hll = false; -static boolean had_hll_name = false; +static bfd_boolean had_hll = FALSE; +static bfd_boolean had_hll_name = FALSE; static void -lnk960_hll(name) +lnk960_hll (name) char *name; { - had_hll = true; - if (name != (char *)NULL) { - had_hll_name = true; - append(&hll_list_tail, name); - } + had_hll = TRUE; + if (name != (char *) NULL) + { + had_hll_name = TRUE; + append (&hll_list_tail, name); + } } static void -lnk960_syslib(name) +lnk960_syslib (name) char *name; { - append(&syslib_list_tail,name); + append (&syslib_list_tail, name); } #ifdef GNU960 static void -lnk960_before_parse() +lnk960_before_parse () { static char *env_variables[] = { "G960LIB", "G960BASE", 0 }; char **p; char *env ; - for ( p = env_variables; *p; p++ ){ - env = (char *) getenv(*p); - if (env) { - ldfile_add_library_path(concat(env,"/lib/libcoff",""), false); + for (p = env_variables; *p; p++) + { + env = (char *) getenv (*p); + if (env) + ldfile_add_library_path (concat (env, "/lib/libcoff", ""), FALSE); } - } - env= (char *) getenv("I960BASE"); - if ( env ) { - ldfile_add_library_path(concat(env,"/lib",""), false); - } + env = (char *) getenv ("I960BASE"); + if (env) + ldfile_add_library_path(concat (env, "/lib", ""), FALSE); ldfile_output_architecture = bfd_arch_i960; ldfile_output_machine = bfd_mach_i960_core; @@ -125,19 +124,19 @@ lnk960_before_parse() #else /* not GNU960 */ static void -lnk960_before_parse() +lnk960_before_parse () { - char *name = getenv("I960BASE"); + char *name = getenv ("I960BASE"); - if (name == (char *)NULL) { - name = getenv("G960BASE"); - if (name == (char *)NULL) { - einfo("%P%F I960BASE and G960BASE not set\n"); + if (name == (char *) NULL) + { + name = getenv("G960BASE"); + if (name == (char *) NULL) + einfo ("%P%F I960BASE and G960BASE not set\n"); } - } - ldfile_add_library_path(concat(name,"/lib",""), false); + ldfile_add_library_path (concat (name, "/lib", ""), FALSE); ldfile_output_architecture = bfd_arch_i960; ldfile_output_machine = bfd_mach_i960_core; } @@ -146,55 +145,52 @@ lnk960_before_parse() static void -add_on(list, search) +add_on (list, search) lib_list_type *list; lang_input_file_enum_type search; { - while (list) { - lang_add_input_file(list->name, - search, - (char *)NULL); - list = list->next; - } + while (list) + { + lang_add_input_file (list->name, search, (char *) NULL); + list = list->next; + } } static void -lnk960_after_parse() +lnk960_after_parse () { /* If there has been no arch, default to -KB */ - if (ldfile_output_machine_name[0] ==0) { - ldfile_add_arch("KB"); - } + if (ldfile_output_machine_name[0] == 0) + ldfile_add_arch ("KB"); /* if there has been no hll list then add our own */ - if(had_hll && !had_hll_name) { - append(&hll_list_tail,"cg"); - if (ldfile_output_machine == bfd_mach_i960_ka_sa || - ldfile_output_machine == bfd_mach_i960_ca) { - { - append(&hll_list_tail,"fpg"); - } + if (had_hll && !had_hll_name) + { + append (&hll_list_tail, "cg"); + if (ldfile_output_machine == bfd_mach_i960_ka_sa + || ldfile_output_machine == bfd_mach_i960_ca) + append (&hll_list_tail, "fpg"); } - } - add_on(hll_list, lang_input_file_is_l_enum); - add_on(syslib_list, lang_input_file_is_search_file_enum); + add_on (hll_list, lang_input_file_is_l_enum); + add_on (syslib_list, lang_input_file_is_search_file_enum); } static void -lnk960_before_allocation() +lnk960_before_allocation () { } static void -lnk960_after_allocation() +lnk960_after_allocation () { - if (link_info.relocateable == false) { - lang_abs_symbol_at_end_of(".text","_etext"); - lang_abs_symbol_at_end_of(".data","_edata"); - lang_abs_symbol_at_beginning_of(".bss","_bss_start"); - lang_abs_symbol_at_end_of(".bss","_end"); - } + if (!link_info.relocateable) + { + lang_abs_symbol_at_end_of (".text", "_etext"); + lang_abs_symbol_at_end_of (".data", "_edata"); + lang_abs_symbol_at_beginning_of (".bss", "_bss_start"); + lang_abs_symbol_at_end_of (".bss", "_end"); + } } @@ -231,18 +227,21 @@ machine_table[] = }; static void -lnk960_set_output_arch() +lnk960_set_output_arch () { /* Set the output architecture and machine if possible */ unsigned int i; ldfile_output_machine = bfd_mach_i960_core; - for (i= 0; machine_table[i].name != (char*)NULL; i++) { - if (strcmp(ldfile_output_machine_name,machine_table[i].name)==0) { - ldfile_output_machine = machine_table[i].number; - break; + for (i= 0; machine_table[i].name != (char*) NULL; i++) + { + if (strcmp (ldfile_output_machine_name, machine_table[i].name) == 0) + { + ldfile_output_machine = machine_table[i].number; + break; + } } - } - bfd_set_arch_mach(output_bfd, ldfile_output_architecture, ldfile_output_machine); + bfd_set_arch_mach (output_bfd, ldfile_output_architecture, + ldfile_output_machine); } static char * @@ -252,12 +251,12 @@ lnk960_choose_target (argc, argv) { #ifdef GNU960 - return bfd_make_targ_name(BFD_COFF_FORMAT, 0); + return bfd_make_targ_name (BFD_COFF_FORMAT, 0); #else - char *from_outside = getenv(TARGET_ENVIRON); - if (from_outside != (char *)NULL) + char *from_outside = getenv (TARGET_ENVIRON); + if (from_outside != (char *) NULL) return from_outside; #ifdef LNK960_LITTLE return "coff-Intel-little"; @@ -269,7 +268,7 @@ lnk960_choose_target (argc, argv) } static char * -lnk960_get_script(isfile) +lnk960_get_script (isfile) int *isfile; EOF @@ -284,19 +283,19 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 0; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return EOF -sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c -echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c -echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c -echo ' ; else return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c -echo '; }' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c +echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c +echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c +echo ' ; else return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c +echo '; }' >> e${EMULATION_NAME}.c else # Scripts read from the filesystem. @@ -305,9 +304,9 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 1; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable == true) + else if (link_info.relocateable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; diff --git a/ld/emultempl/m68kcoff.em b/ld/emultempl/m68kcoff.em index 8ac4e616a7e..1f32889f456 100644 --- a/ld/emultempl/m68kcoff.em +++ b/ld/emultempl/m68kcoff.em @@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF /* This file is is generated by a shell script. DO NOT EDIT! */ /* Handle embedded relocs for m68k. - Copyright 2000 Free Software Foundation, Inc. + Copyright 2000, 2002 Free Software Foundation, Inc. Written by Michael Sokolov <msokolov@ivan.Harhan.ORG>, based on generic.em by Steve Chamberlain <steve@cygnus.com>, embedded relocs code based on mipsecoff.em by Ian Lance Taylor <ian@cygnus.com>. @@ -179,19 +179,19 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 0; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return EOF -sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c -echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c -echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c -echo ' ; else return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c -echo '; }' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c +echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c +echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c +echo ' ; else return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c +echo '; }' >> e${EMULATION_NAME}.c else # Scripts read from the filesystem. @@ -200,9 +200,9 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 1; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable == true) + else if (link_info.relocateable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; diff --git a/ld/emultempl/mipsecoff.em b/ld/emultempl/mipsecoff.em index 9521e016a05..9fda644eaa0 100644 --- a/ld/emultempl/mipsecoff.em +++ b/ld/emultempl/mipsecoff.em @@ -9,7 +9,7 @@ cat >e${EMULATION_NAME}.c <<EOF /* This file is is generated by a shell script. DO NOT EDIT! */ /* Handle embedded relocs for MIPS. - Copyright 1994, 1995, 1997, 2000 Free Software Foundation, Inc. + Copyright 1994, 1995, 1997, 2000, 2002 Free Software Foundation, Inc. Written by Ian Lance Taylor <ian@cygnus.com> based on generic.em. This file is part of GLD, the Gnu Linker. @@ -194,19 +194,19 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 0; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return EOF -sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c -echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c -echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c -echo ' ; else return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c -echo '; }' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c +echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c +echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c +echo ' ; else return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c +echo '; }' >> e${EMULATION_NAME}.c else # Scripts read from the filesystem. @@ -215,9 +215,9 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 1; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable == true) + else if (link_info.relocateable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; diff --git a/ld/emultempl/mmix-elfnmmo.em b/ld/emultempl/mmix-elfnmmo.em index 2bb650c2e18..8ec604f6e36 100644 --- a/ld/emultempl/mmix-elfnmmo.em +++ b/ld/emultempl/mmix-elfnmmo.em @@ -43,7 +43,7 @@ mmix_before_allocation () /* Force -relax on if not doing a relocatable link. */ if (! link_info.relocateable) - command_line.relax = true; + command_line.relax = TRUE; if (!_bfd_mmix_prepare_linker_allocated_gregs (output_bfd, &link_info)) einfo ("%X%P: Internal problems setting up section %s", diff --git a/ld/emultempl/mmixelf.em b/ld/emultempl/mmixelf.em index e84f0b76899..80d2d94830c 100644 --- a/ld/emultempl/mmixelf.em +++ b/ld/emultempl/mmixelf.em @@ -1,5 +1,5 @@ # This shell script emits a C file. -*- C -*- -# Copyright 2001 Free Software Foundation, Inc. +# Copyright 2001, 2002 Free Software Foundation, Inc. # # This file is part of GLD, the Gnu Linker. # @@ -39,7 +39,7 @@ elfmmix_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; } EOF diff --git a/ld/emultempl/mmo.em b/ld/emultempl/mmo.em index 8b17dcc2ac7..e65e89bc5d9 100644 --- a/ld/emultempl/mmo.em +++ b/ld/emultempl/mmo.em @@ -32,7 +32,7 @@ EOF cat >>e${EMULATION_NAME}.c <<EOF -static boolean mmo_place_orphan +static bfd_boolean mmo_place_orphan PARAMS ((lang_input_statement_type *, asection *)); static asection *output_prev_sec_find PARAMS ((lang_output_section_statement_type *)); @@ -84,7 +84,7 @@ struct orphan_save { SEC_READONLY sections right after MMO_TEXT_SECTION_NAME. Much borrowed from elf32.em. */ -static boolean +static bfd_boolean mmo_place_orphan (file, s) lang_input_statement_type *file; asection *s; @@ -100,7 +100,7 @@ mmo_place_orphan (file, s) if (link_info.relocateable || (bfd_get_section_flags (s->owner, s) & (SEC_EXCLUDE | SEC_LOAD)) != SEC_LOAD) - return false; + return FALSE; /* Only care for sections we're going to load. */ os = lang_output_section_find (bfd_get_section_name (s->owner, s)); @@ -110,13 +110,13 @@ mmo_place_orphan (file, s) if (os != NULL) { lang_add_section (&os->children, s, os, file); - return true; + return TRUE; } /* If this section does not have .text-type section flags or there's no MMO_TEXT_SECTION_NAME, we don't have anything to say. */ if ((bfd_get_section_flags (s->owner, s) & (SEC_CODE | SEC_READONLY)) == 0) - return false; + return FALSE; if (hold_text.os == NULL) hold_text.os = lang_output_section_find (MMO_TEXT_SECTION_NAME); @@ -155,7 +155,7 @@ mmo_place_orphan (file, s) snew = os->bfd_section; if (snew == NULL) /* /DISCARD/ section. */ - return true; + return TRUE; /* We need an output section for .text as a root, so if there was none (might happen with a peculiar linker script such as in "map @@ -164,7 +164,7 @@ mmo_place_orphan (file, s) if (hold_text.os == NULL) { if (os == NULL) - return false; + return FALSE; hold_text.os = os; } @@ -219,7 +219,7 @@ mmo_place_orphan (file, s) place->stmt = add.tail; } - return true; + return TRUE; } /* Remove the spurious settings of SEC_RELOC that make it to the output at diff --git a/ld/emultempl/needrelax.em b/ld/emultempl/needrelax.em index 9bb96c27648..242b7787435 100644 --- a/ld/emultempl/needrelax.em +++ b/ld/emultempl/needrelax.em @@ -1,5 +1,5 @@ # This shell script emits a C file. -*- C -*- -# Copyright (C) 2001 Free Software Foundation, Inc. +# Copyright 2001, 2002 Free Software Foundation, Inc. # # This file is part of GLD, the Gnu Linker. # @@ -35,6 +35,6 @@ need_relax_${EMULATION_NAME}_before_allocation () /* Force -relax on if not doing a relocatable link. */ if (! link_info.relocateable) - command_line.relax = true; + command_line.relax = TRUE; } EOF diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index e2342d4325f..ca970238ce2 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -111,12 +111,12 @@ static void gld_${EMULATION_NAME}_after_parse PARAMS ((void)); static void gld_${EMULATION_NAME}_before_allocation PARAMS ((void)); static asection *output_prev_sec_find PARAMS ((lang_output_section_statement_type *)); -static boolean gld_${EMULATION_NAME}_place_orphan +static bfd_boolean gld_${EMULATION_NAME}_place_orphan PARAMS ((lang_input_statement_type *, asection *)); static char *gld_${EMULATION_NAME}_get_script PARAMS ((int *)); static int gld_${EMULATION_NAME}_parse_args PARAMS ((int, char **)); static void gld_${EMULATION_NAME}_finish PARAMS ((void)); -static boolean gld_${EMULATION_NAME}_open_dynamic_archive +static bfd_boolean gld_${EMULATION_NAME}_open_dynamic_archive PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *)); static void gld_${EMULATION_NAME}_list_options PARAMS ((FILE *)); static void set_pe_name PARAMS ((char *, long)); @@ -125,17 +125,17 @@ static void set_pe_value PARAMS ((char *)); static void set_pe_stack_heap PARAMS ((char *, char *)); #ifdef DLL_SUPPORT -static boolean pe_undef_cdecl_match +static bfd_boolean pe_undef_cdecl_match PARAMS ((struct bfd_link_hash_entry *, PTR)); static void pe_fixup_stdcalls PARAMS ((void)); static int make_import_fixup PARAMS ((arelent *, asection *)); static void pe_find_data_imports PARAMS ((void)); #endif -static boolean pr_sym PARAMS ((struct bfd_hash_entry *, PTR string)); -static boolean gld_${EMULATION_NAME}_unrecognized_file +static bfd_boolean pr_sym PARAMS ((struct bfd_hash_entry *, PTR string)); +static bfd_boolean gld_${EMULATION_NAME}_unrecognized_file PARAMS ((lang_input_statement_type *)); -static boolean gld_${EMULATION_NAME}_recognized_file +static bfd_boolean gld_${EMULATION_NAME}_recognized_file PARAMS ((lang_input_statement_type *)); static int gld_${EMULATION_NAME}_find_potential_libraries PARAMS ((char *, lang_input_statement_type *)); @@ -171,10 +171,10 @@ gld_${EMULATION_NAME}_before_parse() ldfile_output_architecture = bfd_arch_${ARCH}; output_filename = "${EXECUTABLE_NAME:-a.exe}"; #ifdef DLL_SUPPORT - config.dynamic_link = true; + config.dynamic_link = TRUE; config.has_shared = 1; link_info.pei386_auto_import = -1; - link_info.pei386_runtime_pseudo_reloc = false; + link_info.pei386_runtime_pseudo_reloc = FALSE; #if (PE_DEF_SUBSYSTEM == 9) || (PE_DEF_SUBSYSTEM == 2) #if defined TARGET_IS_mipspe || defined TARGET_IS_armpe @@ -253,7 +253,7 @@ static struct option longopts[] = { {"output-def", required_argument, NULL, OPTION_OUT_DEF}, {"export-all-symbols", no_argument, NULL, OPTION_EXPORT_ALL}, {"exclude-symbols", required_argument, NULL, OPTION_EXCLUDE_SYMBOLS}, - {"exclude-libs", required_argument, NULL, OPTION_EXCLUDE_LIBS}, + {"exclude-libs", required_argument, NULL, OPTION_EXCLUDE_LIBS}, {"kill-at", no_argument, NULL, OPTION_KILL_ATS}, {"add-stdcall-alias", no_argument, NULL, OPTION_STDCALL_ALIASES}, {"enable-stdcall-fixup", no_argument, NULL, OPTION_ENABLE_STDCALL_FIXUP}, @@ -342,7 +342,7 @@ gld_${EMULATION_NAME}_list_options (file) fprintf (file, _(" --disable-stdcall-fixup Don't link _sym to _sym@nn\n")); fprintf (file, _(" --enable-stdcall-fixup Link _sym to _sym@nn without warnings\n")); fprintf (file, _(" --exclude-symbols sym,sym,... Exclude symbols from automatic export\n")); - fprintf (file, _(" --exclude-libs lib,lib,... Exclude libraries from automatic export\n")); + fprintf (file, _(" --exclude-libs lib,lib,... Exclude libraries from automatic export\n")); fprintf (file, _(" --export-all-symbols Automatically export all globals to DLL\n")); fprintf (file, _(" --kill-at Remove @nn from exported symbols\n")); fprintf (file, _(" --out-implib <file> Generate import library\n")); @@ -789,7 +789,7 @@ char * pe_data_import_dll; #ifdef DLL_SUPPORT static struct bfd_link_hash_entry *pe_undef_found_sym; -static boolean +static bfd_boolean pe_undef_cdecl_match (h, string) struct bfd_link_hash_entry *h; PTR string; @@ -801,9 +801,9 @@ pe_undef_cdecl_match (h, string) && h->root.string[sl] == '@') { pe_undef_found_sym = h; - return false; + return FALSE; } - return true; + return TRUE; } static void @@ -821,7 +821,7 @@ pe_fixup_stdcalls () char* at = strchr (undef->root.string, '@'); int lead_at = (*undef->root.string == '@'); /* For now, don't try to fixup fastcall symbols. */ - + if (at && !lead_at) { /* The symbol is a stdcall symbol, so let's look for a @@ -965,7 +965,7 @@ pe_find_data_imports () } #endif /* DLL_SUPPORT */ -static boolean +static bfd_boolean pr_sym (h, string) struct bfd_hash_entry *h; PTR string ATTRIBUTE_UNUSED; @@ -973,7 +973,7 @@ pr_sym (h, string) if (pe_dll_extra_pe_debug) printf ("+%s\n",h->string); - return true; + return TRUE; } @@ -1124,7 +1124,7 @@ gld_${EMULATION_NAME}_after_open () /* 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) @@ -1279,7 +1279,7 @@ saw_option (char * option) } #endif /* DLL_SUPPORT */ -static boolean +static bfd_boolean gld_${EMULATION_NAME}_unrecognized_file(entry) lang_input_statement_type *entry ATTRIBUTE_UNUSED; { @@ -1313,7 +1313,7 @@ gld_${EMULATION_NAME}_unrecognized_file(entry) sprintf(buf, "_%s", 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 (_("%P%F: bfd_link_hash_lookup failed: %E\n")); if (h->type == bfd_link_hash_new) @@ -1362,14 +1362,14 @@ gld_${EMULATION_NAME}_unrecognized_file(entry) if (pe_def_file->heap_commit != -1) pe.SizeOfHeapCommit = pe_def_file->heap_commit; } - return true; + return TRUE; } } #endif - return false; + return FALSE; } -static boolean +static bfd_boolean gld_${EMULATION_NAME}_recognized_file(entry) lang_input_statement_type *entry ATTRIBUTE_UNUSED; { @@ -1394,7 +1394,7 @@ gld_${EMULATION_NAME}_recognized_file(entry) return pe_implied_import_dll (entry->filename); } #endif - return false; + return FALSE; } static void @@ -1405,7 +1405,8 @@ gld_${EMULATION_NAME}_finish () if (thumb_entry_symbol != NULL) { - h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol, false, false, true); + h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol, + FALSE, FALSE, TRUE); if (h != (struct bfd_link_hash_entry *) NULL && (h->type == bfd_link_hash_defined @@ -1519,7 +1520,7 @@ struct orphan_save lang_statement_union_type **stmt; }; -static boolean +static bfd_boolean gld_${EMULATION_NAME}_place_orphan (file, s) lang_input_statement_type *file; asection *s; @@ -1760,11 +1761,11 @@ gld_${EMULATION_NAME}_place_orphan (file, s) if (dollar != NULL) { - boolean found_dollar; + bfd_boolean found_dollar; /* The section name has a '$'. Sort it with the other '$' sections. */ - found_dollar = false; + found_dollar = FALSE; for ( ; *pl != NULL; pl = &(*pl)->header.next) { lang_input_section_type *ls; @@ -1783,7 +1784,7 @@ gld_${EMULATION_NAME}_place_orphan (file, s) } else { - found_dollar = true; + found_dollar = TRUE; if (strcmp (secname, lname) < 0) break; } @@ -1799,10 +1800,10 @@ gld_${EMULATION_NAME}_place_orphan (file, s) free (hold_section_name); - return true; + return TRUE; } -static boolean +static bfd_boolean gld_${EMULATION_NAME}_open_dynamic_archive (arch, search, entry) const char * arch ATTRIBUTE_UNUSED; search_dirs_type * search; @@ -1812,7 +1813,7 @@ gld_${EMULATION_NAME}_open_dynamic_archive (arch, search, entry) char * string; if (! entry->is_archive) - return false; + return FALSE; filename = entry->filename; @@ -1863,7 +1864,7 @@ gld_${EMULATION_NAME}_open_dynamic_archive (arch, search, entry) if (! ldfile_try_open_bfd (string, entry)) { free (string); - return false; + return FALSE; } } } @@ -1880,7 +1881,7 @@ gld_${EMULATION_NAME}_open_dynamic_archive (arch, search, entry) if (! ldfile_try_open_bfd (string, entry)) { free (string); - return false; + return FALSE; } } } @@ -1890,7 +1891,7 @@ gld_${EMULATION_NAME}_open_dynamic_archive (arch, search, entry) entry->filename = string; - return true; + return TRUE; } static int @@ -1913,19 +1914,19 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 0; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return EOF -sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c -echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c -echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c -echo ' ; else return' >> e${EMULATION_NAME}.c -sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c -echo '; }' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c +echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c +echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c +echo ' ; else return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c +echo '; }' >> e${EMULATION_NAME}.c cat >>e${EMULATION_NAME}.c <<EOF diff --git a/ld/emultempl/ppc64elf.em b/ld/emultempl/ppc64elf.em index b5dd6a2683c..185a5907cca 100644 --- a/ld/emultempl/ppc64elf.em +++ b/ld/emultempl/ppc64elf.em @@ -41,13 +41,20 @@ static bfd_signed_vma group_size = 1; /* Whether to add ".foo" entries for each "foo" in a version script. */ static int dotsyms = 1; -static void ppc_create_output_section_statements PARAMS ((void)); -static void ppc_after_open PARAMS ((void)); -static void ppc_before_allocation PARAMS ((void)); -static asection *ppc_add_stub_section PARAMS ((const char *, asection *)); -static void ppc_layout_sections_again PARAMS ((void)); -static void gld${EMULATION_NAME}_after_allocation PARAMS ((void)); -static void build_section_lists PARAMS ((lang_statement_union_type *)); +static void ppc_create_output_section_statements + PARAMS ((void)); +static void ppc_after_open + PARAMS ((void)); +static void ppc_before_allocation + PARAMS ((void)); +static asection *ppc_add_stub_section + PARAMS ((const char *, asection *)); +static void ppc_layout_sections_again + PARAMS ((void)); +static void gld${EMULATION_NAME}_after_allocation + PARAMS ((void)); +static void build_section_lists + PARAMS ((lang_statement_union_type *)); static struct bfd_elf_version_expr *gld${EMULATION_NAME}_new_vers_pattern PARAMS ((struct bfd_elf_version_expr *)); @@ -105,16 +112,16 @@ struct hook_stub_info /* Traverse the linker tree to find the spot where the stub goes. */ -static boolean hook_in_stub +static bfd_boolean hook_in_stub PARAMS ((struct hook_stub_info *, lang_statement_union_type **)); -static boolean +static bfd_boolean hook_in_stub (info, lp) struct hook_stub_info *info; lang_statement_union_type **lp; { lang_statement_union_type *l; - boolean ret; + bfd_boolean ret; for (; (l = *lp) != NULL; lp = &l->header.next) { @@ -152,7 +159,7 @@ hook_in_stub (info, lp) before its associated input section. */ *lp = info->add.head; *(info->add.tail) = l; - return true; + return TRUE; } break; @@ -173,7 +180,7 @@ hook_in_stub (info, lp) break; } } - return false; + return FALSE; } diff --git a/ld/emultempl/sh64elf.em b/ld/emultempl/sh64elf.em index ffa3906b8e1..8ec2c31f3e1 100644 --- a/ld/emultempl/sh64elf.em +++ b/ld/emultempl/sh64elf.em @@ -1,5 +1,5 @@ # This shell script emits a C file. -*- C -*- -# Copyright (C) 2000, 2001 Free Software Foundation, Inc. +# Copyright 2000, 2001, 2002 Free Software Foundation, Inc. # # This file is part of GLD, the Gnu Linker. # @@ -81,7 +81,7 @@ sh64_elf_${EMULATION_NAME}_before_allocation () } } - command_line.relax = false; + command_line.relax = FALSE; } /* We wouldn't need to do anything when there's already a .cranges @@ -106,7 +106,7 @@ sh64_elf_${EMULATION_NAME}_before_allocation () { einfo (_("%P: Sorry, turning off relaxing: SHmedia sections present.\n")); einfo (" %I\n", f); - command_line.relax = false; + command_line.relax = FALSE; goto done_scanning_shmedia_sections; } } @@ -205,13 +205,12 @@ sh64_elf_${EMULATION_NAME}_before_allocation () = bfd_make_section (output_bfd, SH64_CRANGES_SECTION_NAME); if (cranges == NULL - || (bfd_set_section_flags (output_bfd, + || !bfd_set_section_flags (output_bfd, cranges, SEC_LINKER_CREATED | SEC_KEEP | SEC_HAS_CONTENTS - | SEC_DEBUGGING) - == false)) + | SEC_DEBUGGING)) einfo (_("%P%E%F: Can't make .cranges section\n")); } @@ -268,7 +267,7 @@ sh64_elf_${EMULATION_NAME}_after_allocation () osec = osec->next) { bfd_vma oflags_isa = 0; - boolean need_check_cranges = false; + bfd_boolean need_check_cranges = FALSE; /* Omit excluded or garbage-collected sections. */ if (bfd_get_section_flags (output_bfd, osec) & SEC_EXCLUDE) @@ -335,7 +334,7 @@ sh64_elf_${EMULATION_NAME}_after_allocation () sh64_elf_section_data (osec)->contents_flags = SHF_SH5_ISA32_MIXED; - need_check_cranges = true; + need_check_cranges = TRUE; goto break_2; } } diff --git a/ld/emultempl/sunos.em b/ld/emultempl/sunos.em index 64e5ea5dd45..c00c0dbdde2 100644 --- a/ld/emultempl/sunos.em +++ b/ld/emultempl/sunos.em @@ -1,6 +1,6 @@ # This shell script emits a C file. -*- C -*- # It does some substitutions. -if [ -z "$MACHINE" ]; then +if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH} else OUTPUT_ARCH=${ARCH}:${MACHINE} @@ -9,7 +9,7 @@ cat >e${EMULATION_NAME}.c <<EOF /* This file is is generated by a shell script. DO NOT EDIT! */ /* SunOS emulation code for ${EMULATION_NAME} - Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. Written by Steve Chamberlain <sac@cygnus.com> SunOS shared library support by Ian Lance Taylor <ian@cygnus.com> @@ -68,13 +68,13 @@ static void gld${EMULATION_NAME}_create_output_section_statements static void gld${EMULATION_NAME}_find_so PARAMS ((lang_input_statement_type *)); static char *gld${EMULATION_NAME}_search_dir - PARAMS ((const char *, const char *, boolean *)); + PARAMS ((const char *, const char *, bfd_boolean *)); static void gld${EMULATION_NAME}_after_open PARAMS ((void)); static void gld${EMULATION_NAME}_check_needed PARAMS ((lang_input_statement_type *)); -static boolean gld${EMULATION_NAME}_search_needed +static bfd_boolean gld${EMULATION_NAME}_search_needed PARAMS ((const char *, const char *)); -static boolean gld${EMULATION_NAME}_try_needed +static bfd_boolean gld${EMULATION_NAME}_try_needed PARAMS ((const char *, const char *)); static void gld${EMULATION_NAME}_before_allocation PARAMS ((void)); static void gld${EMULATION_NAME}_find_assignment @@ -98,8 +98,8 @@ gld${EMULATION_NAME}_before_parse() } else ldfile_output_architecture = bfd_arch_${ARCH}; - config.dynamic_link = true; - config.has_shared = true; + config.dynamic_link = TRUE; + config.has_shared = TRUE; } /* This is called after the command line arguments have been parsed, @@ -131,7 +131,7 @@ cat >>e${EMULATION_NAME}.c <<EOF if (c != NULL) *c++ = '\0'; if (*l != '\0') - ldfile_add_library_path (l, false); + ldfile_add_library_path (l, FALSE); if (c == NULL) break; l = c; @@ -179,7 +179,7 @@ gld${EMULATION_NAME}_find_so (inp) for (search = search_head; search != NULL; search = search->next) { - boolean found_static; + bfd_boolean found_static; found = gld${EMULATION_NAME}_search_dir (search->name, inp->filename, &found_static); @@ -202,7 +202,7 @@ gld${EMULATION_NAME}_find_so (inp) /* Turn off the search_dirs_flag to prevent ldfile_open_file from searching for this file again. */ - inp->search_dirs_flag = false; + inp->search_dirs_flag = FALSE; free (found); @@ -237,7 +237,7 @@ static char * gld${EMULATION_NAME}_search_dir (dirname, filename, found_static) const char *dirname; const char *filename; - boolean *found_static; + bfd_boolean *found_static; { int force_maj, force_min; const char *dot; @@ -252,7 +252,7 @@ gld${EMULATION_NAME}_search_dir (dirname, filename, found_static) int statval; struct stat st; - *found_static = false; + *found_static = FALSE; force_maj = -1; force_min = -1; @@ -284,7 +284,7 @@ gld${EMULATION_NAME}_search_dir (dirname, filename, found_static) if (dir == NULL) return NULL; dirnamelen = strlen (dirname); - + while ((entry = readdir (dir)) != NULL) { const char *s; @@ -297,7 +297,7 @@ gld${EMULATION_NAME}_search_dir (dirname, filename, found_static) if (dot == NULL && strcmp (entry->d_name + 3 + len, ".a") == 0) { - *found_static = true; + *found_static = TRUE; continue; } @@ -373,7 +373,7 @@ gld${EMULATION_NAME}_search_dir (dirname, filename, found_static) between after_open and check_needed. */ static struct bfd_link_needed_list *global_needed; -static boolean global_found; +static bfd_boolean global_found; /* This is called after all the input files have been opened. */ @@ -412,7 +412,7 @@ gld${EMULATION_NAME}_after_open () /* See if this file was included in the link explicitly. */ global_needed = l; - global_found = false; + global_found = FALSE; lang_for_each_input_file (gld${EMULATION_NAME}_check_needed); if (global_found) continue; @@ -513,7 +513,7 @@ cat >>e${EMULATION_NAME}.c <<EOF /* Search for a needed file in a path. */ -static boolean +static bfd_boolean gld${EMULATION_NAME}_search_needed (path, name) const char *path; const char *name; @@ -521,7 +521,7 @@ gld${EMULATION_NAME}_search_needed (path, name) const char *s; if (path == NULL || *path == '\0') - return false; + return FALSE; while (1) { const char *dir; @@ -542,7 +542,7 @@ gld${EMULATION_NAME}_search_needed (path, name) } if (gld${EMULATION_NAME}_try_needed (dir, name)) - return true; + return TRUE; if (dircopy != NULL) free (dircopy); @@ -552,41 +552,41 @@ gld${EMULATION_NAME}_search_needed (path, name) path = s + 1; } - return false; + return FALSE; } /* This function is called for each possible directory for a needed dynamic object. */ -static boolean +static bfd_boolean gld${EMULATION_NAME}_try_needed (dir, name) const char *dir; const char *name; { char *file; char *alc; - boolean ignore; + bfd_boolean ignore; bfd *abfd; file = gld${EMULATION_NAME}_search_dir (dir, name, &ignore); if (file == NULL) - return false; + return FALSE; alc = (char *) xmalloc (strlen (dir) + strlen (file) + 2); sprintf (alc, "%s/%s", dir, file); free (file); abfd = bfd_openr (alc, bfd_get_target (output_bfd)); if (abfd == NULL) - return false; + return FALSE; if (! bfd_check_format (abfd, bfd_object)) { (void) bfd_close (abfd); - return false; + return FALSE; } if ((bfd_get_file_flags (abfd) & DYNAMIC) == 0) { (void) bfd_close (abfd); - return false; + return FALSE; } /* We've found the needed dynamic object. */ @@ -595,7 +595,7 @@ gld${EMULATION_NAME}_try_needed (dir, name) if (! bfd_link_add_symbols (abfd, &link_info)) einfo ("%F%B: could not read symbols: %E\n", abfd); - return true; + return TRUE; } /* See if we have already included a needed object in the link. This @@ -611,7 +611,7 @@ gld${EMULATION_NAME}_check_needed (s) if (strncmp (global_needed->name, "-l", 2) != 0) { if (strcmp (s->filename, global_needed->name) == 0) - global_found = true; + global_found = TRUE; } else { @@ -651,7 +651,7 @@ gld${EMULATION_NAME}_check_needed (s) || (smin != lmin && smin != -1 && lmin != -1)) return; - global_found = true; + global_found = TRUE; } } @@ -659,7 +659,7 @@ gld${EMULATION_NAME}_check_needed (s) to lang_for_each_statement. Ick. */ static const char *find_assign; -static boolean found_assign; +static bfd_boolean found_assign; /* We need to use static variables to pass information around the call to lang_for_each_input_file. Ick. */ @@ -692,7 +692,7 @@ gld${EMULATION_NAME}_before_allocation () if (! link_info.shared && ! link_info.relocateable && ! entry_from_cmdline) { struct bfd_link_hash_entry *h; - + for (h = link_info.hash->undefs; h != NULL; h = h->next) { if (h->type == bfd_link_hash_undefined @@ -702,11 +702,11 @@ gld${EMULATION_NAME}_before_allocation () && strcmp (h->root.string, "__GLOBAL_OFFSET_TABLE_") != 0) { find_assign = h->root.string; - found_assign = false; + found_assign = FALSE; lang_for_each_statement (gld${EMULATION_NAME}_find_assignment); if (! found_assign) { - link_info.shared = true; + link_info.shared = TRUE; break; } } @@ -732,8 +732,8 @@ gld${EMULATION_NAME}_before_allocation () afterward. */ if (! link_info.relocateable) { - hdyn = bfd_link_hash_lookup (link_info.hash, "__DYNAMIC", true, false, - false); + hdyn = bfd_link_hash_lookup (link_info.hash, "__DYNAMIC", TRUE, FALSE, + FALSE); if (hdyn == NULL) einfo ("%P%F: bfd_link_hash_lookup: %E\n"); if (! bfd_sunos_record_link_assignment (output_bfd, &link_info, @@ -862,7 +862,7 @@ gld${EMULATION_NAME}_find_exp_assignment (exp) if (find_assign != NULL) { if (strcmp (find_assign, exp->assign.dst) == 0) - found_assign = true; + found_assign = TRUE; return; } @@ -986,14 +986,14 @@ then sc="-f stringify.sed" cat >>e${EMULATION_NAME}.c <<EOF -{ +{ *isfile = 0; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return EOF sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c @@ -1007,12 +1007,12 @@ else # Scripts read from the filesystem. cat >>e${EMULATION_NAME}.c <<EOF -{ +{ *isfile = 1; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable == true) + else if (link_info.relocateable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; @@ -1027,7 +1027,7 @@ fi cat >>e${EMULATION_NAME}.c <<EOF -struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = +struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = { gld${EMULATION_NAME}_before_parse, syslib_default, diff --git a/ld/emultempl/ticoff.em b/ld/emultempl/ticoff.em index eb103177f1d..363cb865c3d 100644 --- a/ld/emultempl/ticoff.em +++ b/ld/emultempl/ticoff.em @@ -3,7 +3,7 @@ (echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-) cat >>e${EMULATION_NAME}.c <<EOF /* This file is part of GLD, the Gnu Linker. - Copyright 1999, 2000 Free Software Foundation, Inc. + Copyright 1999, 2000, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -138,9 +138,9 @@ $s/$/n"/ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 0; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return `sed "$sc" ldscripts/${EMULATION_NAME}.xu`; - else if (link_info.relocateable == true) + else if (link_info.relocateable) return `sed "$sc" ldscripts/${EMULATION_NAME}.xr`; else if (!config.text_read_only) return `sed "$sc" ldscripts/${EMULATION_NAME}.xbn`; @@ -158,9 +158,9 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 1; - if (link_info.relocateable == true && config.build_constructors == true) + if (link_info.relocateable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable == true) + else if (link_info.relocateable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; @@ -70,7 +70,7 @@ name_list; struct wildcard_spec { const char *name; struct name_list *exclude_name_list; - boolean sorted; + bfd_boolean sorted; }; struct wildcard_list { @@ -93,11 +93,11 @@ typedef struct user_section_struct { typedef struct { /* 1 => assign space to common symbols even if `relocatable_output'. */ - boolean force_common_definition; + bfd_boolean force_common_definition; /* 1 => do not assign addresses to common symbols. */ - boolean inhibit_common_definition; - boolean relax; + bfd_boolean inhibit_common_definition; + bfd_boolean relax; /* Name of runtime interpreter to invoke. */ char *interpreter; @@ -115,22 +115,22 @@ typedef struct { /* Big or little endian as set on command line. */ enum { ENDIAN_UNSET = 0, ENDIAN_BIG, ENDIAN_LITTLE } endian; - /* If true, build MIPS embedded PIC relocation tables in the output + /* If TRUE, build MIPS embedded PIC relocation tables in the output file. */ - boolean embedded_relocs; + bfd_boolean embedded_relocs; - /* If true, force generation of a file with a .exe file. */ - boolean force_exe_suffix; + /* If TRUE, force generation of a file with a .exe file. */ + bfd_boolean force_exe_suffix; - /* If true, generate a cross reference report. */ - boolean cref; + /* If TRUE, generate a cross reference report. */ + bfd_boolean cref; - /* If true (which is the default), warn about mismatched input + /* If TRUE (which is the default), warn about mismatched input files. */ - boolean warn_mismatch; + bfd_boolean warn_mismatch; /* Remove unreferenced sections? */ - boolean gc_sections; + bfd_boolean gc_sections; /* Name of shared object whose symbol table should be filtered with this shared object. From the --filter option. */ @@ -144,9 +144,9 @@ typedef struct { .exports sections. */ char *version_exports_section; - /* If true (the default) check section addresses, once compute, + /* If TRUE (the default) check section addresses, once compute, fpor overlaps. */ - boolean check_section_addresses; + bfd_boolean check_section_addresses; } args_type; @@ -156,60 +156,60 @@ typedef int token_code_type; typedef struct { bfd_size_type specified_data_size; - boolean magic_demand_paged; - boolean make_executable; + bfd_boolean magic_demand_paged; + bfd_boolean make_executable; - /* If true, doing a dynamic link. */ - boolean dynamic_link; + /* If TRUE, doing a dynamic link. */ + bfd_boolean dynamic_link; - /* If true, -shared is supported. */ + /* 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. */ - boolean has_shared; + bfd_boolean has_shared; - /* If true, build constructors. */ - boolean build_constructors; + /* If TRUE, build constructors. */ + bfd_boolean build_constructors; - /* If true, warn about any constructors. */ - boolean warn_constructors; + /* If TRUE, warn about any constructors. */ + bfd_boolean warn_constructors; - /* If true, warn about merging common symbols with others. */ - boolean warn_common; + /* If TRUE, warn about merging common symbols with others. */ + bfd_boolean warn_common; - /* If true, only warn once about a particular undefined symbol. */ - boolean warn_once; + /* If TRUE, only warn once about a particular undefined symbol. */ + bfd_boolean warn_once; - /* If true, warn if multiple global-pointers are needed (Alpha + /* If TRUE, warn if multiple global-pointers are needed (Alpha only). */ - boolean warn_multiple_gp; + bfd_boolean warn_multiple_gp; - /* If true, warn if the starting address of an output section + /* If TRUE, warn if the starting address of an output section changes due to the alignment of an input section. */ - boolean warn_section_align; + bfd_boolean warn_section_align; - /* If true, warning messages are fatal */ - boolean fatal_warnings; + /* If TRUE, warning messages are fatal */ + bfd_boolean fatal_warnings; - boolean sort_common; + bfd_boolean sort_common; - boolean text_read_only; + bfd_boolean text_read_only; char *map_filename; FILE *map_file; - boolean stats; + bfd_boolean stats; /* If set, orphan input sections will be mapped to separate output sections. */ - boolean unique_orphan_sections; + bfd_boolean unique_orphan_sections; unsigned int split_by_reloc; bfd_size_type split_by_file; /* If set, only search library directories explicitly selected on the command line. */ - boolean only_cmd_line_lib_dirs; + bfd_boolean only_cmd_line_lib_dirs; } ld_config_type; extern ld_config_type config; @@ -221,7 +221,7 @@ typedef enum { } lang_phase_type; extern FILE * saved_script_handle; -extern boolean force_make_executable; +extern bfd_boolean force_make_executable; /* Non-zero if we are processing a --defsym from the command line. */ extern int parsing_defsym; diff --git a/ld/ldcref.c b/ld/ldcref.c index c6ea18bea4d..fec77b06413 100644 --- a/ld/ldcref.c +++ b/ld/ldcref.c @@ -1,5 +1,5 @@ /* ldcref.c -- output a cross reference table - Copyright 1996, 1997, 1998, 2000 Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 2000, 2002 Free Software Foundation, Inc. Written by Ian Lance Taylor <ian@cygnus.com> This file is part of GLD, the Gnu Linker. @@ -69,10 +69,10 @@ struct cref_hash_table { static struct bfd_hash_entry *cref_hash_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static boolean cref_fill_array PARAMS ((struct cref_hash_entry *, PTR)); +static bfd_boolean cref_fill_array PARAMS ((struct cref_hash_entry *, PTR)); static int cref_sort_array PARAMS ((const PTR, const PTR)); static void output_one_cref PARAMS ((FILE *, struct cref_hash_entry *)); -static boolean check_nocrossref PARAMS ((struct cref_hash_entry *, PTR)); +static bfd_boolean check_nocrossref PARAMS ((struct cref_hash_entry *, PTR)); static void check_section_sym_xref PARAMS ((lang_input_statement_type *)); static void check_refs PARAMS ((const char *, asection *, bfd *, struct lang_nocrossrefs *)); @@ -89,7 +89,7 @@ static void check_reloc_refs PARAMS ((bfd *, asection *, PTR)); #define cref_hash_traverse(table, func, info) \ (bfd_hash_traverse \ (&(table)->root, \ - (boolean (*) PARAMS ((struct bfd_hash_entry *, PTR))) (func), \ + (bfd_boolean (*) PARAMS ((struct bfd_hash_entry *, PTR))) (func), \ (info))) /* The cref hash table. */ @@ -98,7 +98,7 @@ static struct cref_hash_table cref_table; /* Whether the cref hash table has been initialized. */ -static boolean cref_initialized; +static bfd_boolean cref_initialized; /* The number of symbols seen so far. */ @@ -156,10 +156,10 @@ add_cref (name, abfd, section, value) { if (! bfd_hash_table_init (&cref_table.root, cref_hash_newfunc)) 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")); @@ -173,24 +173,24 @@ add_cref (name, abfd, section, value) 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; } /* 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 boolean +static bfd_boolean cref_fill_array (h, data) struct cref_hash_entry *h; PTR data; @@ -204,7 +204,7 @@ cref_fill_array (h, data) ++*pph; - return true; + return TRUE; } /* Sort an array of cref hash table entries by name. */ @@ -274,8 +274,8 @@ output_one_cref (fp, h) struct bfd_link_hash_entry *hl; struct cref_ref *r; - hl = bfd_link_hash_lookup (link_info.hash, h->root.string, false, - false, true); + hl = bfd_link_hash_lookup (link_info.hash, h->root.string, FALSE, + FALSE, TRUE); if (hl == NULL) einfo ("%P: symbol `%T' missing from main hash table\n", h->root.string); @@ -381,7 +381,7 @@ check_section_sym_xref (statement) /* Check one symbol to see if it is a prohibited cross reference. */ -static boolean +static bfd_boolean check_nocrossref (h, ignore) struct cref_hash_entry *h; PTR ignore ATTRIBUTE_UNUSED; @@ -393,22 +393,22 @@ check_nocrossref (h, ignore) 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 `%T' 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_get_section_name (defsec->owner, defsec); for (ncrs = nocrossref_list; ncrs != NULL; ncrs = ncrs->next) @@ -417,7 +417,7 @@ check_nocrossref (h, ignore) for (ref = h->refs; ref != NULL; ref = ref->next) check_refs (hl->root.string, hl->u.def.section, ref->abfd, ncrs); - return true; + return TRUE; } /* The struct is used to pass information from check_refs to diff --git a/ld/ldctor.c b/ld/ldctor.c index aa6a05bc92e..a5089cfeaa1 100644 --- a/ld/ldctor.c +++ b/ld/ldctor.c @@ -1,6 +1,6 @@ /* ldctor.c -- constructor support routines - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 - Free Software Foundation, Inc. + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, + 2002 Free Software Foundation, Inc. By Steve Chamberlain <sac@cygnus.com> This file is part of GLD, the Gnu Linker. @@ -43,7 +43,7 @@ lang_statement_list_type constructor_list; /* Whether the constructors should be sorted. Note that this is global for the entire link; we assume that there is only a single CONSTRUCTORS command in the linker script. */ -boolean constructors_sorted; +bfd_boolean constructors_sorted; /* The sets we have seen. */ struct set_info *sets; @@ -204,16 +204,16 @@ ctor_cmp (p1, p2) void ldctor_build_sets () { - static boolean called; + static bfd_boolean called; lang_statement_list_type *old; - boolean header_printed; + bfd_boolean 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) { @@ -256,7 +256,7 @@ ldctor_build_sets () lang_list_init (stat_ptr); - header_printed = false; + header_printed = FALSE; for (p = sets; p != (struct set_info *) NULL; p = p->next) { struct set_element *e; @@ -342,7 +342,7 @@ ldctor_build_sets () if (! header_printed) { minfo (_("\nSet Symbol\n\n")); - header_printed = true; + header_printed = TRUE; } minfo ("%s", p->h->root.string); diff --git a/ld/ldctor.h b/ld/ldctor.h index 7d8c848829f..e5e09267e40 100644 --- a/ld/ldctor.h +++ b/ld/ldctor.h @@ -1,5 +1,5 @@ /* ldctor.h - linker constructor support - Copyright 1991, 1992, 1993, 1994, 1995, 1998, 2000 + Copyright 1991, 1992, 1993, 1994, 1995, 1998, 2000, 2002 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -28,7 +28,7 @@ extern lang_statement_list_type constructor_list; /* Whether the constructors should be sorted. Note that this is global for the entire link; we assume that there is only a single CONSTRUCTORS command in the linker script. */ -extern boolean constructors_sorted; +extern bfd_boolean constructors_sorted; /* We keep a list of these structures for each set we build. */ @@ -51,9 +51,10 @@ struct set_element { extern struct set_info *sets; -extern void ldctor_add_set_entry PARAMS ((struct bfd_link_hash_entry *, - bfd_reloc_code_real_type, - const char *, asection *, bfd_vma)); -extern void ldctor_build_sets PARAMS ((void)); +extern void ldctor_add_set_entry + PARAMS ((struct bfd_link_hash_entry *, bfd_reloc_code_real_type, + const char *, asection *, bfd_vma)); +extern void ldctor_build_sets + PARAMS ((void)); #endif diff --git a/ld/ldemul.c b/ld/ldemul.c index c90673b919d..72e324a1af2 100644 --- a/ld/ldemul.c +++ b/ld/ldemul.c @@ -1,5 +1,5 @@ /* ldemul.c -- clearing house for ld emulation states - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000 + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -112,7 +112,7 @@ ldemul_get_script (isfile) return ld_emulation->get_script (isfile); } -boolean +bfd_boolean ldemul_open_dynamic_archive (arch, search, entry) const char *arch; search_dirs_type *search; @@ -120,17 +120,17 @@ ldemul_open_dynamic_archive (arch, search, entry) { if (ld_emulation->open_dynamic_archive) return (*ld_emulation->open_dynamic_archive) (arch, search, entry); - return false; + return FALSE; } -boolean +bfd_boolean ldemul_place_orphan (file, s) lang_input_statement_type *file; asection *s; { if (ld_emulation->place_orphan) return (*ld_emulation->place_orphan) (file, s); - return false; + return FALSE; } int @@ -148,24 +148,24 @@ ldemul_parse_args (argc, argv) /* Let the emulation code handle an unrecognized file. */ -boolean +bfd_boolean ldemul_unrecognized_file (entry) 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. */ -boolean +bfd_boolean ldemul_recognized_file (entry) lang_input_statement_type *entry; { if (ld_emulation->recognized_file) return (*ld_emulation->recognized_file) (entry); - return false; + return FALSE; } char * @@ -261,12 +261,12 @@ ldemul_list_emulations (f) FILE *f; { ld_emulation_xfer_type **eptr = ld_emulations; - boolean first = true; + bfd_boolean first = TRUE; for (; *eptr; eptr++) { if (first) - first = false; + first = FALSE; else fprintf (f, " "); fprintf (f, "%s", (*eptr)->emulation_name); diff --git a/ld/ldemul.h b/ld/ldemul.h index 3e275002ac5..a048b72ddc8 100644 --- a/ld/ldemul.h +++ b/ld/ldemul.h @@ -1,5 +1,5 @@ /* ld-emul.h - Linker emulation header file - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000 + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -17,40 +17,65 @@ #ifndef LDEMUL_H #define LDEMUL_H -extern void ldemul_hll PARAMS ((char *)); -extern void ldemul_syslib PARAMS ((char *)); -extern void ldemul_after_parse PARAMS ((void)); -extern void ldemul_before_parse PARAMS ((void)); -extern void ldemul_after_open PARAMS ((void)); -extern void ldemul_after_allocation PARAMS ((void)); -extern void ldemul_before_allocation PARAMS ((void)); -extern void ldemul_set_output_arch PARAMS ((void)); -extern char *ldemul_choose_target PARAMS ((int, char**)); -extern void ldemul_choose_mode PARAMS ((char *)); -extern void ldemul_list_emulations PARAMS ((FILE *)); -extern void ldemul_list_emulation_options PARAMS ((FILE *)); -extern char *ldemul_get_script PARAMS ((int *isfile)); -extern void ldemul_finish PARAMS ((void)); -extern void ldemul_set_symbols PARAMS ((void)); -extern void ldemul_create_output_section_statements PARAMS ((void)); -extern boolean ldemul_place_orphan +extern void ldemul_hll + PARAMS ((char *)); +extern void ldemul_syslib + PARAMS ((char *)); +extern void ldemul_after_parse + PARAMS ((void)); +extern void ldemul_before_parse + PARAMS ((void)); +extern void ldemul_after_open + PARAMS ((void)); +extern void ldemul_after_allocation + PARAMS ((void)); +extern void ldemul_before_allocation + PARAMS ((void)); +extern void ldemul_set_output_arch + PARAMS ((void)); +extern char *ldemul_choose_target + PARAMS ((int, char**)); +extern void ldemul_choose_mode + PARAMS ((char *)); +extern void ldemul_list_emulations + PARAMS ((FILE *)); +extern void ldemul_list_emulation_options + PARAMS ((FILE *)); +extern char *ldemul_get_script + PARAMS ((int *isfile)); +extern void ldemul_finish + PARAMS ((void)); +extern void ldemul_set_symbols + PARAMS ((void)); +extern void ldemul_create_output_section_statements + PARAMS ((void)); +extern bfd_boolean ldemul_place_orphan PARAMS ((struct lang_input_statement_struct *, asection *)); -extern int ldemul_parse_args PARAMS ((int, char **)); -extern boolean ldemul_unrecognized_file +extern int ldemul_parse_args + PARAMS ((int, char **)); +extern bfd_boolean ldemul_unrecognized_file PARAMS ((struct lang_input_statement_struct *)); -extern boolean ldemul_recognized_file +extern bfd_boolean ldemul_recognized_file PARAMS ((struct lang_input_statement_struct *)); -extern boolean ldemul_open_dynamic_archive +extern bfd_boolean ldemul_open_dynamic_archive PARAMS ((const char *, struct search_dirs *, struct lang_input_statement_struct *)); -extern char *ldemul_default_target PARAMS ((int, char**)); -extern void after_parse_default PARAMS ((void)); -extern void after_open_default PARAMS ((void)); -extern void after_allocation_default PARAMS ((void)); -extern void before_allocation_default PARAMS ((void)); -extern void set_output_arch_default PARAMS ((void)); -extern void syslib_default PARAMS ((char*)); -extern void hll_default PARAMS ((char*)); +extern char *ldemul_default_target + PARAMS ((int, char**)); +extern void after_parse_default + PARAMS ((void)); +extern void after_open_default + PARAMS ((void)); +extern void after_allocation_default + PARAMS ((void)); +extern void before_allocation_default + PARAMS ((void)); +extern void set_output_arch_default + PARAMS ((void)); +extern void syslib_default + PARAMS ((char*)); +extern void hll_default + PARAMS ((char*)); extern int ldemul_find_potential_libraries PARAMS ((char *, struct lang_input_statement_struct *)); extern struct bfd_elf_version_expr *ldemul_new_vers_pattern @@ -103,14 +128,14 @@ 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. */ - boolean (*open_dynamic_archive) + bfd_boolean (*open_dynamic_archive) PARAMS ((const char *arch, struct search_dirs *, struct lang_input_statement_struct *entry)); - /* Place an orphan section. Return true if it was placed, false if + /* Place an orphan section. Return TRUE if it was placed, FALSE if the default action should be taken. This field may be NULL, in which case the default action will always be taken. */ - boolean (*place_orphan) + bfd_boolean (*place_orphan) PARAMS ((struct lang_input_statement_struct *, asection *)); /* Run after assigning parsing with the args, but before @@ -122,16 +147,16 @@ typedef struct ld_emulation_xfer_struct { int (*parse_args) PARAMS ((int, char **)); /* Run to handle files which are not recognized as object files or - archives. Return true if the file was handled. */ - boolean (*unrecognized_file) + archives. Return TRUE if the file was handled. */ + bfd_boolean (*unrecognized_file) PARAMS ((struct lang_input_statement_struct *)); /* Run to list the command line options which parse_args handles. */ void (* list_options) PARAMS ((FILE *)); /* Run to specially handle files which *are* recognized as object - files or archives. Return true if the file was handled. */ - boolean (*recognized_file) + files or archives. Return TRUE if the file was handled. */ + bfd_boolean (*recognized_file) PARAMS ((struct lang_input_statement_struct *)); /* Called when looking for libraries in a directory specified diff --git a/ld/ldexp.c b/ld/ldexp.c index e88e322e723..9227dd63f26 100644 --- a/ld/ldexp.c +++ b/ld/ldexp.c @@ -41,11 +41,15 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "libiberty.h" #include "safe-ctype.h" -static void exp_print_token PARAMS ((token_code_type code, int infix_p)); -static void make_abs PARAMS ((etree_value_type *ptr)); -static etree_value_type new_abs PARAMS ((bfd_vma value)); -static void check PARAMS ((lang_output_section_statement_type *os, - const char *name, const char *op)); +static void exp_print_token + PARAMS ((token_code_type code, int infix_p)); +static void make_abs + PARAMS ((etree_value_type *ptr)); +static etree_value_type new_abs + PARAMS ((bfd_vma value)); +static void check + PARAMS ((lang_output_section_statement_type *os, const char *name, + const char *op)); static etree_value_type new_rel PARAMS ((bfd_vma, char *, lang_output_section_statement_type *section)); static etree_value_type new_rel_from_section @@ -78,7 +82,7 @@ static etree_value_type exp_fold_tree_no_dot struct exp_data_seg exp_data_seg; /* Print the string representation of the given token. Surround it - with spaces if INFIX_P is true. */ + with spaces if INFIX_P is TRUE. */ static void exp_print_token (code, infix_p) @@ -168,7 +172,7 @@ new_abs (value) bfd_vma value; { etree_value_type new; - new.valid_p = true; + new.valid_p = TRUE; new.section = abs_output_section; new.value = value; return new; @@ -233,7 +237,7 @@ new_rel (value, str, section) lang_output_section_statement_type *section; { etree_value_type new; - new.valid_p = true; + new.valid_p = TRUE; new.value = value; new.str = str; new.section = section; @@ -246,7 +250,7 @@ new_rel_from_section (value, section) lang_output_section_statement_type *section; { etree_value_type new; - new.valid_p = true; + new.valid_p = TRUE; new.value = value; new.str = NULL; new.section = section; @@ -278,7 +282,7 @@ fold_unary (tree, current_section, allocation_done, dot, dotp) result = new_rel_from_section (align_n (dot, result.value), current_section); else - result.valid_p = false; + result.valid_p = FALSE; break; case ABSOLUTE: @@ -288,7 +292,7 @@ fold_unary (tree, current_section, allocation_done, dot, dotp) result.section = abs_output_section; } else - result.valid_p = false; + result.valid_p = FALSE; break; case '~': @@ -314,7 +318,7 @@ fold_unary (tree, current_section, allocation_done, dot, dotp) result.value = align_n (dot, result.value); } else - result.valid_p = false; + result.valid_p = FALSE; break; case DATA_SEGMENT_END: @@ -331,7 +335,7 @@ fold_unary (tree, current_section, allocation_done, dot, dotp) } } else - result.valid_p = false; + result.valid_p = FALSE; break; default: @@ -462,7 +466,7 @@ fold_binary (tree, current_section, allocation_done, dot, dotp) & (maxpage - other.value); } else - result.valid_p = false; + result.valid_p = FALSE; break; default: @@ -471,7 +475,7 @@ fold_binary (tree, current_section, allocation_done, dot, dotp) } else { - result.valid_p = false; + result.valid_p = FALSE; } } @@ -504,7 +508,7 @@ etree_value_type invalid () { etree_value_type new; - new.valid_p = false; + new.valid_p = FALSE; return new; } @@ -528,29 +532,29 @@ fold_name (tree, current_section, allocation_done, dot) } else { - result.valid_p = false; + result.valid_p = FALSE; } break; case DEFINED: if (allocation_done == lang_first_phase_enum) - result.valid_p = false; + result.valid_p = FALSE; else { struct bfd_link_hash_entry *h; h = bfd_wrapped_link_hash_lookup (output_bfd, &link_info, tree->name.name, - false, false, true); + FALSE, FALSE, TRUE); result.value = (h != (struct bfd_link_hash_entry *) NULL && (h->type == bfd_link_hash_defined || h->type == bfd_link_hash_defweak || h->type == bfd_link_hash_common)); result.section = 0; - result.valid_p = true; + result.valid_p = TRUE; } break; case NAME: - result.valid_p = false; + result.valid_p = FALSE; if (tree->name.name[0] == '.' && tree->name.name[1] == 0) { if (allocation_done != lang_first_phase_enum) @@ -564,7 +568,7 @@ fold_name (tree, current_section, allocation_done, dot) h = bfd_wrapped_link_hash_lookup (output_bfd, &link_info, tree->name.name, - false, false, true); + FALSE, FALSE, TRUE); if (h != NULL && (h->type == bfd_link_hash_defined || h->type == bfd_link_hash_defweak)) @@ -668,7 +672,7 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp) if (tree == NULL) { - result.valid_p = false; + result.valid_p = FALSE; return result; } @@ -680,7 +684,7 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp) case etree_rel: if (allocation_done != lang_final_phase_enum) - result.valid_p = false; + result.valid_p = FALSE; else result = new_rel ((tree->rel.value + tree->rel.section->output_section->vma @@ -761,15 +765,15 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp) dot, dotp); if (result.valid_p) { - boolean create; + bfd_boolean create; struct bfd_link_hash_entry *h; if (tree->type.node_class == etree_assign) - create = true; + create = TRUE; else - create = false; + create = FALSE; h = bfd_link_hash_lookup (link_info.hash, tree->assign.dst, - create, false, false); + create, FALSE, FALSE); if (h == (struct bfd_link_hash_entry *) NULL) { if (tree->type.node_class == etree_assign) @@ -1002,7 +1006,7 @@ exp_print_tree (tree) fprintf (config.map_file, "%s (UNDEFINED)", tree->assign.dst->name); #endif fprintf (config.map_file, "%s", tree->assign.dst); - 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: @@ -1014,7 +1018,7 @@ exp_print_tree (tree) case etree_binary: fprintf (config.map_file, "("); exp_print_tree (tree->binary.lhs); - exp_print_token (tree->type.node_code, true); + exp_print_token (tree->type.node_code, TRUE); exp_print_tree (tree->binary.rhs); fprintf (config.map_file, ")"); break; @@ -1026,7 +1030,7 @@ exp_print_tree (tree) exp_print_tree (tree->trinary.rhs); break; case etree_unary: - exp_print_token (tree->unary.type.node_code, false); + exp_print_token (tree->unary.type.node_code, FALSE); if (tree->unary.child) { fprintf (config.map_file, " ("); @@ -1051,7 +1055,7 @@ exp_print_tree (tree) } 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); } diff --git a/ld/ldexp.h b/ld/ldexp.h index 3f3508edb6e..df814df4df0 100644 --- a/ld/ldexp.h +++ b/ld/ldexp.h @@ -27,23 +27,25 @@ typedef struct { bfd_vma value; char *str; struct lang_output_section_statement_struct *section; - boolean valid_p; + bfd_boolean valid_p; } etree_value_type; typedef struct { int node_code; - enum { etree_binary, - etree_trinary, - etree_unary, - etree_name, - etree_assign, - etree_provide, - etree_provided, - etree_undef, - etree_unspec, - etree_value, - etree_assert, - etree_rel } node_class; + enum { + etree_binary, + etree_trinary, + etree_unary, + etree_name, + etree_assign, + etree_provide, + etree_provided, + etree_undef, + etree_unspec, + etree_value, + etree_assert, + etree_rel + } node_class; } node_type; typedef union etree_union { @@ -101,27 +103,42 @@ extern struct exp_data_seg { typedef struct _fill_type fill_type; -etree_type *exp_intop PARAMS ((bfd_vma)); -etree_type *exp_bigintop PARAMS ((bfd_vma, char *)); -etree_type *exp_relop PARAMS ((asection *, bfd_vma)); -etree_value_type invalid PARAMS ((void)); -etree_value_type exp_fold_tree PARAMS ((etree_type *, struct - lang_output_section_statement_struct *, - lang_phase_type, - bfd_vma, bfd_vma *)); -etree_type *exp_binop PARAMS ((int, etree_type *, etree_type *)); -etree_type *exp_trinop PARAMS ((int,etree_type *, etree_type *, etree_type *)); -etree_type *exp_unop PARAMS ((int, etree_type *)); -etree_type *exp_nameop PARAMS ((int, const char *)); -etree_type *exp_assop PARAMS ((int, const char *, etree_type *)); -etree_type *exp_provide PARAMS ((const char *, etree_type *)); -etree_type *exp_assert PARAMS ((etree_type *, const char *)); -void exp_print_tree PARAMS ((etree_type *)); -bfd_vma exp_get_vma PARAMS ((etree_type *, bfd_vma, char *, lang_phase_type)); -int exp_get_value_int PARAMS ((etree_type *, int, char *, lang_phase_type)); -fill_type *exp_get_fill PARAMS ((etree_type *, fill_type *, char *, - lang_phase_type)); -bfd_vma exp_get_abs_int PARAMS ((etree_type *, int, char *, lang_phase_type)); -bfd_vma align_n PARAMS ((bfd_vma, bfd_vma)); +etree_type *exp_intop + PARAMS ((bfd_vma)); +etree_type *exp_bigintop + PARAMS ((bfd_vma, char *)); +etree_type *exp_relop + PARAMS ((asection *, bfd_vma)); +etree_value_type invalid + PARAMS ((void)); +etree_value_type exp_fold_tree + PARAMS ((etree_type *, struct lang_output_section_statement_struct *, + lang_phase_type, bfd_vma, bfd_vma *)); +etree_type *exp_binop + PARAMS ((int, etree_type *, etree_type *)); +etree_type *exp_trinop + PARAMS ((int,etree_type *, etree_type *, etree_type *)); +etree_type *exp_unop + PARAMS ((int, etree_type *)); +etree_type *exp_nameop + PARAMS ((int, const char *)); +etree_type *exp_assop + PARAMS ((int, const char *, etree_type *)); +etree_type *exp_provide + PARAMS ((const char *, etree_type *)); +etree_type *exp_assert + PARAMS ((etree_type *, const char *)); +void exp_print_tree + PARAMS ((etree_type *)); +bfd_vma exp_get_vma + PARAMS ((etree_type *, bfd_vma, char *, lang_phase_type)); +int exp_get_value_int + PARAMS ((etree_type *, int, char *, lang_phase_type)); +fill_type *exp_get_fill + PARAMS ((etree_type *, fill_type *, char *, lang_phase_type)); +bfd_vma exp_get_abs_int + PARAMS ((etree_type *, int, char *, lang_phase_type)); +bfd_vma align_n + PARAMS ((bfd_vma, bfd_vma)); #endif diff --git a/ld/ldfile.c b/ld/ldfile.c index d706eec537f..34a25fa7b56 100644 --- a/ld/ldfile.c +++ b/ld/ldfile.c @@ -37,7 +37,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "libiberty.h" const char *ldfile_input_filename; -boolean ldfile_assumed_script = false; +bfd_boolean ldfile_assumed_script = FALSE; const char *ldfile_output_machine_name = ""; unsigned long ldfile_output_machine; enum bfd_architecture ldfile_output_architecture; @@ -75,7 +75,7 @@ static FILE *try_open PARAMS ((const char *name, const char *exten)); void ldfile_add_library_path (name, cmdline) const char *name; - boolean cmdline; + bfd_boolean cmdline; { search_dirs_type *new; @@ -92,7 +92,7 @@ ldfile_add_library_path (name, cmdline) /* Try to open a BFD for a lang_input_statement. */ -boolean +bfd_boolean ldfile_try_open_bfd (attempt, entry) const char *attempt; lang_input_statement_type *entry; @@ -111,7 +111,7 @@ ldfile_try_open_bfd (attempt, entry) { if (bfd_get_error () == bfd_error_invalid_target) einfo (_("%F%P: invalid BFD target `%s'\n"), entry->target); - return false; + return FALSE; } /* If we are searching for this file, see if the architecture is @@ -142,8 +142,8 @@ ldfile_try_open_bfd (attempt, entry) /* 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; @@ -210,7 +210,7 @@ ldfile_try_open_bfd (attempt, entry) } token = yylex (); } - ldfile_assumed_script = false; + ldfile_assumed_script = FALSE; fclose (yyin); yyin = NULL; if (skip) @@ -219,10 +219,10 @@ ldfile_try_open_bfd (attempt, entry) attempt, entry->local_sym_name); bfd_close (entry->the_bfd); entry->the_bfd = NULL; - return false; + return FALSE; } } - return true; + return TRUE; } if ((bfd_arch_get_compatible (check, output_bfd) == NULL) @@ -235,18 +235,18 @@ ldfile_try_open_bfd (attempt, entry) attempt, entry->local_sym_name); bfd_close (entry->the_bfd); entry->the_bfd = NULL; - return false; + return FALSE; } } } - 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. */ -boolean +bfd_boolean ldfile_open_file_search (arch, entry, lib, suffix) const char *arch; lang_input_statement_type *entry; @@ -260,7 +260,7 @@ ldfile_open_file_search (arch, entry, lib, suffix) if (! entry->is_archive) { if (ldfile_try_open_bfd (entry->filename, entry)) - return true; + return TRUE; } for (search = search_head; @@ -272,7 +272,7 @@ ldfile_open_file_search (arch, entry, lib, suffix) if (entry->dynamic && ! link_info.relocateable) { if (ldemul_open_dynamic_archive (arch, search, entry)) - return true; + return TRUE; } string = (char *) xmalloc (strlen (search->name) @@ -300,13 +300,13 @@ ldfile_open_file_search (arch, entry, lib, suffix) 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. */ @@ -331,7 +331,7 @@ ldfile_open_file (entry) else { search_arch_type *arch; - boolean found = false; + bfd_boolean found = FALSE; /* Try to open <filename><suffix> or lib<filename><suffix>.a */ for (arch = search_arch_head; @@ -354,7 +354,7 @@ ldfile_open_file (entry) /* If we have found the file, we don't need to search directories again. */ if (found) - entry->search_dirs_flag = false; + entry->search_dirs_flag = FALSE; else einfo (_("%F%P: cannot find %s\n"), entry->local_sym_name); } diff --git a/ld/ldfile.h b/ld/ldfile.h index 11a42322ab4..050a9896159 100644 --- a/ld/ldfile.h +++ b/ld/ldfile.h @@ -22,7 +22,7 @@ #define LDFILE_H extern const char *ldfile_input_filename; -extern boolean ldfile_assumed_script; +extern bfd_boolean ldfile_assumed_script; extern unsigned long ldfile_output_machine; extern enum bfd_architecture ldfile_output_architecture; extern const char *ldfile_output_machine_name; @@ -35,22 +35,27 @@ typedef struct search_dirs { struct search_dirs *next; /* Name of directory. */ const char *name; - /* true if this is from the command line. */ - boolean cmdline; + /* TRUE if this is from the command line. */ + bfd_boolean cmdline; } search_dirs_type; extern search_dirs_type *search_head; -extern void ldfile_add_arch PARAMS ((const char *)); -extern void ldfile_add_library_path PARAMS ((const char *, boolean cmdline)); -extern void ldfile_open_command_file PARAMS ((const char *name)); -extern void ldfile_open_file PARAMS ((struct lang_input_statement_struct *)); -extern boolean ldfile_try_open_bfd +extern void ldfile_add_arch + PARAMS ((const char *)); +extern void ldfile_add_library_path + PARAMS ((const char *, bfd_boolean cmdline)); +extern void ldfile_open_command_file + PARAMS ((const char *name)); +extern void ldfile_open_file + PARAMS ((struct lang_input_statement_struct *)); +extern bfd_boolean ldfile_try_open_bfd PARAMS ((const char *, struct lang_input_statement_struct *)); extern FILE *ldfile_find_command_file PARAMS ((const char *name, const char *extend)); -extern void ldfile_set_output_arch PARAMS ((const char *)); -extern boolean ldfile_open_file_search +extern void ldfile_set_output_arch + PARAMS ((const char *)); +extern bfd_boolean ldfile_open_file_search PARAMS ((const char *arch, struct lang_input_statement_struct *, const char *lib, const char *suffix)); diff --git a/ld/ldgram.y b/ld/ldgram.y index d2533c20a57..5904accce61 100644 --- a/ld/ldgram.y +++ b/ld/ldgram.y @@ -49,13 +49,13 @@ static enum section_type sectype; lang_memory_region_type *region; -boolean ldgram_want_filename = true; -FILE * saved_script_handle = NULL; -boolean force_make_executable = false; +bfd_boolean ldgram_want_filename = TRUE; +FILE *saved_script_handle = NULL; +bfd_boolean force_make_executable = FALSE; -boolean ldgram_in_script = false; -boolean ldgram_had_equals = false; -boolean ldgram_had_keep = false; +bfd_boolean ldgram_in_script = FALSE; +bfd_boolean ldgram_had_equals = FALSE; +bfd_boolean ldgram_had_keep = FALSE; char *ldgram_vers_current_lang = NULL; #define ERROR_NAME_MAX 20 @@ -81,8 +81,8 @@ static int error_index; union etree_union *etree; struct phdr_info { - boolean filehdr; - boolean phdrs; + bfd_boolean filehdr; + bfd_boolean phdrs; union etree_union *at; union etree_union *flags; } phdr; @@ -249,7 +249,7 @@ mri_script_command: mri_script_lines END { ldlex_popstate (); } | START NAME - { lang_add_entry ($2, false); } + { lang_add_entry ($2, FALSE); } | ; @@ -319,7 +319,7 @@ ifile_p1: | TARGET_K '(' NAME ')' { lang_add_target($3); } | SEARCH_DIR '(' filename ')' - { ldfile_add_library_path ($3, false); } + { ldfile_add_library_path ($3, FALSE); } | OUTPUT '(' filename ')' { lang_add_output($3, 1); } | OUTPUT_FORMAT '(' NAME ')' @@ -330,9 +330,9 @@ ifile_p1: | OUTPUT_ARCH '(' NAME ')' { ldfile_set_output_arch($3); } | FORCE_COMMON_ALLOCATION - { command_line.force_common_definition = true ; } + { command_line.force_common_definition = TRUE ; } | INHIBIT_COMMON_ALLOCATION - { command_line.inhibit_common_definition = true ; } + { command_line.inhibit_common_definition = TRUE ; } | INPUT '(' input_list ')' | GROUP { lang_enter_group (); } @@ -384,7 +384,7 @@ sec_or_group_p1: statement_anywhere: ENTRY '(' NAME ')' - { lang_add_entry ($3, false); } + { lang_add_entry ($3, FALSE); } | assignment end ; @@ -409,25 +409,25 @@ wildcard_spec: wildcard_name { $$.name = $1; - $$.sorted = false; + $$.sorted = FALSE; $$.exclude_name_list = NULL; } | EXCLUDE_FILE '(' exclude_name_list ')' wildcard_name { $$.name = $5; - $$.sorted = false; + $$.sorted = FALSE; $$.exclude_name_list = $3; } | SORT '(' wildcard_name ')' { $$.name = $3; - $$.sorted = true; + $$.sorted = TRUE; $$.exclude_name_list = NULL; } | SORT '(' EXCLUDE_FILE '(' exclude_name_list ')' wildcard_name ')' { $$.name = $7; - $$.sorted = true; + $$.sorted = TRUE; $$.exclude_name_list = $5; } ; @@ -478,7 +478,7 @@ input_section_spec_no_keep: struct wildcard_spec tmp; tmp.name = $1; tmp.exclude_name_list = NULL; - tmp.sorted = false; + tmp.sorted = FALSE; lang_add_wild (&tmp, NULL, ldgram_had_keep); } | '[' file_NAME_list ']' @@ -494,9 +494,9 @@ input_section_spec_no_keep: input_section_spec: input_section_spec_no_keep | KEEP '(' - { ldgram_had_keep = true; } + { ldgram_had_keep = TRUE; } input_section_spec_no_keep ')' - { ldgram_had_keep = false; } + { ldgram_had_keep = FALSE; } ; statement: @@ -513,7 +513,7 @@ statement: } | SORT '(' CONSTRUCTORS ')' { - constructors_sorted = true; + constructors_sorted = TRUE; lang_add_attribute (lang_constructors_statement_enum); } | input_section_spec @@ -697,9 +697,9 @@ low_level_library: floating_point_support: FLOAT - { lang_float(true); } + { lang_float(TRUE); } | NOFLOAT - { lang_float(false); } + { lang_float(FALSE); } ; nocrossref_list: @@ -933,7 +933,7 @@ phdr_opt: n = ((struct lang_output_section_phdr_list *) xmalloc (sizeof *n)); n->name = $3; - n->used = false; + n->used = FALSE; n->next = $1; $$ = n; } @@ -1015,9 +1015,9 @@ phdr_qualifiers: { $$ = $3; if (strcmp ($1, "FILEHDR") == 0 && $2 == NULL) - $$.filehdr = true; + $$.filehdr = TRUE; else if (strcmp ($1, "PHDRS") == 0 && $2 == NULL) - $$.phdrs = true; + $$.phdrs = TRUE; else if (strcmp ($1, "FLAGS") == 0 && $2 != NULL) $$.flags = $2; else diff --git a/ld/ldlang.c b/ld/ldlang.c index 80ba0c887fc..c2a11627a3a 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -55,9 +55,9 @@ static struct obstack stat_obstack; #define obstack_chunk_free free static const char *startup_file; static lang_statement_list_type input_file_chain; -static boolean placed_commons = false; +static bfd_boolean placed_commons = FALSE; static lang_output_section_statement_type *default_common_section; -static boolean map_option_f; +static bfd_boolean map_option_f; static bfd_vma print_dot; static lang_input_statement_type *first_file; static const char *current_target; @@ -69,52 +69,77 @@ static void lang_for_each_statement_worker PARAMS ((void (*) (lang_statement_union_type *), lang_statement_union_type *)); static lang_input_statement_type *new_afile - PARAMS ((const char *, lang_input_file_enum_type, const char *, boolean)); -static lang_memory_region_type *lang_memory_default PARAMS ((asection *)); -static void lang_map_flags PARAMS ((flagword)); -static void init_os PARAMS ((lang_output_section_statement_type *)); -static void exp_init_os PARAMS ((etree_type *)); -static void section_already_linked PARAMS ((bfd *, asection *, PTR)); + PARAMS ((const char *, lang_input_file_enum_type, const char *, + bfd_boolean)); +static lang_memory_region_type *lang_memory_default + PARAMS ((asection *)); +static void lang_map_flags + PARAMS ((flagword)); +static void init_os + PARAMS ((lang_output_section_statement_type *)); +static void exp_init_os + PARAMS ((etree_type *)); +static void section_already_linked + PARAMS ((bfd *, asection *, PTR)); static struct bfd_hash_entry *already_linked_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static void already_linked_table_init PARAMS ((void)); -static void already_linked_table_free PARAMS ((void)); -static boolean wildcardp PARAMS ((const char *)); +static void already_linked_table_init + PARAMS ((void)); +static void already_linked_table_free + PARAMS ((void)); +static bfd_boolean wildcardp + PARAMS ((const char *)); static lang_statement_union_type *wild_sort PARAMS ((lang_wild_statement_type *, struct wildcard_list *, lang_input_statement_type *, asection *)); static void output_section_callback PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *, lang_input_statement_type *, PTR)); -static lang_input_statement_type *lookup_name PARAMS ((const char *)); -static boolean load_symbols +static lang_input_statement_type *lookup_name + PARAMS ((const char *)); +static bfd_boolean load_symbols PARAMS ((lang_input_statement_type *, lang_statement_list_type *)); static void wild PARAMS ((lang_wild_statement_type *, const char *, lang_output_section_statement_type *)); -static bfd *open_output PARAMS ((const char *)); -static void ldlang_open_output PARAMS ((lang_statement_union_type *)); -static void open_input_bfds PARAMS ((lang_statement_union_type *, boolean)); -static void lang_reasonable_defaults PARAMS ((void)); -static void insert_undefined PARAMS ((const char *)); -static void lang_place_undefineds PARAMS ((void)); +static bfd *open_output + PARAMS ((const char *)); +static void ldlang_open_output + PARAMS ((lang_statement_union_type *)); +static void open_input_bfds + PARAMS ((lang_statement_union_type *, bfd_boolean)); +static void lang_reasonable_defaults + PARAMS ((void)); +static void insert_undefined + PARAMS ((const char *)); +static void lang_place_undefineds + PARAMS ((void)); static void map_input_to_output_sections PARAMS ((lang_statement_union_type *, const char *, lang_output_section_statement_type *)); -static void strip_excluded_output_sections PARAMS ((void)); +static void strip_excluded_output_sections + PARAMS ((void)); static void print_output_section_statement PARAMS ((lang_output_section_statement_type *)); static void print_assignment PARAMS ((lang_assignment_statement_type *, lang_output_section_statement_type *)); -static void print_input_statement PARAMS ((lang_input_statement_type *)); -static boolean print_one_symbol PARAMS ((struct bfd_link_hash_entry *, PTR)); -static void print_input_section PARAMS ((lang_input_section_type *)); -static void print_fill_statement PARAMS ((lang_fill_statement_type *)); -static void print_data_statement PARAMS ((lang_data_statement_type *)); -static void print_address_statement PARAMS ((lang_address_statement_type *)); -static void print_reloc_statement PARAMS ((lang_reloc_statement_type *)); -static void print_padding_statement PARAMS ((lang_padding_statement_type *)); +static void print_input_statement + PARAMS ((lang_input_statement_type *)); +static bfd_boolean print_one_symbol + PARAMS ((struct bfd_link_hash_entry *, PTR)); +static void print_input_section + PARAMS ((lang_input_section_type *)); +static void print_fill_statement + PARAMS ((lang_fill_statement_type *)); +static void print_data_statement + PARAMS ((lang_data_statement_type *)); +static void print_address_statement + PARAMS ((lang_address_statement_type *)); +static void print_reloc_statement + PARAMS ((lang_reloc_statement_type *)); +static void print_padding_statement + PARAMS ((lang_padding_statement_type *)); static void print_wild_statement PARAMS ((lang_wild_statement_type *, lang_output_section_statement_type *)); static void print_group @@ -123,51 +148,63 @@ static void print_statement PARAMS ((lang_statement_union_type *, lang_output_section_statement_type *)); static void print_statement_list PARAMS ((lang_statement_union_type *, lang_output_section_statement_type *)); -static void print_statements PARAMS ((void)); +static void print_statements + PARAMS ((void)); static void insert_pad PARAMS ((lang_statement_union_type **, fill_type *, unsigned int, asection *, bfd_vma)); static bfd_vma size_input_section PARAMS ((lang_statement_union_type **, lang_output_section_statement_type *, fill_type *, bfd_vma)); -static void lang_finish PARAMS ((void)); -static void ignore_bfd_errors PARAMS ((const char *, ...)); -static void lang_check PARAMS ((void)); -static void lang_common PARAMS ((void)); -static boolean lang_one_common PARAMS ((struct bfd_link_hash_entry *, PTR)); -static void lang_place_orphans PARAMS ((void)); -static int topower PARAMS ((int)); -static void lang_set_startof PARAMS ((void)); +static void lang_finish + PARAMS ((void)); +static void ignore_bfd_errors + PARAMS ((const char *, ...)); +static void lang_check + PARAMS ((void)); +static void lang_common + PARAMS ((void)); +static bfd_boolean lang_one_common + PARAMS ((struct bfd_link_hash_entry *, PTR)); +static void lang_place_orphans + PARAMS ((void)); +static int topower + PARAMS ((int)); +static void lang_set_startof + PARAMS ((void)); static void gc_section_callback PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *, lang_input_statement_type *, PTR)); -static void lang_get_regions PARAMS ((struct memory_region_struct **, - struct memory_region_struct **, - const char *, const char *, int)); -static void lang_record_phdrs PARAMS ((void)); -static void lang_gc_wild PARAMS ((lang_wild_statement_type *)); -static void lang_gc_sections_1 PARAMS ((lang_statement_union_type *)); -static void lang_gc_sections PARAMS ((void)); +static void lang_get_regions + PARAMS ((struct memory_region_struct **, struct memory_region_struct **, + const char *, const char *, int)); +static void lang_record_phdrs + PARAMS ((void)); +static void lang_gc_wild + PARAMS ((lang_wild_statement_type *)); +static void lang_gc_sections_1 + PARAMS ((lang_statement_union_type *)); +static void lang_gc_sections + PARAMS ((void)); static int lang_vers_match_lang_c PARAMS ((struct bfd_elf_version_expr *, const char *)); static int lang_vers_match_lang_cplusplus PARAMS ((struct bfd_elf_version_expr *, const char *)); static int lang_vers_match_lang_java PARAMS ((struct bfd_elf_version_expr *, const char *)); -static void lang_do_version_exports_section PARAMS ((void)); -static void lang_check_section_addresses PARAMS ((void)); +static void lang_do_version_exports_section + PARAMS ((void)); +static void lang_check_section_addresses + PARAMS ((void)); static void os_region_check PARAMS ((lang_output_section_statement_type *, struct memory_region_struct *, etree_type *, bfd_vma)); static bfd_vma lang_size_sections_1 PARAMS ((lang_statement_union_type *, lang_output_section_statement_type *, - lang_statement_union_type **, fill_type *, bfd_vma, boolean *)); - -typedef void (*callback_t) PARAMS ((lang_wild_statement_type *, - struct wildcard_list *, - asection *, - lang_input_statement_type *, - PTR)); + lang_statement_union_type **, fill_type *, bfd_vma, bfd_boolean *)); +typedef void (*callback_t) + PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *, + lang_input_statement_type *, PTR)); static void walk_wild PARAMS ((lang_wild_statement_type *, callback_t, PTR)); static void walk_wild_section @@ -176,13 +213,18 @@ static void walk_wild_section static void walk_wild_file PARAMS ((lang_wild_statement_type *, lang_input_statement_type *, callback_t, PTR)); - -static int get_target PARAMS ((const bfd_target *, PTR)); -static void stricpy PARAMS ((char *, char *)); -static void strcut PARAMS ((char *, char *)); -static int name_compare PARAMS ((char *, char *)); -static int closest_target_match PARAMS ((const bfd_target *, PTR)); -static char * get_first_input_target PARAMS ((void)); +static int get_target + PARAMS ((const bfd_target *, PTR)); +static void stricpy + PARAMS ((char *, char *)); +static void strcut + PARAMS ((char *, char *)); +static int name_compare + PARAMS ((char *, char *)); +static int closest_target_match + PARAMS ((const bfd_target *, PTR)); +static char * get_first_input_target + PARAMS ((void)); /* EXPORTS */ lang_output_section_statement_type *abs_output_section; @@ -191,11 +233,11 @@ lang_statement_list_type *stat_ptr = &statement_list; lang_statement_list_type file_chain = { NULL, NULL }; struct bfd_sym_chain entry_symbol = { NULL, NULL }; const char *entry_section = ".text"; -boolean entry_from_cmdline; -boolean lang_has_input_file = false; -boolean had_output_filename = false; -boolean lang_float_flag = false; -boolean delete_output_file_on_failure = false; +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; struct lang_nocrossrefs *nocrossref_list; struct unique_sections *unique_section_list; @@ -227,7 +269,7 @@ stat_alloc (size) return obstack_alloc (&stat_obstack, size); } -boolean +bfd_boolean unique_section_p (secnam) const char *secnam; { @@ -238,10 +280,10 @@ unique_section_p (secnam) ? fnmatch (unam->name, secnam, 0) == 0 : strcmp (unam->name, secnam) == 0) { - return true; + return TRUE; } - return false; + return FALSE; } /* Generic traversal routines for finding matching sections. */ @@ -268,7 +310,7 @@ walk_wild_section (ptr, file, callback, data) while (sec != NULL) { - boolean skip = false; + bfd_boolean skip = FALSE; struct name_list *list_tmp; /* Don't process sections from files which were @@ -490,7 +532,7 @@ new_afile (name, file_type, target, add_to_list) const char *name; lang_input_file_enum_type file_type; const char *target; - boolean add_to_list; + bfd_boolean add_to_list; { lang_input_statement_type *p; @@ -503,57 +545,57 @@ new_afile (name, file_type, target, add_to_list) p->header.next = NULL; } - lang_has_input_file = true; + lang_has_input_file = TRUE; p->target = target; switch (file_type) { case lang_input_file_is_symbols_only_enum: p->filename = name; - p->is_archive = false; - p->real = true; + p->is_archive = FALSE; + p->real = TRUE; p->local_sym_name = name; - p->just_syms_flag = true; - p->search_dirs_flag = false; + p->just_syms_flag = TRUE; + p->search_dirs_flag = FALSE; break; case lang_input_file_is_fake_enum: p->filename = name; - p->is_archive = false; - p->real = false; + p->is_archive = FALSE; + p->real = FALSE; p->local_sym_name = name; - p->just_syms_flag = false; - p->search_dirs_flag = false; + p->just_syms_flag = FALSE; + p->search_dirs_flag = FALSE; break; case lang_input_file_is_l_enum: - p->is_archive = true; + p->is_archive = TRUE; p->filename = name; - p->real = true; + p->real = TRUE; p->local_sym_name = concat ("-l", name, (const char *) NULL); - p->just_syms_flag = false; - p->search_dirs_flag = true; + p->just_syms_flag = FALSE; + p->search_dirs_flag = TRUE; break; case lang_input_file_is_marker_enum: p->filename = name; - p->is_archive = false; - p->real = false; + p->is_archive = FALSE; + p->real = FALSE; p->local_sym_name = name; - p->just_syms_flag = false; - p->search_dirs_flag = true; + p->just_syms_flag = FALSE; + p->search_dirs_flag = TRUE; break; case lang_input_file_is_search_file_enum: p->filename = name; - p->is_archive = false; - p->real = true; + p->is_archive = FALSE; + p->real = TRUE; p->local_sym_name = name; - p->just_syms_flag = false; - p->search_dirs_flag = true; + p->just_syms_flag = FALSE; + p->search_dirs_flag = TRUE; break; case lang_input_file_is_file_enum: p->filename = name; - p->is_archive = false; - p->real = true; + p->is_archive = FALSE; + p->real = TRUE; p->local_sym_name = name; - p->just_syms_flag = false; - p->search_dirs_flag = false; + p->just_syms_flag = FALSE; + p->search_dirs_flag = FALSE; break; default: FAIL (); @@ -565,7 +607,7 @@ new_afile (name, file_type, target, add_to_list) p->symbol_count = 0; p->dynamic = config.dynamic_link; p->whole_archive = whole_archive; - p->loaded = false; + p->loaded = FALSE; lang_statement_append (&input_file_chain, (lang_statement_union_type *) p, &p->next_real_file); @@ -578,8 +620,8 @@ lang_add_input_file (name, file_type, target) lang_input_file_enum_type file_type; const char *target; { - lang_has_input_file = true; - return new_afile (name, file_type, target, true); + lang_has_input_file = TRUE; + return new_afile (name, file_type, target, TRUE); } /* Build enough state so that the parser can build its tree. */ @@ -669,7 +711,7 @@ lang_memory_region_lookup (name) new->not_flags = 0; new->length = ~(bfd_size_type) 0; new->current = 0; - new->had_full_message = false; + new->had_full_message = FALSE; return new; } @@ -740,7 +782,7 @@ lang_output_section_statement_lookup (name) lookup->next = (lang_statement_union_type *) NULL; lookup->bfd_section = (asection *) NULL; - lookup->processed = false; + lookup->processed = FALSE; lookup->sectype = normal_section; lookup->addr_tree = (etree_type *) NULL; lang_list_init (&lookup->children); @@ -997,7 +1039,7 @@ section_already_linked (abfd, sec, data) already_linked_list = ((struct already_linked_hash_entry *) - bfd_hash_lookup (&already_linked_table, name, true, false)); + bfd_hash_lookup (&already_linked_table, name, TRUE, FALSE)); for (l = already_linked_list->entry; l != NULL; l = l->next) { @@ -1100,13 +1142,13 @@ already_linked_table_free () explicit actions, like foo.o(.text), bar.o(.text) and foo.o(.text, .data). */ -/* Return true if the PATTERN argument is a wildcard pattern. +/* Return TRUE if the PATTERN argument is a wildcard pattern. Although backslashes are treated specially if a pattern contains wildcards, we do not consider the mere presence of a backslash to be enough to cause the pattern to be treated as a wildcard. That lets us handle DOS filenames more naturally. */ -static boolean +static bfd_boolean wildcardp (pattern) const char *pattern; { @@ -1116,8 +1158,8 @@ wildcardp (pattern) if (*s == '?' || *s == '*' || *s == '[') - return true; - return false; + return TRUE; + return FALSE; } /* Add SECTION to the output section OUTPUT. Do this by creating a @@ -1132,29 +1174,29 @@ lang_add_section (ptr, section, output, file) lang_input_statement_type *file; { flagword flags; - boolean discard; + bfd_boolean discard; flags = bfd_get_section_flags (section->owner, section); - discard = false; + discard = FALSE; /* Discard sections marked with SEC_EXCLUDE if we are doing a final link. Discard debugging sections marked with SEC_EXCLUDE on a relocatable link too. */ if ((flags & SEC_EXCLUDE) != 0 && ((flags & SEC_DEBUGGING) != 0 || !link_info.relocateable)) - discard = true; + discard = TRUE; /* 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; /* 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; if (discard) { @@ -1168,7 +1210,7 @@ lang_add_section (ptr, section, output, file) if (section->output_section == NULL) { - boolean first; + bfd_boolean first; lang_input_section_type *new; flagword flags; @@ -1305,7 +1347,7 @@ wild_sort (wild, sec, file, section) if (wild->filenames_sorted) { const char *fn, *ln; - boolean fa, la; + bfd_boolean fa, la; int i; /* The PE support for the .idata section as generated by @@ -1317,24 +1359,24 @@ wild_sort (wild, sec, file, section) && bfd_my_archive (file->the_bfd) != NULL) { fn = bfd_get_filename (bfd_my_archive (file->the_bfd)); - fa = true; + fa = TRUE; } else { fn = file->filename; - fa = false; + fa = FALSE; } if (ls->ifile->the_bfd != NULL && bfd_my_archive (ls->ifile->the_bfd) != NULL) { ln = bfd_get_filename (bfd_my_archive (ls->ifile->the_bfd)); - la = true; + la = TRUE; } else { ln = ls->ifile->filename; - la = false; + la = FALSE; } i = strcmp (fn, ln); @@ -1458,7 +1500,7 @@ lookup_name (name) if (search == (lang_input_statement_type *) NULL) search = new_afile (name, lang_input_file_is_file_enum, default_target, - false); + FALSE); /* If we have already added this file, or this file is not real (FIXME: can that ever actually happen?) or the name is NULL @@ -1476,7 +1518,7 @@ lookup_name (name) /* Get the symbols for an input file. */ -static boolean +static bfd_boolean load_symbols (entry, place) lang_input_statement_type *entry; lang_statement_list_type *place; @@ -1484,7 +1526,7 @@ load_symbols (entry, place) char **matching; if (entry->loaded) - return true; + return TRUE; ldfile_open_file (entry); @@ -1493,13 +1535,13 @@ load_symbols (entry, place) { bfd_error_type err; lang_statement_list_type *hold; - boolean bad_load = true; + bfd_boolean bad_load = TRUE; err = bfd_get_error (); /* See if the emulation has some special knowledge. */ if (ldemul_unrecognized_file (entry)) - return true; + return TRUE; if (err == bfd_error_file_ambiguously_recognized) { @@ -1515,7 +1557,7 @@ load_symbols (entry, place) || place == NULL) einfo (_("%F%B: file not recognized: %E\n"), entry->the_bfd); else - bad_load = false; + bad_load = FALSE; bfd_close (entry->the_bfd); entry->the_bfd = NULL; @@ -1526,10 +1568,10 @@ load_symbols (entry, place) hold = stat_ptr; stat_ptr = place; - ldfile_assumed_script = true; + ldfile_assumed_script = TRUE; parser_input = input_script; yyparse (); - ldfile_assumed_script = false; + ldfile_assumed_script = FALSE; stat_ptr = hold; @@ -1537,7 +1579,7 @@ load_symbols (entry, place) } 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 @@ -1558,7 +1600,7 @@ load_symbols (entry, place) if (entry->whole_archive) { bfd *member = NULL; - boolean loaded = true; + bfd_boolean loaded = TRUE; for (;;) { @@ -1571,7 +1613,7 @@ load_symbols (entry, place) { einfo (_("%F%B: member %B in archive is not an object\n"), entry->the_bfd, member); - loaded = false; + loaded = FALSE; } if (! ((*link_info.callbacks->add_archive_element) @@ -1581,7 +1623,7 @@ load_symbols (entry, place) if (! bfd_link_add_symbols (member, &link_info)) { einfo (_("%F%B: could not read symbols: %E\n"), member); - loaded = false; + loaded = FALSE; } } @@ -1592,7 +1634,7 @@ load_symbols (entry, place) } if (bfd_link_add_symbols (entry->the_bfd, &link_info)) - entry->loaded = true; + entry->loaded = TRUE; else einfo (_("%F%B: could not read symbols: %E\n"), entry->the_bfd); @@ -1628,7 +1670,7 @@ wild (s, target, output) } } -/* Return true iff target is the sought target. */ +/* Return TRUE iff target is the sought target. */ static int get_target (target, data) @@ -1879,7 +1921,7 @@ open_output (name) einfo (_("%P%F: cannot open output file %s: %E\n"), name); } - delete_output_file_on_failure = true; + delete_output_file_on_failure = TRUE; #if 0 output->flags |= D_PAGED; @@ -1937,7 +1979,7 @@ ldlang_open_output (statement) static void open_input_bfds (s, force) lang_statement_union_type *s; - boolean force; + bfd_boolean force; { for (; s != (lang_statement_union_type *) NULL; s = s->header.next) { @@ -1967,7 +2009,7 @@ open_input_bfds (s, force) do { undefs = link_info.hash->undefs_tail; - open_input_bfds (s->group_statement.children.head, true); + open_input_bfds (s->group_statement.children.head, TRUE); } while (undefs != link_info.hash->undefs_tail); } @@ -1991,12 +2033,12 @@ open_input_bfds (s, force) && s->input_statement.loaded && bfd_check_format (s->input_statement.the_bfd, bfd_archive)) - s->input_statement.loaded = false; + s->input_statement.loaded = FALSE; lang_list_init (&add); if (! load_symbols (&s->input_statement, &add)) - config.make_executable = false; + config.make_executable = FALSE; if (add.head != NULL) { @@ -2071,7 +2113,7 @@ insert_undefined (name) { struct bfd_link_hash_entry *h; - h = bfd_link_hash_lookup (link_info.hash, name, true, false, true); + h = bfd_link_hash_lookup (link_info.hash, name, TRUE, FALSE, TRUE); if (h == (struct bfd_link_hash_entry *) NULL) einfo (_("%P%F: bfd_link_hash_lookup failed: %E\n")); if (h->type == bfd_link_hash_new) @@ -2307,7 +2349,7 @@ print_input_statement (statm) /* Print all symbols defined in a particular section. This is called via bfd_link_hash_traverse. */ -static boolean +static bfd_boolean print_one_symbol (hash_entry, ptr) struct bfd_link_hash_entry *hash_entry; PTR ptr; @@ -2330,7 +2372,7 @@ print_one_symbol (hash_entry, ptr) minfo (" %T\n", hash_entry->root.string); } - return true; + return TRUE; } /* Print information about an input section to the map file. */ @@ -2932,7 +2974,7 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax) lang_statement_union_type **prev; fill_type *fill; bfd_vma dot; - boolean *relax; + bfd_boolean *relax; { unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, ldfile_output_machine); @@ -3072,7 +3114,7 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax) (after - os->bfd_section->vma) * opb; dot = os->bfd_section->vma + os->bfd_section->_raw_size / opb; - os->processed = true; + os->processed = TRUE; if (os->update_dot_tree != 0) exp_fold_tree (os->update_dot_tree, abs_output_section, @@ -3207,12 +3249,12 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax) } else { - boolean again; + bfd_boolean again; if (! bfd_relax_section (i->owner, i, &link_info, &again)) einfo (_("%P%F: can't relax section: %E\n")); if (again) - *relax = true; + *relax = TRUE; } dot = size_input_section (prev, output_section_statement, output_section_statement->fill, dot); @@ -3305,7 +3347,7 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax) lang_statement_union_type **prev; fill_type *fill; bfd_vma dot; - boolean *relax; + bfd_boolean *relax; { bfd_vma result; @@ -3520,7 +3562,7 @@ lang_set_startof () buf = xmalloc (10 + strlen (secname)); sprintf (buf, ".startof.%s", secname); - h = bfd_link_hash_lookup (link_info.hash, buf, false, false, true); + h = bfd_link_hash_lookup (link_info.hash, buf, FALSE, FALSE, TRUE); if (h != NULL && h->type == bfd_link_hash_undefined) { h->type = bfd_link_hash_defined; @@ -3529,7 +3571,7 @@ lang_set_startof () } sprintf (buf, ".sizeof.%s", secname); - h = bfd_link_hash_lookup (link_info.hash, buf, false, false, true); + h = bfd_link_hash_lookup (link_info.hash, buf, FALSE, FALSE, TRUE); if (h != NULL && h->type == bfd_link_hash_undefined) { unsigned opb; @@ -3552,23 +3594,23 @@ static void lang_finish () { struct bfd_link_hash_entry *h; - boolean warn; + bfd_boolean warn; if (link_info.relocateable || link_info.shared) - warn = false; + warn = FALSE; else - warn = true; + warn = TRUE; if (entry_symbol.name == (const char *) NULL) { /* No entry has been specified. Look for start, but don't warn if we don't find it. */ entry_symbol.name = "start"; - warn = false; + warn = FALSE; } h = bfd_link_hash_lookup (link_info.hash, entry_symbol.name, - false, false, true); + FALSE, FALSE, TRUE); if (h != (struct bfd_link_hash_entry *) NULL && (h->type == bfd_link_hash_defined || h->type == bfd_link_hash_defweak) @@ -3733,7 +3775,7 @@ lang_common () /* Place one common symbol in the correct section. */ -static boolean +static bfd_boolean lang_one_common (h, info) struct bfd_link_hash_entry *h; PTR info; @@ -3745,14 +3787,14 @@ lang_one_common (h, info) ldfile_output_machine); 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 && power_of_two < (unsigned int) *(int *) info) - return true; + return TRUE; section = h->u.c.p->section; @@ -3779,7 +3821,7 @@ lang_one_common (h, info) if (config.map_file != NULL) { - static boolean header_printed; + static bfd_boolean header_printed; int len; char *name; char buf[50]; @@ -3788,7 +3830,7 @@ lang_one_common (h, info) { minfo (_("\nAllocating common symbols\n")); minfo (_("Common symbol size file\n\n")); - header_printed = true; + header_printed = TRUE; } name = demangle (h->root.string); @@ -3824,7 +3866,7 @@ lang_one_common (h, info) minfo ("%B\n", section->owner); } - return true; + return TRUE; } /* Run through the input files and ensure that every input section has @@ -4027,7 +4069,7 @@ lang_add_output (name, from_script) if (!had_output_filename || !from_script) { output_filename = name; - had_output_filename = true; + had_output_filename = TRUE; } } @@ -4196,7 +4238,7 @@ lang_gc_sections () for (ulist = link_info.gc_sym_list; ulist; ulist = ulist->next) { h = bfd_link_hash_lookup (link_info.hash, ulist->name, - false, false, false); + FALSE, FALSE, FALSE); if (h != (struct bfd_link_hash_entry *) NULL && (h->type == bfd_link_hash_defined @@ -4228,7 +4270,7 @@ lang_process () /* Create a bfd for each input file. */ current_target = default_target; - open_input_bfds (statement_list.head, false); + open_input_bfds (statement_list.head, FALSE); link_info.gc_sym_list = &entry_symbol; if (entry_symbol.name == NULL) @@ -4308,13 +4350,13 @@ lang_process () if (command_line.relax) { /* Keep relaxing until bfd_relax_section gives up. */ - boolean relax_again; + bfd_boolean relax_again; do { lang_reset_memory_regions (); - relax_again = false; + relax_again = FALSE; /* Note: pe-dll.c does something like this also. If you find you need to change this code, you probably need to change @@ -4367,7 +4409,7 @@ void lang_add_wild (filespec, section_list, keep_sections) struct wildcard_spec *filespec; struct wildcard_list *section_list; - boolean keep_sections; + bfd_boolean keep_sections; { struct wildcard_list *curr, *next; lang_wild_statement_type *new; @@ -4378,7 +4420,7 @@ lang_add_wild (filespec, section_list, keep_sections) section_list = curr, curr = next) { if (curr->spec.name != NULL && strcmp (curr->spec.name, "COMMON") == 0) - placed_commons = true; + placed_commons = TRUE; next = curr->next; curr->next = section_list; @@ -4389,12 +4431,12 @@ lang_add_wild (filespec, section_list, keep_sections) if (strcmp (filespec->name, "*") == 0) filespec->name = NULL; else if (! wildcardp (filespec->name)) - lang_has_input_file = true; + lang_has_input_file = TRUE; } new = new_stat (lang_wild_statement, stat_ptr); new->filename = NULL; - new->filenames_sorted = false; + new->filenames_sorted = FALSE; if (filespec != NULL) { new->filename = filespec->name; @@ -4425,7 +4467,7 @@ lang_section_start (name, address) void lang_add_entry (name, cmdline) const char *name; - boolean cmdline; + bfd_boolean cmdline; { if (entry_symbol.name == NULL || cmdline @@ -4456,7 +4498,7 @@ lang_add_map (name) switch (*name) { case 'F': - map_option_f = true; + map_option_f = TRUE; break; } name++; @@ -4543,14 +4585,14 @@ lang_startup (name) } first_file->filename = name; first_file->local_sym_name = name; - first_file->real = true; + first_file->real = TRUE; startup_file = name; } void lang_float (maybe) - boolean maybe; + bfd_boolean maybe; { lang_float_flag = maybe; } @@ -4562,7 +4604,7 @@ lang_float (maybe) MEMSPEC is the name of the run-time region, or "*default*" if the statement didn't specify one. LMA_MEMSPEC is the name of the load-time region, or null if the statement didn't specify one. - HAVE_LMA_P is true if the statement had an explicit load address. + HAVE_LMA_P is TRUE if the statement had an explicit load address. It is an error to specify both a load region and a load address. */ @@ -4613,7 +4655,7 @@ lang_abs_symbol_at_beginning_of (secname, name) { struct bfd_link_hash_entry *h; - h = bfd_link_hash_lookup (link_info.hash, name, true, true, true); + h = bfd_link_hash_lookup (link_info.hash, name, TRUE, TRUE, TRUE); if (h == (struct bfd_link_hash_entry *) NULL) einfo (_("%P%F: bfd_link_hash_lookup failed: %E\n")); @@ -4646,7 +4688,7 @@ lang_abs_symbol_at_end_of (secname, name) { struct bfd_link_hash_entry *h; - h = bfd_link_hash_lookup (link_info.hash, name, true, true, true); + h = bfd_link_hash_lookup (link_info.hash, name, TRUE, TRUE, TRUE); if (h == (struct bfd_link_hash_entry *) NULL) einfo (_("%P%F: bfd_link_hash_lookup failed: %E\n")); @@ -4732,8 +4774,8 @@ void lang_new_phdr (name, type, filehdr, phdrs, at, flags) const char *name; etree_type *type; - boolean filehdr; - boolean phdrs; + bfd_boolean filehdr; + bfd_boolean phdrs; etree_type *at; etree_type *flags; { @@ -4812,7 +4854,7 @@ lang_record_phdrs () } secs[c] = os->bfd_section; ++c; - pl->used = true; + pl->used = TRUE; } } } @@ -4870,7 +4912,7 @@ lang_add_nocrossref (l) nocrossref_list = n; /* Set notice_all so that we get informed about all symbols. */ - link_info.notice_all = true; + link_info.notice_all = TRUE; } /* Overlay handling. We handle overlays with some static variables. */ @@ -5089,7 +5131,7 @@ lang_vers_match_lang_cplusplus (expr, sym) if (!alt_sym) { /* cplus_demangle (also) returns NULL when it is not a C++ symbol. - Should we early out false in this case? */ + Should we early out FALSE in this case? */ result = fnmatch (expr->pattern, sym, 0) == 0; } else @@ -5116,7 +5158,7 @@ lang_vers_match_lang_java (expr, sym) if (!alt_sym) { /* cplus_demangle (also) returns NULL when it is not a Java symbol. - Should we early out false in this case? */ + Should we early out FALSE in this case? */ result = fnmatch (expr->pattern, sym, 0) == 0; } else diff --git a/ld/ldlang.h b/ld/ldlang.h index 57c8c51e5f7..59cbe3d9094 100644 --- a/ld/ldlang.h +++ b/ld/ldlang.h @@ -51,7 +51,7 @@ typedef struct memory_region_struct { bfd_size_type old_length; flagword flags; flagword not_flags; - boolean had_full_message; + bfd_boolean had_full_message; } lang_memory_region_type; typedef struct lang_statement_header_struct { @@ -109,7 +109,7 @@ enum section_type { struct lang_output_section_phdr_list { struct lang_output_section_phdr_list *next; const char *name; - boolean used; + bfd_boolean used; }; typedef struct lang_output_section_statement_struct { @@ -120,7 +120,7 @@ typedef struct lang_output_section_statement_struct { union lang_statement_union *next; const char *name; - boolean processed; + bfd_boolean processed; asection *bfd_section; flagword flags; /* Or together of all input sections */ @@ -211,7 +211,7 @@ typedef struct lang_input_statement_struct { bfd *the_bfd; - boolean closed; + bfd_boolean closed; file_ptr passive_position; /* Symbol table of the file. */ @@ -225,30 +225,30 @@ typedef struct lang_input_statement_struct { /* Point to the next file, but skips archive contents */ union lang_statement_union *next_real_file; - boolean is_archive; + bfd_boolean is_archive; /* 1 means search a set of directories for this file. */ - boolean search_dirs_flag; + bfd_boolean search_dirs_flag; /* 1 means this is base file of incremental load. Do not load this file's text or data. Also default text_start to after this file's bss. */ - boolean just_syms_flag; + bfd_boolean just_syms_flag; /* Whether to search for this entry as a dynamic archive. */ - boolean dynamic; + bfd_boolean dynamic; /* Whether to include the entire contents of an archive. */ - boolean whole_archive; + bfd_boolean whole_archive; - boolean loaded; + bfd_boolean loaded; #if 0 unsigned int globals_in_this_file; #endif const char *target; - boolean real; + bfd_boolean real; } lang_input_statement_type; typedef struct { @@ -267,9 +267,9 @@ typedef struct { typedef struct lang_wild_statement_struct { lang_statement_header_type header; const char *filename; - boolean filenames_sorted; + bfd_boolean filenames_sorted; struct wildcard_list *section_list; - boolean keep_sections; + bfd_boolean keep_sections; lang_statement_list_type children; } lang_wild_statement_type; @@ -324,8 +324,8 @@ struct lang_phdr { struct lang_phdr *next; const char *name; unsigned long type; - boolean filehdr; - boolean phdrs; + bfd_boolean filehdr; + bfd_boolean phdrs; etree_type *at; etree_type *flags; }; @@ -359,14 +359,14 @@ extern struct unique_sections *unique_section_list; extern lang_output_section_statement_type *abs_output_section; extern lang_statement_list_type lang_output_section_statement; -extern boolean lang_has_input_file; +extern bfd_boolean lang_has_input_file; extern etree_type *base; extern lang_statement_list_type *stat_ptr; -extern boolean delete_output_file_on_failure; +extern bfd_boolean delete_output_file_on_failure; extern struct bfd_sym_chain entry_symbol; extern const char *entry_section; -extern boolean entry_from_cmdline; +extern bfd_boolean entry_from_cmdline; extern lang_statement_list_type file_chain; extern void lang_init PARAMS ((void)); @@ -389,16 +389,16 @@ extern lang_output_section_statement_type *lang_enter_output_section_statement extern void lang_final PARAMS ((void)); extern void lang_process PARAMS ((void)); extern void lang_section_start PARAMS ((const char *, union etree_union *)); -extern void lang_add_entry PARAMS ((const char *, boolean)); +extern void lang_add_entry PARAMS ((const char *, bfd_boolean)); extern void lang_add_target PARAMS ((const char *)); extern void lang_add_wild - PARAMS ((struct wildcard_spec *, struct wildcard_list *, boolean)); + PARAMS ((struct wildcard_spec *, struct wildcard_list *, bfd_boolean)); extern void lang_add_map PARAMS ((const char *)); extern void lang_add_fill PARAMS ((fill_type *)); extern lang_assignment_statement_type * lang_add_assignment PARAMS ((union etree_union *)); extern void lang_add_attribute PARAMS ((enum statement_enum)); extern void lang_startup PARAMS ((const char *)); -extern void lang_float PARAMS ((enum bfd_boolean)); +extern void lang_float PARAMS ((bfd_boolean)); extern void lang_leave_output_section_statement PARAMS ((fill_type *, const char *, struct lang_output_section_phdr_list *, const char *)); @@ -451,7 +451,7 @@ extern bfd_vma lang_size_sections PARAMS ((lang_statement_union_type *s, lang_output_section_statement_type *output_section_statement, lang_statement_union_type **prev, fill_type *fill, - bfd_vma dot, boolean *relax)); + bfd_vma dot, bfd_boolean *relax)); extern void lang_enter_group PARAMS ((void)); extern void lang_leave_group PARAMS ((void)); extern void lang_add_section @@ -459,7 +459,7 @@ extern void lang_add_section lang_output_section_statement_type *output, lang_input_statement_type *file)); extern void lang_new_phdr - PARAMS ((const char *, etree_type *, boolean, boolean, etree_type *, + PARAMS ((const char *, etree_type *, bfd_boolean, bfd_boolean, etree_type *, etree_type *)); extern void lang_add_nocrossref PARAMS ((struct lang_nocrossref *)); extern void lang_enter_overlay PARAMS ((etree_type *)); @@ -481,7 +481,7 @@ extern struct bfd_elf_version_deps *lang_add_vers_depend extern void lang_register_vers_node PARAMS ((const char *, struct bfd_elf_version_tree *, struct bfd_elf_version_deps *)); -boolean unique_section_p PARAMS ((const char *)); +bfd_boolean unique_section_p PARAMS ((const char *)); extern void lang_add_unique PARAMS ((const char *)); extern const char *lang_get_output_target PARAMS ((void)); diff --git a/ld/ldmain.c b/ld/ldmain.c index ef7b4428648..8b7c2f98dd3 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -75,62 +75,62 @@ bfd *output_bfd = 0; int g_switch_value = 8; /* Nonzero means print names of input files as processed. */ -boolean trace_files; +bfd_boolean trace_files; /* Nonzero means same, but note open failures, too. */ -boolean trace_file_tries; +bfd_boolean trace_file_tries; /* Nonzero means version number was printed, so exit successfully instead of complaining if no input files are given. */ -boolean version_printed; +bfd_boolean version_printed; /* Nonzero means link in every member of an archive. */ -boolean whole_archive; +bfd_boolean whole_archive; -/* True if we should demangle symbol names. */ -boolean demangling; +/* TRUE if we should demangle symbol names. */ +bfd_boolean demangling; args_type command_line; ld_config_type config; static void remove_output PARAMS ((void)); -static boolean check_for_scripts_dir PARAMS ((char *dir)); -static boolean add_archive_element PARAMS ((struct bfd_link_info *, bfd *, +static bfd_boolean check_for_scripts_dir PARAMS ((char *dir)); +static bfd_boolean add_archive_element PARAMS ((struct bfd_link_info *, bfd *, const char *)); -static boolean multiple_definition PARAMS ((struct bfd_link_info *, +static bfd_boolean multiple_definition PARAMS ((struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma, bfd *, asection *, bfd_vma)); -static boolean multiple_common PARAMS ((struct bfd_link_info *, +static bfd_boolean multiple_common PARAMS ((struct bfd_link_info *, const char *, bfd *, enum bfd_link_hash_type, bfd_vma, bfd *, enum bfd_link_hash_type, bfd_vma)); -static boolean add_to_set PARAMS ((struct bfd_link_info *, +static bfd_boolean add_to_set PARAMS ((struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_reloc_code_real_type, bfd *, asection *, bfd_vma)); -static boolean constructor_callback PARAMS ((struct bfd_link_info *, - boolean constructor, +static bfd_boolean constructor_callback PARAMS ((struct bfd_link_info *, + bfd_boolean constructor, const char *name, bfd *, asection *, bfd_vma)); -static boolean warning_callback PARAMS ((struct bfd_link_info *, +static bfd_boolean warning_callback PARAMS ((struct bfd_link_info *, const char *, const char *, bfd *, asection *, bfd_vma)); static void warning_find_reloc PARAMS ((bfd *, asection *, PTR)); -static boolean undefined_symbol PARAMS ((struct bfd_link_info *, +static bfd_boolean undefined_symbol PARAMS ((struct bfd_link_info *, const char *, bfd *, - asection *, bfd_vma, boolean)); -static boolean reloc_overflow PARAMS ((struct bfd_link_info *, const char *, + asection *, bfd_vma, bfd_boolean)); +static bfd_boolean reloc_overflow PARAMS ((struct bfd_link_info *, const char *, const char *, bfd_vma, bfd *, asection *, bfd_vma)); -static boolean reloc_dangerous PARAMS ((struct bfd_link_info *, const char *, +static bfd_boolean reloc_dangerous PARAMS ((struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma)); -static boolean unattached_reloc PARAMS ((struct bfd_link_info *, +static bfd_boolean unattached_reloc PARAMS ((struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma)); -static boolean notice PARAMS ((struct bfd_link_info *, const char *, +static bfd_boolean notice PARAMS ((struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma)); static struct bfd_link_callbacks link_callbacks = { @@ -207,19 +207,19 @@ main (argc, argv) #endif /* Initialize the data about options. */ - trace_files = trace_file_tries = version_printed = false; - whole_archive = false; - config.build_constructors = true; - config.dynamic_link = false; - config.has_shared = false; + trace_files = trace_file_tries = version_printed = FALSE; + whole_archive = FALSE; + config.build_constructors = TRUE; + config.dynamic_link = FALSE; + config.has_shared = FALSE; config.split_by_reloc = (unsigned) -1; config.split_by_file = (bfd_size_type) -1; - command_line.force_common_definition = false; - command_line.inhibit_common_definition = false; + command_line.force_common_definition = FALSE; + command_line.inhibit_common_definition = FALSE; command_line.interpreter = NULL; command_line.rpath = NULL; - command_line.warn_mismatch = true; - command_line.check_section_addresses = true; + command_line.warn_mismatch = TRUE; + command_line.check_section_addresses = TRUE; /* We initialize DEMANGLING based on the environment variable COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the @@ -229,27 +229,27 @@ main (argc, argv) demangling = getenv ("COLLECT_NO_DEMANGLE") == NULL; link_info.callbacks = &link_callbacks; - link_info.relocateable = false; - link_info.emitrelocations = false; - link_info.shared = false; - link_info.symbolic = false; - link_info.export_dynamic = false; - link_info.static_link = false; - link_info.traditional_format = false; - link_info.optimize = false; - link_info.no_undefined = false; - link_info.allow_shlib_undefined = false; - link_info.allow_multiple_definition = false; - link_info.allow_undefined_version = true; + link_info.relocateable = FALSE; + link_info.emitrelocations = FALSE; + link_info.shared = FALSE; + link_info.symbolic = FALSE; + link_info.export_dynamic = FALSE; + link_info.static_link = FALSE; + link_info.traditional_format = FALSE; + link_info.optimize = FALSE; + link_info.no_undefined = FALSE; + link_info.allow_shlib_undefined = FALSE; + link_info.allow_multiple_definition = FALSE; + link_info.allow_undefined_version = TRUE; link_info.strip = strip_none; link_info.discard = discard_sec_merge; - link_info.keep_memory = true; + link_info.keep_memory = TRUE; link_info.input_bfds = NULL; link_info.create_object_symbols_section = NULL; link_info.gc_sym_list = NULL; link_info.hash = NULL; link_info.keep_hash = NULL; - link_info.notice_all = false; + link_info.notice_all = FALSE; link_info.notice_hash = NULL; link_info.wrap_hash = NULL; link_info.mpc860c0 = 0; @@ -257,29 +257,29 @@ main (argc, argv) and _fini symbols. We are compatible. */ link_info.init_function = "_init"; link_info.fini_function = "_fini"; - link_info.new_dtags = false; - link_info.eh_frame_hdr = false; + link_info.new_dtags = FALSE; + link_info.eh_frame_hdr = FALSE; link_info.flags = (bfd_vma) 0; link_info.flags_1 = (bfd_vma) 0; link_info.pei386_auto_import = -1; - link_info.pei386_runtime_pseudo_reloc = false; - link_info.combreloc = true; + link_info.pei386_runtime_pseudo_reloc = FALSE; + link_info.combreloc = TRUE; link_info.spare_dynamic_tags = 5; link_info.common_skip_ar_aymbols = bfd_link_common_skip_none; ldfile_add_arch (""); - config.make_executable = true; - force_make_executable = false; - config.magic_demand_paged = true; - config.text_read_only = true; + config.make_executable = TRUE; + force_make_executable = FALSE; + config.magic_demand_paged = TRUE; + config.text_read_only = TRUE; emulation = get_emulation (argc, argv); ldemul_choose_mode (emulation); default_target = ldemul_choose_target (argc, argv); lang_init (); ldemul_before_parse (); - lang_has_input_file = false; + lang_has_input_file = FALSE; parse_args (argc, argv); ldemul_set_symbols (); @@ -372,7 +372,7 @@ main (argc, argv) lang_final (); - if (lang_has_input_file == false) + if (!lang_has_input_file) { if (version_printed) xexit (0); @@ -427,9 +427,9 @@ main (argc, argv) be reported in the exit status. (What non-fatal errors, if any, do we want to ignore for relocateable output?) */ - if (config.make_executable == false && force_make_executable == false) + if (!config.make_executable && !force_make_executable) { - if (trace_files == true) + if (trace_files) { einfo (_("%P: link errors found, deleting executable `%s'\n"), output_filename); @@ -578,17 +578,17 @@ get_emulation (argc, argv) } /* If directory DIR contains an "ldscripts" subdirectory, - add DIR to the library search path and return true, - else return false. */ + add DIR to the library search path and return TRUE, + else return FALSE. */ -static boolean +static bfd_boolean check_for_scripts_dir (dir) char *dir; { size_t dirlen; char *buf; struct stat s; - boolean res; + bfd_boolean res; dirlen = strlen (dir); /* sizeof counts the terminating NUL. */ @@ -598,7 +598,7 @@ check_for_scripts_dir (dir) res = stat (buf, &s) == 0 && S_ISDIR (s.st_mode); free (buf); if (res) - ldfile_add_library_path (dir, false); + ldfile_add_library_path (dir, FALSE); return res; } @@ -672,7 +672,7 @@ add_ysym (name) einfo (_("%P%F: bfd_hash_table_init failed: %E\n")); } - if (bfd_hash_lookup (link_info.notice_hash, name, true, true) + if (bfd_hash_lookup (link_info.notice_hash, name, TRUE, TRUE) == (struct bfd_hash_entry *) NULL) einfo (_("%P%F: bfd_hash_lookup failed: %E\n")); } @@ -692,7 +692,7 @@ add_wrap (name) 61)) einfo (_("%P%F: 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 (_("%P%F: bfd_hash_lookup failed: %E\n")); } @@ -750,7 +750,7 @@ add_keepsyms_file (filename) buf[len] = '\0'; - if (bfd_hash_lookup (link_info.keep_hash, buf, true, true) + if (bfd_hash_lookup (link_info.keep_hash, buf, TRUE, TRUE) == (struct bfd_hash_entry *) NULL) einfo (_("%P%F: bfd_hash_lookup for insertion failed: %E\n")); } @@ -767,7 +767,7 @@ add_keepsyms_file (filename) /* This is called when BFD has decided to include an archive member in a link. */ -static boolean +static bfd_boolean add_archive_element (info, abfd, name) struct bfd_link_info *info ATTRIBUTE_UNUSED; bfd *abfd; @@ -782,9 +782,9 @@ add_archive_element (info, abfd, name) input->the_bfd = abfd; input->asymbols = NULL; input->next = NULL; - input->just_syms_flag = false; - input->loaded = false; - input->search_dirs_flag = false; + input->just_syms_flag = FALSE; + input->loaded = FALSE; + input->search_dirs_flag = FALSE; /* FIXME: The following fields are not set: header.next, header.type, closed, passive_position, symbol_count, @@ -796,12 +796,12 @@ add_archive_element (info, abfd, name) if (config.map_file != (FILE *) NULL) { - static boolean header_printed; + static bfd_boolean header_printed; struct bfd_link_hash_entry *h; bfd *from; int len; - h = bfd_link_hash_lookup (link_info.hash, name, false, false, true); + h = bfd_link_hash_lookup (link_info.hash, name, FALSE, FALSE, TRUE); if (h == NULL) from = NULL; @@ -835,7 +835,7 @@ add_archive_element (info, abfd, name) sprintf (buf, _("Archive member included because of file (symbol)\n\n")); minfo ("%s", buf); - header_printed = true; + header_printed = TRUE; } if (bfd_my_archive (abfd) == NULL) @@ -874,13 +874,13 @@ add_archive_element (info, abfd, name) if (trace_files || trace_file_tries) info_msg ("%I\n", input); - return true; + return TRUE; } /* This is called when BFD has discovered a symbol which is defined multiple times. */ -static boolean +static bfd_boolean multiple_definition (info, name, obfd, osec, oval, nbfd, nsec, nval) struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *name; @@ -902,7 +902,7 @@ multiple_definition (info, name, obfd, osec, oval, nbfd, nsec, nval) || (nsec->output_section != NULL && ! bfd_is_abs_section (nsec) && bfd_is_abs_section (nsec->output_section))) - return true; + return TRUE; einfo (_("%X%C: multiple definition of `%T'\n"), nbfd, nsec, nval, name); @@ -915,7 +915,7 @@ multiple_definition (info, name, obfd, osec, oval, nbfd, nsec, nval) command_line.relax = 0; } - return true; + return TRUE; } /* This is called when there is a definition of a common symbol, or @@ -923,7 +923,7 @@ multiple_definition (info, name, obfd, osec, oval, nbfd, nsec, nval) or when two common symbols are found. We only do something if -warn-common was used. */ -static boolean +static bfd_boolean multiple_common (info, name, obfd, otype, osize, nbfd, ntype, nsize) struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *name; @@ -935,7 +935,7 @@ multiple_common (info, name, obfd, otype, osize, nbfd, ntype, nsize) bfd_vma nsize; { if (! config.warn_common) - return true; + return TRUE; if (ntype == bfd_link_hash_defined || ntype == bfd_link_hash_defweak @@ -982,14 +982,14 @@ multiple_common (info, name, obfd, otype, osize, nbfd, ntype, nsize) } } - return true; + return TRUE; } /* This is called when BFD has discovered a set element. H is the entry in the linker hash table for the set. SECTION and VALUE represent a value which should be added to the set. */ -static boolean +static bfd_boolean add_to_set (info, h, reloc, abfd, section, value) struct bfd_link_info *info ATTRIBUTE_UNUSED; struct bfd_link_hash_entry *h; @@ -1003,7 +1003,7 @@ add_to_set (info, h, reloc, abfd, section, value) h->root.string); if (! config.build_constructors) - return true; + return TRUE; ldctor_add_set_entry (h, reloc, (const char *) NULL, section, value); @@ -1016,7 +1016,7 @@ add_to_set (info, h, reloc, abfd, section, value) ourselves. */ } - return true; + return TRUE; } /* This is called when BFD has discovered a constructor. This is only @@ -1024,10 +1024,10 @@ add_to_set (info, h, reloc, abfd, section, value) constructors in some more clever fashion. This is similar to adding an element to a set, but less general. */ -static boolean +static bfd_boolean constructor_callback (info, constructor, name, abfd, section, value) struct bfd_link_info *info; - boolean constructor; + bfd_boolean constructor; const char *name; bfd *abfd; asection *section; @@ -1041,7 +1041,7 @@ constructor_callback (info, constructor, name, abfd, section, value) einfo (_("%P: warning: global constructor %s used\n"), name); if (! config.build_constructors) - return true; + return TRUE; /* Ensure that BFD_RELOC_CTOR exists now, so that we can give a useful error message. */ @@ -1058,7 +1058,7 @@ constructor_callback (info, constructor, name, abfd, section, value) 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 (_("%P%F: bfd_link_hash_lookup failed: %E\n")); if (h->type == bfd_link_hash_new) @@ -1071,14 +1071,14 @@ constructor_callback (info, constructor, name, abfd, section, value) } ldctor_add_set_entry (h, BFD_RELOC_CTOR, name, section, value); - return true; + return TRUE; } /* A structure used by warning_callback to pass information through bfd_map_over_sections. */ struct warning_callback_info { - boolean found; + bfd_boolean found; const char *warning; const char *symbol; asymbol **asymbols; @@ -1086,7 +1086,7 @@ struct warning_callback_info { /* This is called when there is a reference to a warning symbol. */ -static boolean +static bfd_boolean warning_callback (info, warning, symbol, abfd, section, address) struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *warning; @@ -1099,7 +1099,7 @@ warning_callback (info, warning, symbol, abfd, section, address) have a cleaner interface, but what? */ if (! config.warn_multiple_gp && strcmp (warning, "using multiple gp values") == 0) - return true; + return TRUE; if (section != NULL) einfo ("%C: %s\n", abfd, section, address, warning); @@ -1138,7 +1138,7 @@ warning_callback (info, warning, symbol, abfd, section, address) } } - info.found = false; + info.found = FALSE; info.warning = warning; info.symbol = symbol; info.asymbols = asymbols; @@ -1151,7 +1151,7 @@ warning_callback (info, warning, symbol, abfd, section, address) free (asymbols); } - return true; + return TRUE; } /* This is called by warning_callback for each section. It checks the @@ -1197,7 +1197,7 @@ warning_find_reloc (abfd, sec, iarg) { /* We found a reloc for the symbol we are looking for. */ einfo ("%C: %s\n", abfd, sec, q->address, info->warning); - info->found = true; + info->found = TRUE; break; } } @@ -1207,14 +1207,14 @@ warning_find_reloc (abfd, sec, iarg) /* This is called when an undefined symbol is found. */ -static boolean +static bfd_boolean undefined_symbol (info, name, abfd, section, address, fatal) struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *name; bfd *abfd; asection *section; bfd_vma address; - boolean fatal ATTRIBUTE_UNUSED; + bfd_boolean fatal ATTRIBUTE_UNUSED; { static char *error_name; static unsigned int error_count; @@ -1235,10 +1235,10 @@ undefined_symbol (info, name, abfd, section, address, fatal) einfo (_("%F%P: bfd_hash_table_init failed: %E\n")); } - if (bfd_hash_lookup (hash, name, false, false) != NULL) - return true; + if (bfd_hash_lookup (hash, name, FALSE, FALSE) != NULL) + return TRUE; - if (bfd_hash_lookup (hash, name, true, true) == NULL) + if (bfd_hash_lookup (hash, name, TRUE, TRUE) == NULL) einfo (_("%F%P: bfd_hash_lookup failed: %E\n")); } @@ -1282,12 +1282,12 @@ undefined_symbol (info, name, abfd, section, address, fatal) abfd, name); } - return true; + return TRUE; } /* This is called when a reloc overflows. */ -static boolean +static bfd_boolean reloc_overflow (info, name, reloc_name, addend, abfd, section, address) struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *name; @@ -1305,12 +1305,12 @@ reloc_overflow (info, name, reloc_name, addend, abfd, section, address) if (addend != 0) einfo ("+%v", addend); einfo ("\n"); - return true; + return TRUE; } /* This is called when a dangerous relocation is made. */ -static boolean +static bfd_boolean reloc_dangerous (info, message, abfd, section, address) struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *message; @@ -1323,13 +1323,13 @@ reloc_dangerous (info, message, abfd, section, address) else einfo ("%X%C:", abfd, section, address); einfo (_("dangerous relocation: %s\n"), message); - return true; + return TRUE; } /* This is called when a reloc is being generated attached to a symbol that is not being output. */ -static boolean +static bfd_boolean unattached_reloc (info, name, abfd, section, address) struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *name; @@ -1342,14 +1342,14 @@ unattached_reloc (info, name, abfd, section, address) else einfo ("%X%C:", abfd, section, address); einfo (_(" reloc refers to symbol `%T' which is not being output\n"), name); - return true; + return TRUE; } /* This is called if link_info.notice_all is set, or when a symbol in link_info.notice_hash is found. Symbols are put in notice_hash using the -y option. */ -static boolean +static bfd_boolean notice (info, name, abfd, section, value) struct bfd_link_info *info; const char *name; @@ -1359,7 +1359,7 @@ notice (info, name, abfd, section, value) { if (! info->notice_all || (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 ("%B: reference to %s\n", abfd, name); @@ -1370,5 +1370,5 @@ notice (info, name, abfd, section, value) if (command_line.cref || nocrossref_list != NULL) add_cref (name, abfd, section, value); - return true; + return TRUE; } diff --git a/ld/ldmain.h b/ld/ldmain.h index f5d8b0d177d..0b3d02f1847 100644 --- a/ld/ldmain.h +++ b/ld/ldmain.h @@ -1,5 +1,5 @@ /* ldmain.h - - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1999 + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2002 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -25,11 +25,11 @@ extern char *program_name; extern bfd *output_bfd; extern char *default_target; -extern boolean trace_files; -extern boolean trace_file_tries; -extern boolean version_printed; -extern boolean whole_archive; -extern boolean demangling; +extern bfd_boolean trace_files; +extern bfd_boolean trace_file_tries; +extern bfd_boolean version_printed; +extern bfd_boolean whole_archive; +extern bfd_boolean demangling; extern int g_switch_value; extern const char *output_filename; extern struct bfd_link_info link_info; diff --git a/ld/ldmisc.c b/ld/ldmisc.c index 6be50c32731..94b03d4924f 100644 --- a/ld/ldmisc.c +++ b/ld/ldmisc.c @@ -71,7 +71,7 @@ vfinfo (fp, fmt, arg) const char *fmt; va_list arg; { - boolean fatal = false; + bfd_boolean fatal = FALSE; while (*fmt != '\0') { @@ -97,7 +97,7 @@ vfinfo (fp, fmt, arg) case 'X': /* no object output, fail return */ - config.make_executable = false; + config.make_executable = FALSE; break; case 'V': @@ -182,7 +182,7 @@ vfinfo (fp, fmt, arg) case 'F': /* Error is fatal. */ - fatal = true; + fatal = TRUE; break; case 'P': @@ -250,7 +250,7 @@ vfinfo (fp, fmt, arg) const char *filename; const char *functionname; unsigned int linenumber; - boolean discard_last; + bfd_boolean discard_last; abfd = va_arg (arg, bfd *); section = va_arg (arg, asection *); @@ -281,12 +281,12 @@ vfinfo (fp, fmt, arg) lfinfo (fp, "%B(%s+0x%v)", abfd, section->name, offset); - discard_last = true; + discard_last = TRUE; if (bfd_find_nearest_line (abfd, section, asymbols, offset, &filename, &functionname, &linenumber)) { - boolean need_colon = true; + bfd_boolean need_colon = TRUE; if (functionname != NULL && fmt[-1] == 'C') { @@ -300,7 +300,7 @@ vfinfo (fp, fmt, arg) { lfinfo (fp, _(": In function `%T':\n"), functionname); - need_colon = false; + need_colon = FALSE; last_bfd = abfd; if (last_file != NULL) @@ -312,7 +312,7 @@ vfinfo (fp, fmt, arg) free (last_function); last_function = xstrdup (functionname); } - discard_last = false; + discard_last = FALSE; } if (filename != NULL) @@ -364,9 +364,9 @@ vfinfo (fp, fmt, arg) } if (config.fatal_warnings) - config.make_executable = false; + config.make_executable = FALSE; - if (fatal == true) + if (fatal) xexit (1); } diff --git a/ld/ldwrite.c b/ld/ldwrite.c index eb31171c8a2..cbd879dc7e8 100644 --- a/ld/ldwrite.c +++ b/ld/ldwrite.c @@ -49,7 +49,7 @@ build_link_order (statement) asection *output_section; struct bfd_link_order *link_order; bfd_vma value; - boolean big_endian = false; + bfd_boolean big_endian = FALSE; output_section = statement->data_statement.output_section; ASSERT (output_section->owner == output_bfd); @@ -70,24 +70,24 @@ build_link_order (statement) endianness are big endian, so we must swap here if the input file is little endian. */ if (bfd_big_endian (output_bfd)) - big_endian = true; + big_endian = TRUE; else if (bfd_little_endian (output_bfd)) - big_endian = false; + big_endian = FALSE; else { - boolean swap; + bfd_boolean swap; - swap = false; + swap = FALSE; if (command_line.endian == ENDIAN_BIG) - big_endian = true; + big_endian = TRUE; else if (command_line.endian == ENDIAN_LITTLE) { - big_endian = false; - swap = true; + big_endian = FALSE; + swap = TRUE; } else if (command_line.endian == ENDIAN_UNSET) { - big_endian = true; + big_endian = TRUE; { LANG_FOR_EACH_INPUT_STATEMENT (s) { @@ -95,8 +95,8 @@ build_link_order (statement) { if (bfd_little_endian (s->the_bfd)) { - big_endian = false; - swap = true; + big_endian = FALSE; + swap = TRUE; } break; } @@ -226,7 +226,7 @@ build_link_order (statement) case lang_input_section_enum: /* Create a new link_order in the output section with this attached */ - if (statement->input_section.ifile->just_syms_flag == false) + if (!statement->input_section.ifile->just_syms_flag) { asection *i = statement->input_section.section; asection *output_section = i->output_section; @@ -320,7 +320,7 @@ clone_section (abfd, s, name, count) if ((sname = bfd_get_unique_section_name (abfd, templ, count)) == NULL || (n = bfd_make_section_anyway (abfd, sname)) == NULL || (h = bfd_link_hash_lookup (link_info.hash, - sname, true, true, false)) == NULL) + sname, TRUE, TRUE, FALSE)) == NULL) { einfo (_("%F%P: clone section failed: %E\n")); /* Silence gcc warnings. einfo exits, so we never reach here. */ diff --git a/ld/lexsup.c b/ld/lexsup.c index 07c52a7137a..8ce8f1805c7 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -593,10 +593,10 @@ parse_args (argc, argv) ``use only shared libraries'' but, then, we don't currently support shared libraries on HP/UX anyhow. */ if (strcmp (optarg, "archive") == 0) - config.dynamic_link = false; + config.dynamic_link = FALSE; else if (strcmp (optarg, "shared") == 0 || strcmp (optarg, "default") == 0) - config.dynamic_link = true; + config.dynamic_link = TRUE; else einfo (_("%P%F: unrecognized -a option `%s'\n"), optarg); break; @@ -625,17 +625,17 @@ parse_args (argc, argv) yyparse (); break; case OPTION_CALL_SHARED: - config.dynamic_link = true; + config.dynamic_link = TRUE; break; case OPTION_NON_SHARED: - config.dynamic_link = false; + config.dynamic_link = 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_DEFSYM: lex_string = optarg; @@ -647,7 +647,7 @@ parse_args (argc, argv) lex_string = NULL; break; case OPTION_DEMANGLE: - demangling = true; + demangling = TRUE; if (optarg != NULL) { enum demangling_styles style; @@ -671,14 +671,14 @@ parse_args (argc, argv) command_line.endian = ENDIAN_LITTLE; break; case OPTION_EMBEDDED_RELOCS: - command_line.embedded_relocs = true; + command_line.embedded_relocs = TRUE; break; case OPTION_EXPORT_DYNAMIC: case 'E': /* HP/UX compatibility. */ - link_info.export_dynamic = true; + link_info.export_dynamic = TRUE; break; case 'e': - lang_add_entry (optarg, true); + lang_add_entry (optarg, TRUE); break; case 'f': if (command_line.auxiliary_filters == NULL) @@ -707,7 +707,7 @@ parse_args (argc, argv) command_line.filter_shlib = optarg; break; case OPTION_FORCE_EXE_SUFFIX: - command_line.force_exe_suffix = true; + command_line.force_exe_suffix = TRUE; break; case 'G': { @@ -721,14 +721,14 @@ parse_args (argc, argv) /* Ignore. */ break; case OPTION_GC_SECTIONS: - command_line.gc_sections = true; + command_line.gc_sections = 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, @@ -744,55 +744,55 @@ parse_args (argc, argv) config.map_filename = optarg; break; case 'N': - config.text_read_only = false; - config.magic_demand_paged = false; - config.dynamic_link = false; + config.text_read_only = FALSE; + config.magic_demand_paged = FALSE; + config.dynamic_link = FALSE; break; case OPTION_NO_OMAGIC: - config.text_read_only = true; - config.magic_demand_paged = true; - /* NB/ Does not set dynamic_link to true. + config.text_read_only = TRUE; + config.magic_demand_paged = TRUE; + /* NB/ Does not set dynamic_link to TRUE. Use --call-shared or -Bdynamic for this. */ break; case 'n': - config.magic_demand_paged = false; - config.dynamic_link = false; + config.magic_demand_paged = FALSE; + config.dynamic_link = FALSE; break; case OPTION_NO_DEFINE_COMMON: - command_line.inhibit_common_definition = true; + command_line.inhibit_common_definition = TRUE; break; case OPTION_NO_DEMANGLE: - demangling = false; + demangling = FALSE; break; case OPTION_NO_GC_SECTIONS: - command_line.gc_sections = false; + command_line.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.no_undefined = true; + link_info.no_undefined = TRUE; break; case OPTION_ALLOW_SHLIB_UNDEFINED: - link_info.allow_shlib_undefined = true; + link_info.allow_shlib_undefined = TRUE; break; case OPTION_ALLOW_MULTIPLE_DEFINITION: - link_info.allow_multiple_definition = true; + link_info.allow_multiple_definition = TRUE; break; case OPTION_NO_UNDEFINED_VERSION: - link_info.allow_undefined_version = false; + link_info.allow_undefined_version = FALSE; break; case OPTION_NO_WARN_MISMATCH: - command_line.warn_mismatch = false; + command_line.warn_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: - whole_archive = false; + whole_archive = FALSE; break; case 'O': /* FIXME "-O<non-digits> <value>" used to set the address of @@ -802,7 +802,7 @@ parse_args (argc, argv) getopt can't handle two args to an option without kludges. */ /* Enable optimizations of output files. */ - link_info.optimize = strtoul (optarg, NULL, 0) ? true : false; + link_info.optimize = strtoul (optarg, NULL, 0) ? TRUE : FALSE; break; case 'o': lang_add_output (optarg, 0); @@ -811,7 +811,7 @@ parse_args (argc, argv) lang_add_output_format (optarg, (char *) NULL, (char *) NULL, 0); break; case 'q': - link_info.emitrelocations = true; + link_info.emitrelocations = TRUE; break; case 'i': case 'r': @@ -826,11 +826,11 @@ parse_args (argc, argv) and will seg-fault the next time around. */ einfo(_("%P%F: bad -rpath option\n")); - link_info.relocateable = true; - config.build_constructors = false; - config.magic_demand_paged = false; - config.text_read_only = false; - config.dynamic_link = false; + link_info.relocateable = TRUE; + config.build_constructors = FALSE; + config.magic_demand_paged = FALSE; + config.text_read_only = FALSE; + config.dynamic_link = FALSE; break; case 'R': /* The GNU linker traditionally uses -R to mean to include @@ -907,7 +907,7 @@ parse_args (argc, argv) } break; case OPTION_RELAX: - command_line.relax = true; + command_line.relax = TRUE; break; case OPTION_RETAIN_SYMBOLS_FILE: add_keepsyms_file (optarg); @@ -920,7 +920,7 @@ parse_args (argc, argv) break; case OPTION_SHARED: if (config.has_shared) - link_info.shared = true; + link_info.shared = TRUE; else einfo (_("%P%F: -shared not supported\n")); break; @@ -929,16 +929,16 @@ parse_args (argc, argv) command_line.soname = optarg; break; case OPTION_SORT_COMMON: - config.sort_common = true; + config.sort_common = TRUE; break; case OPTION_STATS: - config.stats = true; + config.stats = TRUE; break; case OPTION_SYMBOLIC: - link_info.symbolic = true; + link_info.symbolic = TRUE; break; case 't': - trace_files = true; + trace_files = TRUE; break; case 'T': ldfile_open_command_file (optarg); @@ -987,17 +987,17 @@ parse_args (argc, argv) set_section_start (".text", 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 - do an implied -r option. */ case OPTION_UR: - link_info.relocateable = true; - config.build_constructors = true; - config.magic_demand_paged = false; - config.text_read_only = false; - config.dynamic_link = false; + link_info.relocateable = TRUE; + config.build_constructors = TRUE; + config.magic_demand_paged = FALSE; + config.text_read_only = FALSE; + config.dynamic_link = FALSE; break; case 'u': ldlang_add_undef (optarg); @@ -1006,20 +1006,20 @@ parse_args (argc, argv) if (optarg != NULL) lang_add_unique (optarg); else - config.unique_orphan_sections = true; + config.unique_orphan_sections = TRUE; break; case OPTION_VERBOSE: ldversion (1); - version_printed = true; - trace_file_tries = true; + version_printed = TRUE; + trace_file_tries = TRUE; 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); @@ -1046,25 +1046,25 @@ parse_args (argc, argv) command_line.version_exports_section = optarg; 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_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_WHOLE_ARCHIVE: - whole_archive = true; + whole_archive = TRUE; break; case OPTION_WRAP: add_wrap (optarg); @@ -1102,10 +1102,10 @@ parse_args (argc, argv) config.split_by_file = 1; break; case OPTION_CHECK_SECTIONS: - command_line.check_section_addresses = true; + command_line.check_section_addresses = TRUE; break; case OPTION_NO_CHECK_SECTIONS: - command_line.check_section_addresses = false; + command_line.check_section_addresses = FALSE; break; case '(': if (ingroup) @@ -1135,7 +1135,7 @@ parse_args (argc, argv) /* Convert words to bytes. */ link_info.mpc860c0 = words * 4; } - command_line.relax = true; + command_line.relax = TRUE; break; case OPTION_INIT: @@ -1171,7 +1171,7 @@ set_default_dirlist (dirlist_ptr) if (p != NULL) *p = '\0'; if (*dirlist_ptr != '\0') - ldfile_add_library_path (dirlist_ptr, true); + ldfile_add_library_path (dirlist_ptr, TRUE); if (p == NULL) break; dirlist_ptr = p + 1; @@ -1204,13 +1204,13 @@ help () { if (ld_options[i].doc != NULL) { - boolean comma; + bfd_boolean comma; int len; unsigned j; printf (" "); - comma = false; + comma = FALSE; len = 2; j = i; @@ -1231,7 +1231,7 @@ help () printf ("%s", _(ld_options[j].arg)); len += strlen (_(ld_options[j].arg)); } - comma = true; + comma = TRUE; } ++j; } @@ -1260,7 +1260,7 @@ help () printf (" %s", _(ld_options[j].arg)); len += 1 + strlen (_(ld_options[j].arg)); } - comma = true; + comma = TRUE; } ++j; } @@ -243,8 +243,8 @@ mri_draw_tree () tmp->next = NULL; tmp->spec.name = p->name; tmp->spec.exclude_name_list = NULL; - tmp->spec.sorted = false; - lang_add_wild (NULL, tmp, false); + tmp->spec.sorted = 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) @@ -254,8 +254,8 @@ mri_draw_tree () tmp->next = NULL; tmp->spec.name = aptr->name; tmp->spec.exclude_name_list = NULL; - tmp->spec.sorted = false; - lang_add_wild (NULL, tmp, false); + tmp->spec.sorted = FALSE; + lang_add_wild (NULL, tmp, FALSE); } lang_leave_output_section_statement diff --git a/ld/pe-dll.c b/ld/pe-dll.c index d9e40783e35..1c870e29953 100644 --- a/ld/pe-dll.c +++ b/ld/pe-dll.c @@ -590,7 +590,7 @@ process_def_file (abfd, info) sprintf (name, "%s%s", U("_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) @@ -721,7 +721,7 @@ process_def_file (abfd, info) blhe = bfd_link_hash_lookup (info->hash, name, - false, false, true); + FALSE, FALSE, TRUE); if (blhe && (blhe->type == bfd_link_hash_defined @@ -936,7 +936,7 @@ fill_exported_offsets (abfd, info) blhe = bfd_link_hash_lookup (info->hash, name, - false, false, true); + FALSE, FALSE, TRUE); if (blhe && (blhe->type == bfd_link_hash_defined)) exported_symbol_offsets[i] = blhe->u.def.value; @@ -1822,7 +1822,7 @@ make_one (exp, parent) id5 = quick_section (abfd, ".idata$5", SEC_HAS_CONTENTS, 2); id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2); id6 = quick_section (abfd, ".idata$6", SEC_HAS_CONTENTS, 2); - + if (*exp->internal_name == '@') { if (! exp->flag_data) @@ -2026,7 +2026,7 @@ make_import_fixup_mark (rel) 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); if (0) { @@ -2216,7 +2216,7 @@ pe_create_import_fixup (rel, s, addend) add_bfd_to_link (b, b->filename, &link_info); /* If we ever use autoimport, we have to cast text section writable. */ - config.text_read_only = false; + config.text_read_only = FALSE; } if (addend == 0 || link_info.pei386_runtime_pseudo_reloc) @@ -2244,7 +2244,7 @@ pe_create_import_fixup (rel, s, addend) add_bfd_to_link (b, b->filename, &link_info); } runtime_pseudo_relocs_created++; - } + } else { einfo (_("%C: variable '%T' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.\n"), @@ -2376,7 +2376,7 @@ pe_process_import_defs (output_bfd, link_info) { def_file_export exp; struct bfd_link_hash_entry *blhe; - int lead_at = (*pe_def_file->imports[i].internal_name == '@'); + int lead_at = (*pe_def_file->imports[i].internal_name == '@'); /* See if we need this import. */ char *name = (char *) xmalloc (strlen (pe_def_file->imports[i].internal_name) + 2 + 6); @@ -2386,7 +2386,7 @@ pe_process_import_defs (output_bfd, link_info) sprintf (name, "%s%s",U (""), pe_def_file->imports[i].internal_name); blhe = bfd_link_hash_lookup (link_info->hash, name, - false, false, false); + FALSE, FALSE, FALSE); if (!blhe || (blhe && blhe->type != bfd_link_hash_undefined)) { @@ -2398,7 +2398,7 @@ pe_process_import_defs (output_bfd, link_info) pe_def_file->imports[i].internal_name); blhe = bfd_link_hash_lookup (link_info->hash, name, - false, false, false); + FALSE, FALSE, FALSE); } free (name); @@ -2435,8 +2435,8 @@ pe_process_import_defs (output_bfd, link_info) } /* We were handed a *.DLL file. Parse it and turn it into a set of - IMPORTS directives in the def file. Return true if the file was - handled, false if not. */ + IMPORTS directives in the def file. Return TRUE if the file was + handled, FALSE if not. */ static unsigned int pe_get16 (abfd, where) @@ -2484,7 +2484,7 @@ pe_as32 (ptr) return b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24); } -boolean +bfd_boolean pe_implied_import_dll (filename) const char *filename; { @@ -2501,14 +2501,14 @@ pe_implied_import_dll (filename) if (!dll) { einfo ("%Xopen %s: %s\n", filename, bfd_errmsg (bfd_get_error ())); - return false; + return FALSE; } /* PEI dlls seem to be bfd_objects. */ if (!bfd_check_format (dll, bfd_object)) { einfo ("%X%s: this doesn't appear to be a DLL\n", filename); - return false; + return FALSE; } dll_name = filename; @@ -2521,7 +2521,7 @@ pe_implied_import_dll (filename) num_entries = pe_get32 (dll, opthdr_ofs + 92); if (num_entries < 1) /* No exports. */ - return false; + return FALSE; export_rva = pe_get32 (dll, opthdr_ofs + 96); export_size = pe_get32 (dll, opthdr_ofs + 100); @@ -2572,7 +2572,7 @@ pe_implied_import_dll (filename) i, 0); } - return true; + return TRUE; } /* These are the main functions, called from the emulation. The first diff --git a/ld/pe-dll.h b/ld/pe-dll.h index 6273e3bccc2..9c50f5e3ee7 100644 --- a/ld/pe-dll.h +++ b/ld/pe-dll.h @@ -35,20 +35,29 @@ extern int pe_dll_warn_dup_exports; extern int pe_dll_compat_implib; extern int pe_dll_extra_pe_debug; -extern void pe_dll_id_target PARAMS ((const char *)); -extern void pe_dll_add_excludes PARAMS ((const char *, const int)); -extern void pe_dll_generate_def_file PARAMS ((const char *)); -extern void pe_dll_generate_implib PARAMS ((def_file *, const char *)); -extern void pe_process_import_defs PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean pe_implied_import_dll PARAMS ((const char *)); -extern void pe_dll_build_sections PARAMS ((bfd *, struct bfd_link_info *)); -extern void pe_exe_build_sections PARAMS ((bfd *, struct bfd_link_info *)); -extern void pe_dll_fill_sections PARAMS ((bfd *, struct bfd_link_info *)); -extern void pe_exe_fill_sections PARAMS ((bfd *, struct bfd_link_info *)); - -extern void pe_walk_relocs_of_symbol PARAMS ((struct bfd_link_info * info, - const char *name, - int (*cb) (arelent *, asection *))); - -extern void pe_create_import_fixup PARAMS ((arelent * rel, asection *, int)); +extern void pe_dll_id_target + PARAMS ((const char *)); +extern void pe_dll_add_excludes + PARAMS ((const char *, const int)); +extern void pe_dll_generate_def_file + PARAMS ((const char *)); +extern void pe_dll_generate_implib + PARAMS ((def_file *, const char *)); +extern void pe_process_import_defs + PARAMS ((bfd *, struct bfd_link_info *)); +extern bfd_boolean pe_implied_import_dll + PARAMS ((const char *)); +extern void pe_dll_build_sections + PARAMS ((bfd *, struct bfd_link_info *)); +extern void pe_exe_build_sections + PARAMS ((bfd *, struct bfd_link_info *)); +extern void pe_dll_fill_sections + PARAMS ((bfd *, struct bfd_link_info *)); +extern void pe_exe_fill_sections + PARAMS ((bfd *, struct bfd_link_info *)); +extern void pe_walk_relocs_of_symbol + PARAMS ((struct bfd_link_info * info, const char *name, + int (*cb) (arelent *, asection *))); +extern void pe_create_import_fixup + PARAMS ((arelent * rel, asection *, int)); #endif /* PE_DLL_H */ |