This is the mail archive of the 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: Bug in dynamic linker

On Thu, Jul 20, 2000 at 03:06:29PM +0200, Mark Kettenis wrote:
> IMHO, this patch needs some more discussion.  This isn't a simple
> bugfix.  It changes the way the linker behaves from the user
> standpoint considerably, since it will now silently add DT_NEEDED
> entries for libraries that are not explicitly mentioned on the
> command-line.  I also wonder if this patch could change the order of
> the DT_NEEDED entries, e.g. can a DT_NEEDED generated by HJ's patch
> come before a DT_NEEDED for a library mentioned on the command line?
> Suppose I have an implementation of that depends on
>  I know link a program with  Before HJ's patch
> it would only get a DT_NEEDED entry for  Now it will also
> get one for

Are you just guessing or do you have a testcase? If you have a
testcase, please send it to me. I have verified your case won't
happen unless your program uses Try it yourself. If ld
adds to DT_NEEDED, it is a bug and you should report
it to me.

> Now suppose that is reimplemented such that it doesn't
> depend on, or even worse, depends on instead.
> It is very likely that the program mentioned above won't work anymore
> (either because is no longer present, or because there is
> a conflict between and  Even if the program
> itself doesn't use any symbols from
> The current situation has its problems too (the "Bug in dynamic
> linker" from the subject line[1]).  If your program does reference a
> symbol from, the link will succeed, but the dependency
> will not be recorded as a DT_NEEDED (but version dependecies will be
> recorded).  This can obvously result in obscure problems if the
> implementation of is changed as described above.
> IMHO, the *correct* solution is implementing what the Solaris linker
> does: refusing to link if a symbol in the program cannot be resolved
> in one of the libraries mentioned on the command line (printing a
> message if it can be found in one of those libraries dependencies to
> help the user).
> If the Solaris behaviour was implemented as the default behaviour, and

The Solaris behavior won't some runtime symbol version mismatch. We

> it has been verified that the library ordering issue doesn't occur, I
> wouldn't have any objections against this patch.  However, right now
> I'm not sure if it's a really good idea :-(.

Send me a testase if you still believe you are right.


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