diff options
Diffstat (limited to 'ld/emultempl/pe.em')
-rw-r--r-- | ld/emultempl/pe.em | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index 10887b0..1ef225a 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -10,7 +10,7 @@ rm -f e${EMULATION_NAME}.c (echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-) fragment <<EOF /* Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007 Free Software Foundation, Inc. + 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of the GNU Binutils. @@ -1008,18 +1008,20 @@ gld_${EMULATION_NAME}_after_open (void) FIXME: This should be done via a function, rather than by including an internal BFD header. */ - if (coff_data (output_bfd) == NULL || coff_data (output_bfd)->pe == 0) - einfo (_("%F%P: cannot perform PE operations on non PE output file '%B'.\n"), output_bfd); + if (coff_data (link_info.output_bfd) == NULL + || coff_data (link_info.output_bfd)->pe == 0) + einfo (_("%F%P: cannot perform PE operations on non PE output file '%B'.\n"), + link_info.output_bfd); - pe_data (output_bfd)->pe_opthdr = pe; - pe_data (output_bfd)->dll = init[DLLOFF].value; - pe_data (output_bfd)->real_flags |= real_flags; + pe_data (link_info.output_bfd)->pe_opthdr = pe; + pe_data (link_info.output_bfd)->dll = init[DLLOFF].value; + pe_data (link_info.output_bfd)->real_flags |= real_flags; #ifdef DLL_SUPPORT if (pe_enable_stdcall_fixup) /* -1=warn or 1=disable */ pe_fixup_stdcalls (); - pe_process_import_defs (output_bfd, & link_info); + pe_process_import_defs (link_info.output_bfd, &link_info); pe_find_data_imports (); @@ -1028,17 +1030,17 @@ gld_${EMULATION_NAME}_after_open (void) || defined (TARGET_IS_arm_epoc_pe) \ || defined (TARGET_IS_arm_wince_pe) if (!link_info.relocatable) - pe_dll_build_sections (output_bfd, &link_info); + pe_dll_build_sections (link_info.output_bfd, &link_info); else - pe_exe_build_sections (output_bfd, &link_info); + pe_exe_build_sections (link_info.output_bfd, &link_info); #else if (link_info.shared) - pe_dll_build_sections (output_bfd, &link_info); + pe_dll_build_sections (link_info.output_bfd, &link_info); #endif #endif /* DLL_SUPPORT */ #if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe) || defined(TARGET_IS_arm_wince_pe) - if (strstr (bfd_get_target (output_bfd), "arm") == NULL) + if (strstr (bfd_get_target (link_info.output_bfd), "arm") == NULL) { /* The arm backend needs special fields in the output hash structure. These will only be created if the output format is an arm format, @@ -1451,13 +1453,14 @@ gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIB if (pe_def_file->base_address != (bfd_vma)(-1)) { - pe.ImageBase = - pe_data (output_bfd)->pe_opthdr.ImageBase = - init[IMAGEBASEOFF].value = pe_def_file->base_address; + pe.ImageBase + = pe_data (link_info.output_bfd)->pe_opthdr.ImageBase + = init[IMAGEBASEOFF].value + = pe_def_file->base_address; init[IMAGEBASEOFF].inited = 1; if (image_base_statement) - image_base_statement->exp = - exp_assop ('=', "__image_base__", exp_intop (pe.ImageBase)); + image_base_statement->exp = exp_assop ('=', "__image_base__", + exp_intop (pe.ImageBase)); } if (pe_def_file->stack_reserve != -1 @@ -1531,7 +1534,7 @@ gld_${EMULATION_NAME}_finish (void) /* Special procesing is required for a Thumb entry symbol. The bottom bit of its address must be set. */ val = (h->u.def.value - + bfd_get_section_vma (output_bfd, + + bfd_get_section_vma (link_info.output_bfd, h->u.def.section->output_section) + h->u.def.section->output_offset); @@ -1563,7 +1566,7 @@ gld_${EMULATION_NAME}_finish (void) #endif ) { - pe_dll_fill_sections (output_bfd, &link_info); + pe_dll_fill_sections (link_info.output_bfd, &link_info); if (pe_implib_filename) pe_dll_generate_implib (pe_def_file, pe_implib_filename); } @@ -1571,7 +1574,7 @@ gld_${EMULATION_NAME}_finish (void) /* ARM doesn't need relocs. */ else { - pe_exe_fill_sections (output_bfd, &link_info); + pe_exe_fill_sections (link_info.output_bfd, &link_info); } #endif @@ -1581,7 +1584,7 @@ gld_${EMULATION_NAME}_finish (void) /* I don't know where .idata gets set as code, but it shouldn't be. */ { - asection *asec = bfd_get_section_by_name (output_bfd, ".idata"); + asection *asec = bfd_get_section_by_name (link_info.output_bfd, ".idata"); if (asec) { @@ -1719,10 +1722,11 @@ gld_${EMULATION_NAME}_place_orphan (asection *s) /* Choose a unique name for the section. This will be needed if the same section name appears in the input file with different loadable or allocatable characteristics. */ - if (bfd_get_section_by_name (output_bfd, secname) != NULL) + if (bfd_get_section_by_name (link_info.output_bfd, secname) != NULL) { static int count = 1; - secname = bfd_get_unique_section_name (output_bfd, secname, &count); + secname = bfd_get_unique_section_name (link_info.output_bfd, + secname, &count); if (secname == NULL) einfo ("%F%P: place_orphan failed: %E\n"); } |