[binutils-gdb] dlltool: respect use-nul-prefixed-import-tables option for delaylib

Jan Beulich jbeulich@sourceware.org
Fri Jun 13 05:53:39 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2c79b421c7ddeb5be052eb3e7c2c24b8b1c4a86e

commit 2c79b421c7ddeb5be052eb3e7c2c24b8b1c4a86e
Author: Jeremy Drake <sourceware-bugzilla@jdrake.com>
Date:   Fri Jun 13 07:53:07 2025 +0200

    dlltool: respect use-nul-prefixed-import-tables option for delaylib
    
    Noticed the extra zeros while inspecting the output.
    
    Signed-off-by: Jeremy Drake <sourceware-bugzilla@jdrake.com>

Diff:
---
 binutils/dlltool.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/binutils/dlltool.c b/binutils/dlltool.c
index 4b08638f792..99c651f7f9b 100644
--- a/binutils/dlltool.c
+++ b/binutils/dlltool.c
@@ -2827,20 +2827,25 @@ make_delay_head (void)
   if (!no_idata5)
     {
       fprintf (f, "\t.section\t.didat$5\n");
-      /* NULL terminating list.  */
-      if (create_for_pep)
-	fprintf (f, "\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG);
-      else
-	fprintf (f, "\t%s\t0\n", ASM_LONG);
+      if (use_nul_prefixed_import_tables)
+	{
+	  if (create_for_pep)
+	    fprintf (f, "\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG);
+	  else
+	    fprintf (f, "\t%s\t0\n", ASM_LONG);
+	}
       fprintf (f, "__IAT_%s:\n", imp_name_lab);
     }
 
   if (!no_idata4)
     {
       fprintf (f, "\t.section\t.didat$4\n");
-      fprintf (f, "\t%s\t0\n", ASM_LONG);
-      if (create_for_pep)
-	fprintf (f, "\t%s\t0\n", ASM_LONG);
+      if (use_nul_prefixed_import_tables)
+	{
+	  fprintf (f, "\t%s\t0\n", ASM_LONG);
+	  if (create_for_pep)
+	    fprintf (f, "\t%s\t0\n", ASM_LONG);
+	}
       fprintf (f, "__INT_%s:\n", imp_name_lab);
     }


More information about the Binutils-cvs mailing list