aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ld/ChangeLog8
-rw-r--r--ld/emultempl/pe.em21
-rw-r--r--ld/pe-dll.c9
3 files changed, 33 insertions, 5 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index d857495..4fb6ae7 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,11 @@
+2001-09-24 Charles Wilson <cwilson@ece.gatech.edu>
+
+ * emultempl/pe.em(pe_data_import_dll): Make static.
+ (pe_get_data_import_dll_name): New accessor function.
+ * pe-dll.c(pe_create_import_fixup): call
+ pe_get_data_import_dll_name() from pe.em, instead of
+ directly accessing pe_data_import_dll variable from pe.em.
+
2001-09-18 Bruno Haible <haible@clisp.cons.org>
* deffilep.y: Include "safe-ctype.h" instead of <ctype.h>.
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index 990b6a7..a863526 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -153,6 +153,7 @@ static char *pe_out_def_filename = NULL;
static char *pe_implib_filename = NULL;
static int pe_enable_auto_image_base = 0;
static char *pe_dll_search_prefix = NULL;
+static char *pe_data_import_dll = NULL;
#endif
extern const char *output_filename;
@@ -755,6 +756,24 @@ gld_${EMULATION_NAME}_after_parse ()
ldlang_add_undef (entry_symbol);
}
+/* Previously, pe-dll.c directly accessed pe_data_import_dll,
+ which was only defined if DLL_SUPPORT. This cause a build
+ failure on certain targets. At least this function will
+ exist regardless of whether DLL_SUPPORT is defined or not.
+
+ However, it's still a kludge. pe-dll.c shouldn't directly
+ call any functions other than the gld_${EMULATION_NAME}_*. */
+
+char *
+pe_get_data_import_dll_name ()
+{
+#ifdef DLL_SUPPORT
+ return pe_data_import_dll;
+#else
+ return "unknown";
+#endif
+}
+
#ifdef DLL_SUPPORT
static struct bfd_link_hash_entry *pe_undef_found_sym;
@@ -879,8 +898,6 @@ make_import_fixup (rel, s)
return 1;
}
-char *pe_data_import_dll;
-
static void
pe_find_data_imports ()
{
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index ae72eaa..f62835d 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -123,6 +123,10 @@
static void
add_bfd_to_link PARAMS ((bfd *, const char *, struct bfd_link_info *));
+/* Defined in emultempl/pe.em. */
+extern char *
+pe_get_data_import_dll_name PARAMS ((void));
+
/* For emultempl/pe.em. */
def_file * pe_def_file = 0;
@@ -2065,9 +2069,8 @@ pe_create_import_fixup (rel)
}
{
- extern char * pe_data_import_dll; /* Defined in emultempl/pe.em. */
-
- bfd *b = make_import_fixup_entry (name, fixup_name, pe_data_import_dll,
+ bfd *b = make_import_fixup_entry (name, fixup_name,
+ pe_get_data_import_dll_name (),
output_bfd);
add_bfd_to_link (b, b->filename, &link_info);
}