2005-03-11 Filip Navara <navaraf@reactos.com>
* ld/pe-dll.c (process_def_file, pe_dll_build_sections,
pe_dll_fill_sections): Don't export all symbols for shared
libraries when --export-all-symbols is not specified and
no .def file is specified.
--- ld/pe-dll.c Sun Oct 24 03:00:12 2004
+++ ld/pe-dll.c Fri Mar 11 14:36:31 2005
@@ -526,8 +542,7 @@
/* If we are not building a DLL, when there are no exports
we do not build an export table at all. */
- if (!pe_dll_export_everything && pe_def_file->num_exports == 0
- && info->executable)
+ if (!pe_dll_export_everything && pe_def_file->num_exports == 0)
return;
/* Now, maybe export everything else the default way. */
@@ -2630,8 +2701,13 @@
if (pe_def_file->num_exports == 0 && !info->shared)
return;
- generate_edata (abfd, info);
- build_filler_bfd (1);
+ if (pe_def_file->num_exports > 0)
+ {
+ generate_edata (abfd, info);
+ build_filler_bfd (1);
+ }
+ else
+ build_filler_bfd (0);
}
void
@@ -2663,13 +2739,16 @@
lang_do_assignments (stat_ptr->head, abs_output_section, NULL, 0);
}
- fill_edata (abfd, info);
-
if (info->shared && !info->pie)
pe_data (abfd)->dll = 1;
- edata_s->contents = edata_d;
reloc_s->contents = reloc_d;
+
+ if (pe_def_file->num_exports > 0)
+ {
+ fill_edata (abfd, info);
+ edata_s->contents = edata_d;
+ }
}
void