I wrote a new version of the patch that tries to implement most of the things we talked about. It works quite nicely on my windows 7 64-bit using cygwin, mingw32 or a cross-built mingw64 binary. Interestingly, it seems that the mingw64 binary is not really affected by this issue because the 64-bit system DLLs do have a section offset of 0x1000 for .text section, while the 32-bit DLLs have 0x10000. Pierre Muller 2012-11-06 Pierre Muller * coff-pe-read.h (pe_text_section_offset): Declare new function. * coff-pe-read.c (debug_coff_pe_read): New static variable. (struct read_pe_section_data): Add section_name field. (pe_as16): New function. (IMAGE_SCN_CNT_CODE): New macro, if not already defined. (IMAGE_SCN_CNT_INITIALIZED_DATA): Ditto. (IMAGE_SCN_CNT_UNINITIALIZED_DATA): Ditto. (add_pe_exported_sym): Handle unnamed exported function. (add_pe_forwarded_sym): New function. (read_pe_exported_syms): Use ordinal of function to retrieve correct RVA address of function and handle forwarded symbol. (pe_text_section_offset): New function. (show_debug_coff_pe_read): New function. (_initialize_coff_pe_read): New function adding 'set/show debug coff_pe_read' commands. * windows-tdep.c (windows_xfer_shared_library): Use pe_text_section_offset function instead of possibly wrong 0x1000 constant for .text sextion offset.