aboutsummaryrefslogtreecommitdiff
path: root/ld/pe-dll.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2000-07-17 18:40:47 +0000
committerDJ Delorie <dj@redhat.com>2000-07-17 18:40:47 +0000
commit874c8c99dbd3b8cd791daf88b8befd858f07587a (patch)
treec4dd6061ee1e37d3e8070a29f771a4aca8bdf9e4 /ld/pe-dll.c
parent67aa9423b0c4c7fc4f74ed2519551d2eebcf7ea1 (diff)
downloadgdb-874c8c99dbd3b8cd791daf88b8befd858f07587a.zip
gdb-874c8c99dbd3b8cd791daf88b8befd858f07587a.tar.gz
gdb-874c8c99dbd3b8cd791daf88b8befd858f07587a.tar.bz2
* pe-dll.c (process_def_file): auto-export data items also
(pe_process_import_defs): also see if _imp_ form needed
Diffstat (limited to 'ld/pe-dll.c')
-rw-r--r--ld/pe-dll.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index ad7b28a..3fdcbba 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -301,8 +301,7 @@ process_def_file (abfd, info)
for (j = 0; j < nsyms; j++)
{
- if ((symbols[j]->flags & (BSF_FUNCTION | BSF_GLOBAL))
- == (BSF_FUNCTION | BSF_GLOBAL))
+ if (symbols[j]->flags & BSF_GLOBAL)
{
const char *sn = symbols[j]->name;
if (*sn == '_')
@@ -1661,10 +1660,17 @@ pe_process_import_defs (output_bfd, link_info)
struct bfd_link_hash_entry *blhe;
/* see if we need this import */
- char *name = (char *) xmalloc (strlen (pe_def_file->imports[i].internal_name) + 2);
+ char *name = (char *) xmalloc (strlen (pe_def_file->imports[i].internal_name) + 2 + 6);
sprintf (name, "%s%s", U(""), pe_def_file->imports[i].internal_name);
blhe = bfd_link_hash_lookup (link_info->hash, name,
false, false, false);
+ if (!blhe || (blhe && blhe->type != bfd_link_hash_undefined))
+ {
+ sprintf (name, "%s%s", U("_imp__"),
+ pe_def_file->imports[i].internal_name);
+ blhe = bfd_link_hash_lookup (link_info->hash, name,
+ false, false, false);
+ }
free (name);
if (blhe && blhe->type == bfd_link_hash_undefined)
{