aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/emultempl/pe.em12
2 files changed, 18 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 5c1f94b..e5afd75 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2010-05-25 Kai Tietz <kai.tietz@onevision.com>
+
+ * emultempl/pe.em (default_merge_rdata): New shell variable.
+ (MERGE_RDATA_V2): New macro.
+ (gld_${EMULATION_NAME}_get_script): Adjust rule for auto-import
+ selected script.
+
2010-05-15 Kai Tietz <kai.tietz@onevision.com>
* emultempl/pe.em (is_underscoring): New helper function.
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index ca82fa8..3185336 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -172,9 +172,15 @@ EOF
case ${target} in
*-*-cygwin*)
default_auto_import=1
+ default_merge_rdata=1
+ ;;
+ *-w64-mingw*)
+ default_auto_import=1
+ default_merge_rdata=0
;;
*)
default_auto_import=-1
+ default_merge_rdata=1
;;
esac
@@ -185,6 +191,10 @@ fragment <<EOF
#endif
}
+/* Indicates if RDATA shall be merged into DATA when pseudo-relocation
+ version 2 is used and auto-import is enabled. */
+#define MERGE_RDATA_V2 ${default_merge_rdata}
+
/* PE format extra command line options. */
/* Used for setting flags in the PE header. */
@@ -2159,7 +2169,7 @@ sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c
if test -n "$GENERATE_AUTO_IMPORT_SCRIPT" ; then
-echo ' ; else if (link_info.pei386_auto_import == 1) return' >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.pei386_auto_import == 1 && (MERGE_RDATA_V2 || link_info.pei386_runtime_pseudo_reloc != 2)) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xa >> e${EMULATION_NAME}.c
fi
echo ' ; else return' >> e${EMULATION_NAME}.c