So the linker from producing an export data table when run with --exclude-all-symbols.
authorNick Clifton <nickc@redhat.com>
Mon, 20 Feb 2023 11:32:52 +0000 (11:32 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 20 Feb 2023 11:32:52 +0000 (11:32 +0000)
 PR 30004 * pe-dll.c (pe_dll_build_sections): Do not build an edata section if all symbols are being excluded.

ld/ChangeLog
ld/pe-dll.c

index 0fa00a95525081d7989392e61ba3a2f70cf26339..de9ed2753bc933d04fc40b9bb5d38e54f1b646f1 100644 (file)
@@ -1,3 +1,9 @@
+2023-02-20  Nick Clifton  <nickc@redhat.com>
+
+       PR 30004
+       * pe-dll.c (pe_dll_build_sections): Do not build an edata section
+       if all symbols are being excluded.
+
 2023-02-16  Ulf Samuelsson <binutils@emagii.com>
            Nick Clifton  <nickc@redhat.com>
 
index 2956eef1ca91680ff86267fee418d3ce91c19bcb..7e0d886cfb92956fc07884baa26ae43c4c14ca43 100644 (file)
@@ -3659,7 +3659,8 @@ pe_dll_build_sections (bfd *abfd, struct bfd_link_info *info)
   pe_output_file_set_long_section_names (abfd);
   process_def_file_and_drectve (abfd, info);
 
-  if (pe_def_file->num_exports == 0 && !bfd_link_pic (info))
+  if (pe_def_file->num_exports == 0
+      && (!bfd_link_pic (info) || pe_dll_exclude_all_symbols))
     {
       if (pe_dll_enable_reloc_section)
        {