static int runtime_pseudo_relocs_created = 0;
typedef struct
- {
- char *target_name;
- char *object_target;
- unsigned int imagebase_reloc;
- int pe_arch;
- int bfd_arch;
- int underscored;
- }
-pe_details_type;
+{
+ char *name;
+ int len;
+}
+autofilter_entry_type;
typedef struct
- {
- char *name;
- int len;
- }
-autofilter_entry_type;
+{
+ char *target_name;
+ char *object_target;
+ unsigned int imagebase_reloc;
+ int pe_arch;
+ int bfd_arch;
+ bfd_boolean underscored;
+ autofilter_entry_type* autofilter_symbollist;
+}
+pe_details_type;
-#define PE_ARCH_i386 1
-#define PE_ARCH_sh 2
-#define PE_ARCH_mips 3
-#define PE_ARCH_arm 4
+static autofilter_entry_type autofilter_symbollist_generic[] =
+{
+ { ".text", 5 },
+ /* Entry point symbols. */
+ { "DllMain", 7 },
+ { "DllMainCRTStartup", 17 },
+ { "_DllMainCRTStartup", 18 },
+ /* Runtime pseudo-reloc. */
+ { "_pei386_runtime_relocator", 25 },
+ { "do_pseudo_reloc", 15 },
+ { NULL, 0 }
+};
+
+static autofilter_entry_type autofilter_symbollist_i386[] =
+{
+ { ".text", 5 },
+ /* Entry point symbols, and entry hooks. */
+ { "cygwin_crt0", 11 },
+ { "DllMain@12", 10 },
+ { "DllEntryPoint@0", 15 },
+ { "DllMainCRTStartup@12", 20 },
+ { "_cygwin_dll_entry@12", 20 },
+ { "_cygwin_crt0_common@8", 21 },
+ { "_cygwin_noncygwin_dll_entry@12", 30 },
+ { "cygwin_attach_dll", 17 },
+ { "cygwin_premain0", 15 },
+ { "cygwin_premain1", 15 },
+ { "cygwin_premain2", 15 },
+ { "cygwin_premain3", 15 },
+ /* Runtime pseudo-reloc. */
+ { "_pei386_runtime_relocator", 25 },
+ { "do_pseudo_reloc", 15 },
+ /* Global vars that should not be exported. */
+ { "impure_ptr", 10 },
+ { "_impure_ptr", 11 },
+ { "_fmode", 6 },
+ { "environ", 7 },
+ { NULL, 0 }
+};
+
+#define PE_ARCH_i386 1
+#define PE_ARCH_sh 2
+#define PE_ARCH_mips 3
+#define PE_ARCH_arm 4
#define PE_ARCH_arm_epoc 5
+#define PE_ARCH_arm_wince 6
static pe_details_type pe_detail_list[] =
{
7 /* R_IMAGEBASE */,
PE_ARCH_i386,
bfd_arch_i386,
- 1
+ TRUE,
+ autofilter_symbollist_i386
},
{
"pei-shl",
16 /* R_SH_IMAGEBASE */,
PE_ARCH_sh,
bfd_arch_sh,
- 1
+ TRUE,
+ autofilter_symbollist_generic
},
{
"pei-mips",
34 /* MIPS_R_RVA */,
PE_ARCH_mips,
bfd_arch_mips,
- 0
+ FALSE,
+ autofilter_symbollist_generic
},
{
"pei-arm-little",
11 /* ARM_RVA32 */,
PE_ARCH_arm,
bfd_arch_arm,
- 1
+ TRUE,
+ autofilter_symbollist_generic
},
{
"epoc-pei-arm-little",
11 /* ARM_RVA32 */,
PE_ARCH_arm_epoc,
bfd_arch_arm,
- 0
+ FALSE,
+ autofilter_symbollist_generic
+ },
+ {
+ "pei-arm-wince-little",
+ "pe-arm-wince-little",
+ 2, /* ARM_RVA32 on Windows CE, see bfd/coff-arm.c. */
+ PE_ARCH_arm_wince,
+ bfd_arch_arm,
+ FALSE,
+ autofilter_symbollist_generic
},
- { NULL, NULL, 0, 0, 0, 0 }
+ { NULL, NULL, 0, 0, 0, FALSE, NULL }
};
static pe_details_type *pe_details;
-static autofilter_entry_type autofilter_symbollist[] =
-{
- { "DllMain", 7 },
- { "DllMainCRTStartup", 17 },
- { "_DllMainCRTStartup", 18 },
- { "DllMain@12", 10 },
- { "DllEntryPoint@0", 15 },
- { "DllMainCRTStartup@12", 20 },
- { "_cygwin_dll_entry@12", 20 },
- { "_cygwin_crt0_common@8", 21 },
- { "_cygwin_noncygwin_dll_entry@12", 30 },
- { "impure_ptr", 10 },
- { "_pei386_runtime_relocator", 25 },
- { "do_pseudo_reloc", 15 },
- { "cygwin_crt0", 11 },
- { ".text", 5 },
- { NULL, 0 }
-};
-
/* Do not specify library suffix explicitly, to allow for dllized versions. */
static autofilter_entry_type autofilter_liblist[] =
{
{ "__imp_", 6 },
/* Do __imp_ explicitly to save time. */
{ "__rtti_", 7 },
- { ".idata$", 7 },
/* Don't re-export auto-imported symbols. */
{ "_nm_", 4 },
{ "__builtin_", 10 },
/* Don't export symbols specifying internal DLL layout. */
{ "_head_", 6 },
- { "_fmode", 6 },
- { "_impure_ptr", 11 },
- { "cygwin_attach_dll", 17 },
- { "cygwin_premain0", 15 },
- { "cygwin_premain1", 15 },
- { "cygwin_premain2", 15 },
- { "cygwin_premain3", 15 },
- { "environ", 7 },
{ NULL, 0 }
};
/* Don't try to blindly exclude all symbols
that begin with '__'; this was tried and
- it is too restrictive. */
-
- /* Then, exclude specific symbols. */
- afptr = autofilter_symbollist;
+ it is too restrictive. Instead we have
+ a target specific list to use: */
+ afptr = pe_details->autofilter_symbollist;
while (afptr->name)
{
if (strcmp (n, afptr->name) == 0)
int nsyms, symsize;
/* If it's not loaded, we don't need to relocate it this way. */
-#if 0 /* Some toolchains can generate .data sections without a SEC_LOAD flag but with relocs. */
if (!(s->output_section->flags & SEC_LOAD))
continue;
-#endif
- /* Huh ? */
- if (strncmp (bfd_get_section_name (abfd, s), ".idata",6) == 0)
- continue;
/* I don't know why there would be a reloc for these, but I've
seen it happen - DJ */
jmp_byte_count = sizeof (jmp_mips_bytes);
break;
case PE_ARCH_arm:
+ case PE_ARCH_arm_epoc:
+ case PE_ARCH_arm_wince:
jmp_bytes = jmp_arm_bytes;
jmp_byte_count = sizeof (jmp_arm_bytes);
break;
quick_reloc (abfd, 4, BFD_RELOC_LO16, 2);
break;
case PE_ARCH_arm:
+ case PE_ARCH_arm_epoc:
+ case PE_ARCH_arm_wince:
quick_reloc (abfd, 8, BFD_RELOC_32, 2);
break;
default: