#if defined(TARGET_IS_i386pe)
#define DLL_SUPPORT
#endif
+#if defined(TARGET_IS_shpe) || defined(TARGET_IS_mipspe) || defined(TARGET_IS_armpe)
+#define DLL_SUPPORT
+#endif
+#if defined(TARGET_IS_i386pe) || ! defined(DLL_SUPPORT)
#define PE_DEF_SUBSYSTEM 3
+#else
+#undef NT_EXE_IMAGE_BASE
+#undef PE_DEF_SECTION_ALIGNMENT
+#undef PE_DEF_FILE_ALIGNMENT
+#define NT_EXE_IMAGE_BASE 0x00010000
+#ifdef TARGET_IS_armpe
+#define PE_DEF_SECTION_ALIGNMENT 0x00001000
+#define PE_DEF_SUBSYSTEM 9
+#else
+#define PE_DEF_SECTION_ALIGNMENT 0x00000400
+#define PE_DEF_SUBSYSTEM 2
+#endif
+#define PE_DEF_FILE_ALIGNMENT 0x00000200
+#endif
#ifdef TARGET_IS_arm_epoc_pe
#define bfd_arm_pe_allocate_interworking_sections \
ldfile_output_architecture = bfd_arch_${ARCH};
#ifdef DLL_SUPPORT
config.has_shared = 1;
+
+#if (PE_DEF_SUBSYSTEM == 9) || (PE_DEF_SUBSYSTEM == 2)
+#if defined TARGET_IS_mipspe || defined TARGET_IS_armpe
+ lang_add_entry ("WinMainCRTStartup", 1);
+#else
+ lang_add_entry ("_WinMainCRTStartup", 1);
+#endif
+#endif
#endif
}
\f
D(MinorOperatingSystemVersion,"__minor_os_version__", 0),
D(MajorImageVersion,"__major_image_version__", 1),
D(MinorImageVersion,"__minor_image_version__", 0),
+#ifdef TARGET_IS_armpe
+ D(MajorSubsystemVersion,"__major_subsystem_version__", 2),
+#else
D(MajorSubsystemVersion,"__major_subsystem_version__", 4),
+#endif
D(MinorSubsystemVersion,"__minor_subsystem_version__", 0),
D(Subsystem,"__subsystem__", ${SUBSYSTEM}),
D(SizeOfStackReserve,"__size_of_stack_reserve__", 0x2000000),
v[] =
{
{ "native", 1, "NtProcessStartup" },
+#if defined TARGET_IS_mipspe || defined TARGET_IS_armpe
{ "windows", 2, "WinMainCRTStartup" },
+#else
+ { "windows", 2, "WinMainCRTStartup" },
+#endif
{ "console", 3, "mainCRTStartup" },
#if 0
/* The Microsoft linker does not recognize this. */
{ "os2", 5, "" },
#endif
{ "posix", 7, "__PosixProcessStartup"},
+ { "wince", 9, "_WinMainCRTStartup" },
{ 0, 0, 0 }
};
pe_process_import_defs(output_bfd, &link_info);
if (link_info.shared)
pe_dll_build_sections (output_bfd, &link_info);
+
+#ifndef TARGET_IS_i386pe
+#ifndef TARGET_IS_armpe
+ else
+ pe_exe_build_sections (output_bfd, &link_info);
+#endif
+#endif
#endif
#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe)
#ifdef DLL_SUPPORT
#ifdef TARGET_IS_i386pe
pe_dll_id_target ("pei-i386");
+#endif
+#ifdef TARGET_IS_shpe
+ pe_dll_id_target ("pei-shl");
+#endif
+#ifdef TARGET_IS_mipspe
+ pe_dll_id_target ("pei-mips");
+#endif
+#ifdef TARGET_IS_armpe
+ pe_dll_id_target ("pei-arm-little");
#endif
if (bfd_get_format (entry->the_bfd) == bfd_object)
{
if (pe_implib_filename)
pe_dll_generate_implib (pe_def_file, pe_implib_filename);
}
+#if defined(TARGET_IS_shpe) || defined(TARGET_IS_mipspe)
+ else
+ {
+ pe_exe_fill_sections (output_bfd, &link_info);
+ }
+#endif
+
if (pe_out_def_filename)
pe_dll_generate_def_file (pe_out_def_filename);
#endif
else if (strcmp (os->name, ".bss") == 0)
hold_bss = os;
}
+
+static int
+gld_${EMULATION_NAME}_find_potential_libraries (name, entry)
+ char * name;
+ lang_input_statement_type * entry;
+{
+ return ldfile_open_file_search (name, entry, "", ".lib");
+}
\f
static char *
gld_${EMULATION_NAME}_get_script(isfile)
gld_${EMULATION_NAME}_parse_args,
gld_${EMULATION_NAME}_unrecognized_file,
gld_${EMULATION_NAME}_list_options,
- gld_${EMULATION_NAME}_recognized_file
+ gld_${EMULATION_NAME}_recognized_file,
+ gld_${EMULATION_NAME}_find_potential_libraries
};
EOF