This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: GNU/Linux vs. libtool --no-undefined


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]