aboutsummaryrefslogtreecommitdiff
path: root/ld/pe-dll.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-01-28 11:39:43 +0000
committerNick Clifton <nickc@redhat.com>2003-01-28 11:39:43 +0000
commita35bc64f56090692e1d45bc5754bacd679a132b9 (patch)
tree95ba36969f9c264b816bb28c54241e76368f95a7 /ld/pe-dll.c
parenta7ed1ca20297f91205d0a92f6c55bdc1ef1acce5 (diff)
downloadgdb-a35bc64f56090692e1d45bc5754bacd679a132b9.zip
gdb-a35bc64f56090692e1d45bc5754bacd679a132b9.tar.gz
gdb-a35bc64f56090692e1d45bc5754bacd679a132b9.tar.bz2
Add code to prevent importing a dll multiple times.
Diffstat (limited to 'ld/pe-dll.c')
-rw-r--r--ld/pe-dll.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index f8c1419..5b7a741 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -2018,8 +2018,8 @@ make_import_fixup_mark (rel)
overflowing this buffer... */
{
free (fixup_name);
- /* New buffer size is length of symbol, plus 25, but then
- rounded up to the nearest multiple of 128. */
+ /* New buffer size is length of symbol, plus 25, but
+ then rounded up to the nearest multiple of 128. */
buffer_len = ((strlen (sym->name) + 25) + 127) & ~127;
fixup_name = (char *) xmalloc (buffer_len);
}
@@ -2153,7 +2153,7 @@ make_runtime_pseudo_reloc (name, fixup_name, addend, parent)
}
/* .section .rdata
- .rva __pei386_runtime_relocator */
+ .rva __pei386_runtime_relocator */
static bfd *
pe_create_runtime_relocator_reference (parent)
@@ -2609,6 +2609,16 @@ pe_implied_import_dll (filename)
to enable symbolic dll linking. */
dll_name = pe_as32 (expdata + 12) + erva;
+ /* Check to see if the dll has already been added to
+ the definition list and if so return without error.
+ This avoids multiple symbol definitions. */
+ if (def_get_module (pe_def_file, dll_name))
+ {
+ if (pe_dll_extra_pe_debug)
+ printf ("%s is already loaded\n", dll_name);
+ return TRUE;
+ }
+
/* Iterate through the list of symbols. */
for (i = 0; i < nexp; i++)
{