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: Hardcoded path named in DT_NEEDED entry


On Thu May 17 14:33:54 2001 H . J . Lu <hjl@lucon.org> wrote :
> Oops. I missed that one. Thanks. Here is a patch. I will check it in
> shortly. Speak now if anyone objects.

Never mind. I am able to get the linker not to list full path
name using a comination of -L an -l i.e.,

   gcc -L/full/path/to -shared -o libfoo.so foo.c -la -lb

where liba.so and libb.so are my local libraries that I
know will be in the LD_LIBRARY_PATH when I use libfoo.so.

Please DO NOT apply this patch. As Alan Modra pointed out in an
earlier mail, applying this patch violates the ELF ABI spec.


Thanks for all the help and time.

Bharadwaj

> ----
> 2001-05-17  H.J. Lu  <hjl@gnu.org>
> 
> 	* elflink.h (elf_link_add_object_symbols): Set DT_NEEDED to
> 	basename of the bfd filename.
> 
> --- elflink.h.needed	Thu May 17 11:26:31 2001
> +++ elflink.h	Thu May 17 11:28:13 2001
> @@ -1247,7 +1247,7 @@ elf_link_add_object_symbols (abfd, info)
>  	 elf_dt_name, we don't make a DT_NEEDED entry at all, even if
>  	 there is a DT_SONAME entry.  */
>        add_needed = true;
> -      name = bfd_get_filename (abfd);
> +      name = basename (bfd_get_filename (abfd));
>        if (elf_dt_name (abfd) != NULL)
>  	{
>  	  name = elf_dt_name (abfd);
> 



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