This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: GNU/Linux vs. libtool --no-undefined
- To: "H . J . Lu" <hjl at valinux dot com>
- Subject: Re: GNU/Linux vs. libtool --no-undefined
- From: Fergus Henderson <fjh at cs dot mu dot oz dot au>
- Date: Wed, 7 Feb 2001 12:05:35 +1100
- Cc: Andreas Schwab <schwab at suse dot de>, binutils at sourceware dot cygnus dot com, Mark Mitchell <mark at codesourcery dot com>, gcc at gcc dot gnu dot org
- References: <20010205211708R.mitchell@codesourcery.com> <jebssgkl77.fsf@hawking.suse.de> <20010207024456.A10994@venus.cs.mu.oz.au> <jeu2673iwq.fsf@hawking.suse.de> <20010206112928.A29981@valinux.com>
On 06-Feb-2001, H . J . Lu <hjl@valinux.com> wrote:
> Here is the code in question:
>
> /* This is called after all the input files have been opened. */
>
> static void
> gld${EMULATION_NAME}_after_open ()
> {
> struct bfd_link_needed_list *needed, *l;
>
> /* We only need to worry about this when doing a final link. */
> if (link_info.relocateable || link_info.shared)
> return;
>
> in ld/emultempl/elf32.em. DT_NEEDED is not searched for building DSOs.
> I am not sure if it should.
Hmm, how about the following (completely untested) patch?
- if (link_info.relocateable || link_info.shared)
+ if (link_info.relocateable || (link_info.shared && ! link_info.no_undefined))
(see below for full patch).
Or alternatively, perhaps it should be
if ((link_info.relocateable || link_info.shared) && ! link_info.no_undefined)
But I don't know what effect the `--no-undefined' option is supposed to have
when doing `ld -r'.
*** elf32.em.old Tue Nov 7 19:44:16 2000
--- elf32.em Wed Feb 7 12:02:17 2001
***************
*** 265,276 ****
static void
gld${EMULATION_NAME}_after_open ()
{
struct bfd_link_needed_list *needed, *l;
! /* We only need to worry about this when doing a final link. */
! if (link_info.relocateable || link_info.shared)
return;
/* Get the list of files which appear in DT_NEEDED entries in
dynamic objects included in the link (often there will be none).
For each such file, we want to track down the corresponding
--- 265,277 ----
static void
gld${EMULATION_NAME}_after_open ()
{
struct bfd_link_needed_list *needed, *l;
! /* We only need to worry about this when doing a final link,
! or when linking a shared library with `--no-undefined'. */
! if (link_info.relocateable || (link_info.shared && ! link_info.no_undefined))
return;
/* Get the list of files which appear in DT_NEEDED entries in
dynamic objects included in the link (often there will be none).
For each such file, we want to track down the corresponding
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.