This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
A patch for elf32.em (Re: GNU/Linux vs. libtool --no-undefined)
- To: Fergus Henderson <fjh at cs dot mu dot oz dot au>
- Subject: A patch for elf32.em (Re: GNU/Linux vs. libtool --no-undefined)
- From: "H . J . Lu" <hjl at valinux dot com>
- Date: Tue, 6 Feb 2001 17:15:40 -0800
- Cc: binutils at sourceware dot cygnus dot com, Ian Lance Taylor <ian at zembu dot com>
- 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> <20010207120535.A25034@hg.cs.mu.oz.au>
On Wed, Feb 07, 2001 at 12:05:35PM +1100, Fergus Henderson wrote:
> 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
>
>
>
>
Any comments?
--
H.J. Lu (hjl@valinux.com)