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]
Other format: [Raw text]

Re: ld doesn't check for ld.so.1 in /lib


Hi!

I've been tracing the problem along elf32.em. It seems that calls to
gld${EMULATION_NAME}_try_needed are repeadly failing.

The part of _try_needed which causes the function to return FALSE in
all the cases where it's run is:

  if ((bfd_get_file_flags (abfd) & DYNAMIC) == 0)
    {
      bfd_close (abfd);
      return FALSE;
    }

Which in runtime turns out to be:

  if ((274 & 64) == 0)

I.e: 00000001 00010010 and 00000000 1000000 which result in 0

Any hints on what could be happening?

It gives me the impression that bfd_get_file_flags checks wether the dynamic
flag is enabled in the object and returns it in the 7th bit, as defined by
the DYNAMIC macro. Is that it? If it is, where should I blame it on that
ld.so.1 doesn't have the dynamic flag enabled?

Thanks.

On Sun, Aug 03, 2003 at 06:39:07PM -0700, Ian Lance Taylor wrote:
> 
> For shared objects in general, genscripts.sh stuffs the value of
> NATIVE_LIB_DIRS into script files which will wind up in the
> ld/ldscripts directory in your build directory.  The values in
> NATIVE_LIB_DIRS will appear as calls to SEARCH_DIR in the linker
> scripts.  Those calls will be passed to ldfile_add_library_path().
> Later, ldfile_open_file_search() will call
> gld${EMULATION_NAME}_open_dynamic_archive() (in elf32.em) for each
> entry in SEARCH_DIR.  That function is responsible for finding a
> shared object.
> 
> However, this warning:
>     ld: warning: ld.so.1, needed by /lib/libc.so.1, not found (try using -rpath or -rpath-link)
> indicates a search for a dependent shared library.  This is not done
> in the same way.  It is done in gld${EMULATION_NAME}_after_open() in
> elf32.em after the linker determines which dependent shared libraries
> are required.
> 
> In that function, look for the loop which begins
> 	  for (search = search_head; search != NULL; search = search->next)
> That looks through the entries made by ldfile_add_library_path().
> 
> Ian

-- 
Robert Millan

"[..] but the delight and pride of Aule is in the deed of making, and in the
thing made, and neither in possession nor in his own mastery; wherefore he
gives and hoards not, and is free from care, passing ever on to some new work."

 -- J.R.R.T, Ainulindale (Silmarillion)


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