aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>1998-11-10 03:54:00 +0000
committerDJ Delorie <dj@redhat.com>1998-11-10 03:54:00 +0000
commita3606134a2986d6b28f7c0dd86b35d8be775765f (patch)
treebff8d200839004924af6783ecc358908a43974cd /ld
parent91c7ad9a6ad43c73e582f039e12c8787bf09279e (diff)
downloadgdb-a3606134a2986d6b28f7c0dd86b35d8be775765f.zip
gdb-a3606134a2986d6b28f7c0dd86b35d8be775765f.tar.gz
gdb-a3606134a2986d6b28f7c0dd86b35d8be775765f.tar.bz2
* deffilep.y: properly handle relocs with multiple def_files,
cache import module names
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/deffile.h13
-rw-r--r--ld/pe-dll.c4
3 files changed, 19 insertions, 3 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index ea7dd5a..befc972 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+Mon Nov 9 22:52:50 1998 DJ Delorie <dj@indy.delorie.com>
+
+ * deffilep.y: properly handle relocs with multiple def_files,
+ cache import module names
+
Mon Nov 9 22:44:58 1998 DJ Delorie <dj@cygnus.com>
* pe-dll.c (process_def_file): don't assume exports won't move
diff --git a/ld/deffile.h b/ld/deffile.h
index 255739d..fd5661a 100644
--- a/ld/deffile.h
+++ b/ld/deffile.h
@@ -41,10 +41,18 @@ typedef struct def_file_export
}
def_file_export;
+typedef struct def_file_module
+ {
+ struct def_file_module *next;
+ void *user_data;
+ char name[1]; /* extended via malloc */
+ }
+def_file_module;
+
typedef struct def_file_import
{
char *internal_name; /* always set */
- char *module; /* always set */
+ def_file_module *module; /* always set */
char *name; /* may be NULL; either this or ordinal will be set */
int ordinal; /* may be -1 */
}
@@ -73,6 +81,9 @@ typedef struct def_file
int num_exports;
def_file_export *exports;
+ /* used by imports for module names */
+ def_file_module *modules;
+
/* from the IMPORTS commands */
int num_imports;
def_file_import *imports;
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index 72444c0..d2f77f3 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -268,7 +268,7 @@ process_def_file (abfd, info)
}
}
- e = pe_def_file->exports; /* convenience */
+ e = pe_def_file->exports; /* convenience, but watch out for it changing */
exported_symbol_offsets = (bfd_vma *) xmalloc (NE * sizeof (bfd_vma));
exported_symbol_sections = (struct sec **) xmalloc (NE * sizeof (struct sec *));
@@ -859,7 +859,7 @@ pe_dll_generate_def_file (pe_out_def_filename)
quoteput (im->internal_name, out, 0);
fprintf (out, " = ");
}
- quoteput (im->module, out, 0);
+ quoteput (im->module->name, out, 0);
fprintf (out, ".");
if (im->name)
quoteput (im->name, out, 0);