diff -u ld/pe-dll.c /home/src/wince/binutils-050201/ld/pe-dll.c --- ld/pe-dll.c 2005-01-21 04:15:59.000000000 +0000 +++ /home/src/wince/binutils-050201/ld/pe-dll.c 2005-02-07 13:23:18.000000000 +0000 @@ -199,7 +199,7 @@ 11 /* ARM_RVA32 */, PE_ARCH_arm, bfd_arch_arm, - 1 + 0 }, { "epoc-pei-arm-little", @@ -226,6 +226,7 @@ { "_pei386_runtime_relocator", 25 }, { "do_pseudo_reloc", 15 }, { "cygwin_crt0", 11 }, + { ".text", 5 }, { NULL, 0 } }; @@ -261,9 +262,10 @@ static autofilter_entry_type autofilter_symbolprefixlist[] = { - /* { "__imp_", 6 }, */ + { "__imp", 5 }, /* Do __imp_ explicitly to save time. */ { "__rtti_", 7 }, + { ".idata$", 7 }, /* Don't re-export auto-imported symbols. */ { "_nm_", 4 }, { "__builtin_", 10 }, @@ -735,8 +737,8 @@ else { /* xgettext:c-format */ - einfo (_("%XCannot export %s: symbol not found\n"), - pe_def_file->exports[i].internal_name); + einfo (_("%XCannot export %s (%s): symbol not found\n"), + pe_def_file->exports[i].internal_name,pe_def_file->exports[i].name); } free (name); } @@ -1083,9 +1085,14 @@ asymbol **symbols; int nsyms, symsize; +#if 0 /* If it's not loaded, we don't need to relocate it this way. */ + /* mamaich: sometimes .data section gets no SEC_LOAD flag, but contains relocs */ if (!(s->output_section->flags & SEC_LOAD)) continue; +#endif + 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 */ @@ -1129,6 +1136,8 @@ + sym->section->output_section->vma); reloc_data[total_relocs].vma = sec_vma + relocs[i]->address; +/* printf ("rel: %s, vma=%08X\n", sym->name,reloc_data[total_relocs].vma); */ + #define BITS_AND_SHIFT(bits, shift) (bits * 1000 | shift) switch BITS_AND_SHIFT (relocs[i]->howto->bitsize, @@ -1580,7 +1589,8 @@ id2 = quick_section (abfd, ".idata$2", SEC_HAS_CONTENTS, 2); id5 = quick_section (abfd, ".idata$5", SEC_HAS_CONTENTS, 2); id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2); - quick_symbol (abfd, U ("_head_"), dll_symname, "", id2, BSF_GLOBAL, 0); +/* mamaich: quick_symbol (abfd, U ("_head_"), dll_symname, "", id2, BSF_GLOBAL, 0); */ + quick_symbol (abfd, U ("__head_"), dll_symname, "", id2, BSF_GLOBAL, 0); quick_symbol (abfd, U (""), dll_symname, "_iname", UNDSEC, BSF_GLOBAL, 0); /* OK, pay attention here. I got confused myself looking back at @@ -1733,6 +1743,14 @@ 0x08, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 }; +static unsigned char arm_jtab[] = +{ + 0x00, 0xc0, 0x9f, 0xe5, /* ldr ip, [pc] */ + 0x00, 0xf0, 0x9c, 0xe5, /* ldr pc, [ip] */ + 0, 0, 0, 0 +}; + + static bfd * make_one (def_file_export *exp, bfd *parent) { @@ -1754,6 +1772,10 @@ jmp_bytes = jmp_sh_bytes; jmp_byte_count = sizeof (jmp_sh_bytes); break; + case PE_ARCH_arm: + jmp_bytes = arm_jtab; + jmp_byte_count = sizeof (arm_jtab); + break; case PE_ARCH_mips: jmp_bytes = jmp_mips_bytes; jmp_byte_count = sizeof (jmp_mips_bytes); @@ -1826,6 +1848,9 @@ case PE_ARCH_sh: quick_reloc (abfd, 8, BFD_RELOC_32, 2); break; + case PE_ARCH_arm: + quick_reloc (abfd, 8, BFD_RELOC_32, 2); + break; case PE_ARCH_mips: quick_reloc (abfd, 0, BFD_RELOC_HI16_S, 2); quick_reloc (abfd, 0, BFD_RELOC_LO16, 0); /* MIPS_R_PAIR */ diff -u ld/emultempl/pe.em ../binutils-2.13.2.1.newclean/ld/emultempl/pe.em --- ld/emultempl/pe.em 2002-12-20 21:19:13.000000000 +0000 +++ ../binutils-2.13.2.1.newclean/ld/emultempl/pe.em 2004-05-04 01:28:02.000000000 +0100 @@ -299,7 +299,7 @@ D(MajorImageVersion,"__major_image_version__", 1), D(MinorImageVersion,"__minor_image_version__", 0), #ifdef TARGET_IS_armpe - D(MajorSubsystemVersion,"__major_subsystem_version__", 2), + D(MajorSubsystemVersion,"__major_subsystem_version__", 3), #else D(MajorSubsystemVersion,"__major_subsystem_version__", 4), #endif