delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-apps/2002/04/25/14:49:39

Mailing-List: contact cygwin-apps-help AT cygwin DOT com; run by ezmlm
Sender: cygwin-apps-owner AT cygwin DOT com
List-Subscribe: <mailto:cygwin-apps-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-apps/>
List-Post: <mailto:cygwin-apps AT cygwin DOT com>
List-Help: <mailto:cygwin-apps-help AT cygwin DOT com>, <http://sources.redhat.com/lists.html#faqs>
Mail-Followup-To: cygwin-apps AT cygwin DOT com
Delivered-To: mailing list cygwin-apps AT cygwin DOT com
Message-ID: <3CC84F94.1030002@ece.gatech.edu>
Date: Thu, 25 Apr 2002 14:48:52 -0400
From: Charles Wilson <cwilson AT ece DOT gatech DOT edu>
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.4) Gecko/20011019 Netscape6/6.2
X-Accept-Language: en-us
MIME-Version: 1.0
To: Ralf Habacker <Ralf DOT Habacker AT freenet DOT de>
CC: Kde-Cygwin <kde-cygwin AT kde DOT org>, Cygwin-Apps <cygwin-apps AT cygwin DOT com>,
Binutils <binutils AT sources DOT redhat DOT com>
Subject: Re: cygwin ld import library issue fix (removing unused "_nm_" symbols)
References: <000101c1ec89$2eeaa990$625d07d5 AT BRAMSCHE>

In theory, it looks good. However, have you tested the following:

a) build a dll using an unmodified ld.
b) build an app that uses that dll, and which accesses both a function 
export and a data export from the dll.
c) rebuild the dll using your modified ld.
d) does the app still work, without relinking?

If not, then I can't accept this -- it would eventually break ALL 
existing dynamically linked exe's.

--Chuck

Ralf Habacker wrote:

>>Do not use C++ style comments in C code.  It is non-portable.
>>
>>
> 
> This is an updated patch against the current cvs release and without c++
> comments and a (I hope) propper changeLog entry.
> 
> 
> 2002-04-25  Ralf Habacker  <Ralf DOT Habacker AT freenet DOT de>
> 
> 	* pe-dll.cc (autofilter_symbolprefixlist): don't export
>       reimported functions.
>       (make_one): let create only _nm_.. for data symbols
> 
> Index: pe-dll.c
> ===================================================================
> RCS file: /cvs/src/src/ld/pe-dll.c,v
> retrieving revision 1.38
> diff -u -3 -p -r1.38 pe-dll.c
> --- pe-dll.c    15 Feb 2002 02:11:05 -0000      1.38
> +++ pe-dll.c    25 Apr 2002 18:34:43 -0000
> @@ -252,6 +252,8 @@ static autofilter_entry_type autofilter_
>    /*  { "__imp_", 6 }, */
>    /* Do __imp_ explicitly to save time.  */
>    { "__rtti_", 7 },
> +  /* Don't export reimported functions*/
> +  { "_nm_", 4 },
>    { "__builtin_", 10 },
>    /* Don't export symbols specifying internal DLL layout.  */
>    { "_head_", 6 },
> @@ -1793,8 +1795,11 @@ make_one (exp, parent)
>    quick_symbol (abfd, U ("_head_"), dll_symname, "", UNDSEC, BSF_GLOBAL, 0);
>    quick_symbol (abfd, U ("_imp__"), exp->internal_name, "", id5, BSF_GLOBAL,
> 0);
>    /* Symbol to reference ord/name of imported
> -     symbol, used to implement auto-import.  */
> -  quick_symbol (abfd, U("_nm__"), exp->internal_name, "", id6, BSF_GLOBAL, 0);
> +     symbol, used to implement auto-import.
> +     (only for data symbols) */
> +  if (exp->flag_data)
> +    quick_symbol (abfd, U("_nm__"), exp->internal_name, "", id6, BSF_GLOBAL,
> 0);
> +
>    if (pe_dll_compat_implib)
>      quick_symbol (abfd, U ("__imp_"), exp->internal_name, "",
>                   id5, BSF_GLOBAL, 0);
> 
> 


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019