summaryrefslogtreecommitdiffstats
path: root/ld/pe-dll.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2000-09-28 20:53:40 +0000
committerDJ Delorie <dj@redhat.com>2000-09-28 20:53:40 +0000
commit45b1f63c8cdded5c3b874abc87b02ee079ac4e93 (patch)
tree42c35d1c47d8931fdbf544363eac56a3254f98cf /ld/pe-dll.c
parent170cdc4f01682c7873834d0b6fe88a2170bf14b2 (diff)
downloadppe42-binutils-45b1f63c8cdded5c3b874abc87b02ee079ac4e93.tar.gz
ppe42-binutils-45b1f63c8cdded5c3b874abc87b02ee079ac4e93.zip
* pe-dll.c (process_def_file): Uninitialized data wasn't
exported with --export-all-symbols switch. * pe-dll.c (fill_edata): rearrange the data so that ordinals and noname work properly.
Diffstat (limited to 'ld/pe-dll.c')
-rw-r--r--ld/pe-dll.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index cbd0c495a4..99ca312584 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -302,7 +302,10 @@ process_def_file (abfd, info)
for (j = 0; j < nsyms; j++)
{
- if (symbols[j]->flags & BSF_GLOBAL)
+ /* We should export symbols which are either global or not
+ anything at all (.bss data is the latter) */
+ if ((symbols[j]->flags & BSF_GLOBAL)
+ || (symbols[j]->flags == BSF_NO_FLAGS))
{
const char *sn = symbols[j]->name;
if (*sn == '_')
@@ -703,19 +706,21 @@ fill_edata (abfd, info)
unsigned long srva = (exported_symbol_offsets[s]
+ ssec->output_section->vma
+ ssec->output_offset);
+ int ord = pe_def_file->exports[s].ordinal;
- bfd_put_32 (abfd, srva - image_base, (void *) (eaddresses + i));
+ bfd_put_32 (abfd, srva - image_base,
+ (void *) (eaddresses + ord - min_ordinal));
if (!pe_def_file->exports[s].flag_noname)
{
char *ename = pe_def_file->exports[s].name;
bfd_put_32 (abfd, ERVA (enamestr), (void *) enameptrs);
+ enameptrs++;
strcpy (enamestr, ename);
enamestr += strlen (enamestr) + 1;
- bfd_put_16 (abfd, i, (void *) eordinals);
- enameptrs++;
+ bfd_put_16 (abfd, ord - min_ordinal, (void *) eordinals);
+ eordinals++;
pe_def_file->exports[s].hint = hint++;
}
- eordinals++;
}
}
}
OpenPOWER on IntegriCloud