Q: library - explicit definition of exported symbols?

Andreas Jaeger aj@suse.de
Thu Aug 2 05:47:00 GMT 2001


Heiko Nardmann <h.nardmann@secunet.de> writes:

> How can I explicitly define which symbols are exported by my library?
> I need solutions for both static and shared version.
> 
> My library imports some .a libs which should not be exported further.

Symbol versioning can do this, check how glibc implements it.

Andreas
-- 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7aUvPOJpWPMJyoSYRAoy6AJ0eC1HRpo5kiX5d6FcJfkIBACP48ACfSNLo
47jXOxCjzhJvS9iiVj37yYI=
=sXvG
-----END PGP SIGNATURE-----From hjl@lucon.org Thu Aug 02 10:11:00 2001
From: "H . J . Lu" <hjl@lucon.org>
To: Artur Frysiak <wiget@pld.org.pl>
Cc: binutils@sourceware.cygnus.com, amodra@bigpond.net.au
Subject: Re: strip 2.11.90.0.25 dumps core
Date: Thu, 02 Aug 2001 10:11:00 -0000
Message-id: <20010802100941.A23775@lucon.org>
References: <20010731141628.I30121@free.buy.pl> <20010731083312.A10404@lucon.org> <20010801154411.D12322@free.buy.pl> <20010801083023.A32569@lucon.org> <20010801181946.A7168@ikar.t17.ds.pwr.wroc.pl> <20010801092817.A1059@lucon.org> <20010802111445.A29935@ikar.t17.ds.pwr.wroc.pl>
X-SW-Source: 2001-08/msg00033.html
Content-length: 1420

On Thu, Aug 02, 2001 at 11:14:46AM +0200, Artur Frysiak wrote:
> On Wed, Aug 01, 2001 at 09:28:17AM -0700, H . J . Lu wrote:
> > 
> > Please send me all the binary files used to generate `rpm'.
> > I need
> > 
> > rpm.o
> > libdb1.a
> > libz.a
> > libbz2.a
> > ./build/.libs/librpmbuild.a
> > ./lib/.libs/librpm.a
> > /usr/lib/libdb-3.1.a
> > ./rpmio/.libs/librpmio.a
> > ./popt/.libs/libpopt.a
> 
> Files attached.
>  
> > Something it wrong with your setup.
> 

Please try this patch and relink rpm. Alan, why don't we discard all
relocations for static binaries? If it is the right thing to do, you
may want to check other ELF targets.

Thanks.


H.J.
----
2001-08-02  H.J. Lu  <hjl@gnu.org>

	* elf32-i386.c (allocate_plt_and_got_and_discard_relocs):
	Discard all relocations if there are no dynamic sections.

Index: elf32-i386.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf32-i386.c,v
retrieving revision 1.31
diff -u -p -r1.31 elf32-i386.c
--- elf32-i386.c	2001/06/29 18:25:45	1.31
+++ elf32-i386.c	2001/08/02 17:03:13
@@ -1197,6 +1197,7 @@ allocate_plt_and_got_and_discard_relocs 
     return true;
 
   if (!info->shared
+      && htab->root.dynamic_sections_created
       && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
       && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
 	  || h->root.type == bfd_link_hash_undefweak



More information about the Binutils mailing list