delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/04/19/11:07:01

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3ADEFF50.74851A39@ece.gatech.edu>
Date: Thu, 19 Apr 2001 11:08:00 -0400
From: "Charles S. Wilson" <cwilson AT ece DOT gatech DOT edu>
X-Mailer: Mozilla 4.75 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Ralf Habacker <Ralf DOT Habacker AT saght DOT tessag DOT com>
CC: cygwin AT cygwin DOT com
Subject: Re: problems with --export-all-symbols option
References: <003001c0c8d5$7d0d3260$6e032bb7 AT BRAMSCHE>

See this thread:
  http://cygwin.com/ml/cygwin/2000-11/msg00242.html

and perhaps contact Paul directly -- he may have pushed his changes into
binutils by now, but I don't know.

--Chuck


Ralf Habacker wrote:
> 
> Hi,
> 
> I like to use the --export-all-symbols option to create a dll with all
> symbols exported how I found in the online documentation of gcc
> But this results in a linker failure, which says that some symbols
> "_[bss|data]_[start|end]__" not found.
> Additional in the resulting .a file the global variable is left.
> 
> By the way I'm using gcc version 2.95.3-2 (cygwin special).
> 
> I have added an example for this problem.
> 
> foo.h -----------------
> 
> extern int testvar;
> int testfunc(int a);
> 
> foo.c -----------------
> 
> #include <stdio.h>
> #include "foo.h"
> 
> int testvar = 0;
> 
> int testfunc(int a)
> {
>         printf("%d\n",a);
>         return 0;
> }
> 
> making... ----------------------------
> 
> gcc -c foo.c -o foo.o
> gcc -v -shared -Wl,--export-dynamic -Wl,--output-def=libfoo.def \
>         -Wl,--out-implib=libfoo.dll.a -Wl,--enable-auto-image-base \
>         --export-all-symbols -o libfoo.dll foo.o
> Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-2/specs
> gcc version 2.95.3-2 (cygwin special)
>  /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-2/collect2.exe --shared -Bdynamic -e
> __cygwin_dll_entry AT 12 --dll-search-prefix=cyg -o
> 
> libfoo.dll -L/usr/lib/w32api -L/usr/local/lib -L/usr/lib -L/usr/lib/gcc-lib/
> i686-pc-cygwin/2.95.3-2 --export-dynamic --outpu
> t-def=libfoo.def --out-implib=libfoo.dll.a --enable-auto-image-base
> foo.o -lgcc -lcygwin -luser32 -lkernel32 -ladvapi32 -lshe
> ll32 -lgcc
> Cannot export _bss_end__: symbol not defined
> Cannot export _bss_start__: symbol not defined
> Cannot export _data_end__: symbol not defined
> Cannot export _data_start__: symbol not defined
> Creating library file: libfoo.dll.a
> collect2: ld returned 1 exit status
> make: *** [libfoo.dll] Error 1
> 
> The resulting def file looks like this: -------------
> EXPORTS
> 
>     GetModuleHandleA AT 4 @1 DATA
>     __CTOR_LIST__ @2 DATA
>     __DTOR_LIST__ @3 DATA
>     _bss_end__ DATA
>     _bss_start__ DATA
>     _cygwin_crt0_common AT 8 @4 DATA
>     _cygwin_dll_entry AT 12 @5
>     _cygwin_noncygwin_dll_entry AT 12 @6
>     _data_end__ DATA
>     _data_start__ DATA
>     _fmode @7 DATA
>     _head_libkernel32_a @8 DATA
>     _head_templib_a @9 DATA
>     _imp__GetModuleHandleA AT 4 @10 DATA
>     _imp__calloc @11 DATA
>     _imp__cygwin_detach_dll @12 DATA
>     _imp__cygwin_internal @13 DATA
>     _imp__dll_dllcrt0 @14 DATA
>     _imp__free @15 DATA
>     _imp__malloc @16 DATA
>     _imp__printf @17 DATA
>     _imp__realloc @18 DATA
>     _impure_ptr @19 DATA
>     calloc @20 DATA
>     cygwin_attach_dll @21 DATA
>     cygwin_detach_dll @22 DATA
>     cygwin_internal @23 DATA
>     cygwin_premain0 @24 DATA
>     cygwin_premain1 @25 DATA
>     cygwin_premain2 @26 DATA
>     cygwin_premain3 @27 DATA
>     dll_dllcrt0 @28 DATA
>     environ @29 DATA
>     free @30 DATA
>     libkernel32_a_iname @31 DATA
>     malloc @32 DATA
>     printf @33 DATA
>     realloc @34 DATA
>     templib_a_iname @35 DATA
>     testfunc @36
>     testvar @37 DATA
> 
> $ nm libfoo.dll.a | grep "T _"
> 00000000 T _testfunc
> 00000000 T __cygwin_noncygwin_dll_entry AT 12
> 00000000 T __cygwin_dll_entry AT 12
> 
> $ nm libfoo.dll.a | grep "testvar"
> 00000000 I __imp__testvar
> 
> Has anyone an idea what I can do to solve the problem ?
> 
> Thanks
> 
> Ralf Habacker
> Germany
> 
> --
> Want to unsubscribe from this list?
> Check out: http://cygwin.com/ml/#unsubscribe-simple

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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