PATCH mingw32 PE dlltool: Use internal name in import files.

Aaron W. LaFramboise aaron98wiridge9@aaronwl.com
Mon Jun 28 10:03:00 GMT 2004


It seems as if internal names were only implemented superficially.  The
parser read in the internal names, and would write them back out, but it
didn't actually use them when generating import libraries.  It seems a
little strange that noone ever noticed this, as this is a fairly
important feature.

This patch trivially fixes this.

2004-06-28  Aaron W. LaFramboise <aaron98wiridge9@aaronwl.com>

	* binutils/dlltool.c (make_one_lib_file): Use internal_name
	instead of name.

Index: src/binutils/dlltool.c
===================================================================
RCS file: /cvs/src/src/binutils/dlltool.c,v
retrieving revision 1.49
diff -c -3 -p -r1.49 dlltool.c
*** src/binutils/dlltool.c	15 Jun 2004 01:19:13 -0000	1.49
--- src/binutils/dlltool.c	28 Jun 2004 09:52:48 -0000
*************** make_one_lib_file (export_type *exp, int
*** 2311,2317 ****
        if (! exp->data)
  	{
  	  exp_label = bfd_make_empty_symbol (abfd);
! 	  exp_label->name = make_imp_label ("", exp->name);

  	  /* On PowerPC, the function name points to a descriptor in
  	     the rdata section, the first element of which is a
--- 2311,2317 ----
        if (! exp->data)
  	{
  	  exp_label = bfd_make_empty_symbol (abfd);
! 	  exp_label->name = make_imp_label ("", exp->internal_name);

  	  /* On PowerPC, the function name points to a descriptor in
  	     the rdata section, the first element of which is a
*************** make_one_lib_file (export_type *exp, int
*** 2340,2353 ****
        if (create_compat_implib)
  	{
  	  iname = bfd_make_empty_symbol (abfd);
! 	  iname->name = make_imp_label ("___imp", exp->name);
  	  iname->section = secdata[IDATA5].sec;
  	  iname->flags = BSF_GLOBAL;
  	  iname->value = 0;
  	}

        iname2 = bfd_make_empty_symbol (abfd);
!       iname2->name = make_imp_label ("__imp_", exp->name);
        iname2->section = secdata[IDATA5].sec;
        iname2->flags = BSF_GLOBAL;
        iname2->value = 0;
--- 2340,2353 ----
        if (create_compat_implib)
  	{
  	  iname = bfd_make_empty_symbol (abfd);
! 	  iname->name = make_imp_label ("___imp", exp->internal_name);
  	  iname->section = secdata[IDATA5].sec;
  	  iname->flags = BSF_GLOBAL;
  	  iname->value = 0;
  	}

        iname2 = bfd_make_empty_symbol (abfd);
!       iname2->name = make_imp_label ("__imp_", exp->internal_name);
        iname2->section = secdata[IDATA5].sec;
        iname2->flags = BSF_GLOBAL;
        iname2->value = 0;



More information about the Binutils mailing list