aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl/pe.em
diff options
context:
space:
mode:
Diffstat (limited to 'ld/emultempl/pe.em')
-rw-r--r--ld/emultempl/pe.em142
1 files changed, 71 insertions, 71 deletions
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index ea11a02..c5aed5f 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -133,7 +133,7 @@ static int support_old_code = 0;
static char * thumb_entry_symbol = NULL;
static lang_assignment_statement_type *image_base_statement = 0;
static unsigned short pe_dll_characteristics = DEFAULT_DLL_CHARACTERISTICS;
-static bfd_boolean insert_timestamp = TRUE;
+static bool insert_timestamp = true;
static const char *emit_build_id;
#ifdef DLL_SUPPORT
@@ -167,7 +167,7 @@ gld_${EMULATION_NAME}_before_parse (void)
ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
output_filename = "${EXECUTABLE_NAME:-a.exe}";
#ifdef DLL_SUPPORT
- input_flags.dynamic = TRUE;
+ input_flags.dynamic = true;
config.has_shared = 1;
EOF
@@ -395,7 +395,7 @@ typedef struct
/* FALSE for an assembly level symbol and TRUE for a C visible symbol.
C visible symbols can be prefixed by underscore dependent to target's
settings. */
- bfd_boolean is_c_symbol;
+ bool is_c_symbol;
} definfo;
/* Get symbol name dependent to kind and C visible state of
@@ -414,31 +414,31 @@ static definfo init[] =
{
/* imagebase must be first */
#define IMAGEBASEOFF 0
- D(ImageBase,"__image_base__", NT_EXE_IMAGE_BASE, FALSE),
+ D(ImageBase,"__image_base__", NT_EXE_IMAGE_BASE, false),
#define DLLOFF 1
- {&dll, sizeof(dll), 0, "__dll__", 0, FALSE},
+ {&dll, sizeof(dll), 0, "__dll__", 0, false},
#define MSIMAGEBASEOFF 2
- D(ImageBase, "___ImageBase", NT_EXE_IMAGE_BASE, TRUE),
- D(SectionAlignment,"__section_alignment__", PE_DEF_SECTION_ALIGNMENT, FALSE),
- D(FileAlignment,"__file_alignment__", PE_DEF_FILE_ALIGNMENT, FALSE),
- D(MajorOperatingSystemVersion,"__major_os_version__", 4, FALSE),
- D(MinorOperatingSystemVersion,"__minor_os_version__", 0, FALSE),
- D(MajorImageVersion,"__major_image_version__", 1, FALSE),
- D(MinorImageVersion,"__minor_image_version__", 0, FALSE),
+ D(ImageBase, "___ImageBase", NT_EXE_IMAGE_BASE, true),
+ D(SectionAlignment,"__section_alignment__", PE_DEF_SECTION_ALIGNMENT, false),
+ D(FileAlignment,"__file_alignment__", PE_DEF_FILE_ALIGNMENT, false),
+ D(MajorOperatingSystemVersion,"__major_os_version__", 4, false),
+ D(MinorOperatingSystemVersion,"__minor_os_version__", 0, false),
+ D(MajorImageVersion,"__major_image_version__", 1, false),
+ D(MinorImageVersion,"__minor_image_version__", 0, false),
#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_wince_pe)
- D(MajorSubsystemVersion,"__major_subsystem_version__", 3, FALSE),
+ D(MajorSubsystemVersion,"__major_subsystem_version__", 3, false),
#else
- D(MajorSubsystemVersion,"__major_subsystem_version__", 4, FALSE),
+ D(MajorSubsystemVersion,"__major_subsystem_version__", 4, false),
#endif
- D(MinorSubsystemVersion,"__minor_subsystem_version__", 0, FALSE),
- D(Subsystem,"__subsystem__", ${SUBSYSTEM}, FALSE),
- D(SizeOfStackReserve,"__size_of_stack_reserve__", 0x200000, FALSE),
- D(SizeOfStackCommit,"__size_of_stack_commit__", 0x1000, FALSE),
- D(SizeOfHeapReserve,"__size_of_heap_reserve__", 0x100000, FALSE),
- D(SizeOfHeapCommit,"__size_of_heap_commit__", 0x1000, FALSE),
- D(LoaderFlags,"__loader_flags__", 0x0, FALSE),
- D(DllCharacteristics, "__dll_characteristics__", DEFAULT_DLL_CHARACTERISTICS, FALSE),
- { NULL, 0, 0, NULL, 0 , FALSE}
+ D(MinorSubsystemVersion,"__minor_subsystem_version__", 0, false),
+ D(Subsystem,"__subsystem__", ${SUBSYSTEM}, false),
+ D(SizeOfStackReserve,"__size_of_stack_reserve__", 0x200000, false),
+ D(SizeOfStackCommit,"__size_of_stack_commit__", 0x1000, false),
+ D(SizeOfHeapReserve,"__size_of_heap_reserve__", 0x100000, false),
+ D(SizeOfHeapCommit,"__size_of_heap_commit__", 0x1000, false),
+ D(LoaderFlags,"__loader_flags__", 0x0, false),
+ D(DllCharacteristics, "__dll_characteristics__", DEFAULT_DLL_CHARACTERISTICS, false),
+ { NULL, 0, 0, NULL, 0 , false}
};
@@ -716,13 +716,13 @@ set_pe_stack_heap (char *resname, char *comname)
#define DEFAULT_BUILD_ID_STYLE "md5"
-static bfd_boolean
+static bool
gld${EMULATION_NAME}_handle_option (int optc)
{
switch (optc)
{
default:
- return FALSE;
+ return false;
case OPTION_BASE_FILE:
link_info.base_file = fopen (optarg, FOPEN_WB);
@@ -777,7 +777,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
thumb_entry_symbol = optarg;
break;
case OPTION_USE_NUL_PREFIXED_IMPORT_TABLES:
- pe_use_nul_prefixed_import_tables = TRUE;
+ pe_use_nul_prefixed_import_tables = true;
break;
case OPTION_NO_LEADING_UNDERSCORE:
pe_leading_underscore = 0;
@@ -786,10 +786,10 @@ gld${EMULATION_NAME}_handle_option (int optc)
pe_leading_underscore = 1;
break;
case OPTION_INSERT_TIMESTAMP:
- insert_timestamp = TRUE;
+ insert_timestamp = true;
break;
case OPTION_NO_INSERT_TIMESTAMP:
- insert_timestamp = FALSE;
+ insert_timestamp = false;
break;
#ifdef DLL_SUPPORT
case OPTION_OUT_DEF:
@@ -949,7 +949,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
/* Set DLLCharacteristics bits */
set_pe_name ("__dll_characteristics__", pe_dll_characteristics);
- return TRUE;
+ return true;
}
@@ -1031,7 +1031,7 @@ gld_${EMULATION_NAME}_set_symbols (void)
lang_assignment_statement_type *rv;
rv = lang_add_assignment (exp_assign (GET_INIT_SYMBOL_NAME (j),
- exp_intop (val), FALSE));
+ exp_intop (val), false));
if (init[j].size == sizeof (short))
*(short *) init[j].ptr = val;
else if (init[j].size == sizeof (int))
@@ -1074,7 +1074,7 @@ gld_${EMULATION_NAME}_after_parse (void)
#ifdef DLL_SUPPORT
static struct bfd_link_hash_entry *pe_undef_found_sym;
-static bfd_boolean
+static bool
pe_undef_cdecl_match (struct bfd_link_hash_entry *h, void *inf)
{
int sl;
@@ -1089,9 +1089,9 @@ pe_undef_cdecl_match (struct bfd_link_hash_entry *h, void *inf)
&& h->root.string[sl] == '@')
{
pe_undef_found_sym = h;
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/* Change UNDEF to a defined symbol, taking data from SYM. */
@@ -1100,7 +1100,7 @@ static void
change_undef (struct bfd_link_hash_entry * undef,
struct bfd_link_hash_entry * sym)
{
- static bfd_boolean gave_warning_message = FALSE;
+ static bool gave_warning_message = false;
undef->type = bfd_link_hash_defined;
undef->u.def.value = sym->u.def.value;
@@ -1115,7 +1115,7 @@ change_undef (struct bfd_link_hash_entry * undef,
{
einfo (_("Use --enable-stdcall-fixup to disable these warnings\n"));
einfo (_("Use --disable-stdcall-fixup to disable these fixups\n"));
- gave_warning_message = TRUE;
+ gave_warning_message = true;
}
}
@@ -1153,7 +1153,7 @@ pe_fixup_stdcalls (void)
*cname = '_';
if (at)
* strchr (cname, '@') = 0;
- sym = bfd_link_hash_lookup (link_info.hash, cname, FALSE, FALSE, TRUE);
+ sym = bfd_link_hash_lookup (link_info.hash, cname, false, false, true);
if (sym && sym->type == bfd_link_hash_defined)
change_undef (undef, sym);
@@ -1190,12 +1190,12 @@ make_import_fixup (arelent *rel, asection *s, char *name, const char *symname)
pe_create_import_fixup (rel, s, _addend, name, symname);
}
-static bfd_boolean
+static bool
pr_sym (struct bfd_hash_entry *h, void *inf ATTRIBUTE_UNUSED)
{
printf ("+%s\n", h->string);
- return TRUE;
+ return true;
}
#endif /* DLL_SUPPORT */
@@ -1207,7 +1207,7 @@ debug_section_p (bfd *abfd ATTRIBUTE_UNUSED, asection *sect, void *obj)
*found = 1;
}
-static bfd_boolean
+static bool
pecoff_checksum_contents (bfd *abfd,
void (*process) (const void *, size_t, void *),
void *arg)
@@ -1232,10 +1232,10 @@ pecoff_checksum_contents (bfd *abfd,
filepos += 1;
}
- return TRUE;
+ return true;
}
-static bfd_boolean
+static bool
write_build_id (bfd *abfd)
{
struct pe_tdata *t = pe_data (abfd);
@@ -1270,7 +1270,7 @@ write_build_id (bfd *abfd)
{
einfo (_("%P: warning: .buildid section discarded,"
" --build-id ignored\n"));
- return TRUE;
+ return true;
}
if (t->build_id.sec->contents == NULL)
@@ -1329,11 +1329,11 @@ write_build_id (bfd *abfd)
pe_data (link_info.output_bfd)->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size
= sizeof (struct external_IMAGE_DEBUG_DIRECTORY);
- return TRUE;
+ return true;
}
/* Make .buildid section, and set up coff_tdata->build_id. */
-static bfd_boolean
+static bool
setup_build_id (bfd *ibfd)
{
asection *s;
@@ -1342,7 +1342,7 @@ setup_build_id (bfd *ibfd)
if (!validate_build_id_style (emit_build_id))
{
einfo (_("%P: warning: unrecognized --build-id style ignored\n"));
- return FALSE;
+ return false;
}
flags = (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_IN_MEMORY
@@ -1362,12 +1362,12 @@ setup_build_id (bfd *ibfd)
s->size = sizeof (struct external_IMAGE_DEBUG_DIRECTORY)
+ sizeof (CV_INFO_PDB70) + 1;
- return TRUE;
+ return true;
}
einfo (_("%P: warning: cannot create .buildid section,"
" --build-id ignored\n"));
- return FALSE;
+ return false;
}
static void
@@ -1582,7 +1582,7 @@ gld_${EMULATION_NAME}_after_open (void)
/* Thunk section with reloc to another bfd. */
blhe = bfd_link_hash_lookup (link_info.hash,
s->name,
- FALSE, FALSE, TRUE);
+ false, false, true);
if (blhe == NULL
|| blhe->type != bfd_link_hash_defined)
@@ -1774,7 +1774,7 @@ gld_${EMULATION_NAME}_after_open (void)
the stub. */
blhe = bfd_link_hash_lookup (link_info.hash,
symbols[src_count]->name,
- FALSE, FALSE, TRUE);
+ false, false, true);
/* If the symbol in the stub section has no other
undefined references, exclude the stub section
from the final link. */
@@ -1837,7 +1837,7 @@ saw_option (char *option)
}
#endif /* DLL_SUPPORT */
-static bfd_boolean
+static bool
gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED)
{
#ifdef DLL_SUPPORT
@@ -1868,7 +1868,7 @@ gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIB
sprintf (buf, "%s%s", U (""),
pe_def_file->exports[i].internal_name);
- h = bfd_link_hash_lookup (link_info.hash, buf, TRUE, TRUE, TRUE);
+ h = bfd_link_hash_lookup (link_info.hash, buf, true, true, true);
if (h == (struct bfd_link_hash_entry *) NULL)
einfo (_("%F%P: bfd_link_hash_lookup failed: %E\n"));
if (h->type == bfd_link_hash_new)
@@ -1894,7 +1894,7 @@ gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIB
if (image_base_statement)
image_base_statement->exp
= exp_assign ("__image_base__", exp_intop (pe.ImageBase),
- FALSE);
+ false);
}
if (pe_def_file->stack_reserve != -1
@@ -1911,14 +1911,14 @@ gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIB
if (pe_def_file->heap_commit != -1)
pe.SizeOfHeapCommit = pe_def_file->heap_commit;
}
- return TRUE;
+ return true;
}
}
#endif
- return FALSE;
+ return false;
}
-static bfd_boolean
+static bool
gld_${EMULATION_NAME}_recognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED)
{
#ifdef DLL_SUPPORT
@@ -1937,7 +1937,7 @@ gld_${EMULATION_NAME}_recognized_file (lang_input_statement_type *entry ATTRIBUT
if (pe_bfd_is_dll (entry->the_bfd))
return pe_implied_import_dll (entry->filename);
#endif
- return FALSE;
+ return false;
}
static void
@@ -1949,7 +1949,7 @@ gld_${EMULATION_NAME}_finish (void)
if (thumb_entry_symbol != NULL)
{
h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol,
- FALSE, FALSE, TRUE);
+ false, false, true);
if (h != (struct bfd_link_hash_entry *) NULL
&& (h->type == bfd_link_hash_defined
@@ -2239,7 +2239,7 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
return os;
}
-static bfd_boolean
+static bool
gld_${EMULATION_NAME}_open_dynamic_archive
(const char *arch ATTRIBUTE_UNUSED,
search_dirs_type *search,
@@ -2248,34 +2248,34 @@ gld_${EMULATION_NAME}_open_dynamic_archive
static const struct
{
const char * format;
- bfd_boolean use_prefix;
+ bool use_prefix;
}
libname_fmt [] =
{
/* Preferred explicit import library for dll's. */
- { "lib%s.dll.a", FALSE },
+ { "lib%s.dll.a", false },
/* Alternate explicit import library for dll's. */
- { "%s.dll.a", FALSE },
+ { "%s.dll.a", false },
/* "libfoo.a" could be either an import lib or a static lib.
For backwards compatibility, libfoo.a needs to precede
libfoo.dll and foo.dll in the search. */
- { "lib%s.a", FALSE },
+ { "lib%s.a", false },
/* The 'native' spelling of an import lib name is "foo.lib". */
- { "%s.lib", FALSE },
+ { "%s.lib", false },
/* PR 22948 - Check for an import library. */
- { "lib%s.lib", FALSE },
+ { "lib%s.lib", false },
#ifdef DLL_SUPPORT
/* Try "<prefix>foo.dll" (preferred dll name, if specified). */
- { "%s%s.dll", TRUE },
+ { "%s%s.dll", true },
#endif
/* Try "libfoo.dll" (default preferred dll name). */
- { "lib%s.dll", FALSE },
+ { "lib%s.dll", false },
/* Finally try 'native' dll name "foo.dll". */
- { "%s.dll", FALSE },
+ { "%s.dll", false },
/* Note: If adding more formats to this table, make sure to check to
see if their length is longer than libname_fmt[0].format, and if
so, update the call to xmalloc() below. */
- { NULL, FALSE }
+ { NULL, false }
};
static unsigned int format_max_len = 0;
const char * filename;
@@ -2285,7 +2285,7 @@ gld_${EMULATION_NAME}_open_dynamic_archive
if (! entry->flags.maybe_archive || entry->flags.full_name_provided)
- return FALSE;
+ return false;
filename = entry->filename;
@@ -2337,12 +2337,12 @@ gld_${EMULATION_NAME}_open_dynamic_archive
if (!libname_fmt[i].format)
{
free (full_string);
- return FALSE;
+ return false;
}
entry->filename = full_string;
- return TRUE;
+ return true;
}
static int