bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cannot undefine with -u option to ld


From: first last
Subject: Re: cannot undefine with -u option to ld
Date: Mon, 17 Sep 2001 22:23:49 -0400

I have resolved my immediate problem, but the
larger issue of "silent failure" should probably
be addressed.

Silent Failure ---
It appears that when "-u" is used, ld will
attempt to define the symbol in the usual way
(library searches, etc), but , if it cannot, it
fails silently.  It inserts the symbol in the
symbol table, annotates it with UND (to indicate
that it is undefined), but then completes without
indicating a warning or an error.

How I Fixed Things ---
In my case, I do not remember exactly how I fixed
the problem, but it was definitely caused by 
operator error.  Possibly the symbol was spelled
differently on the ld command line than in the
module where it was defined.  Possibly the
library search order was incorrect.  Once all the
ducks were lined up, "ld -u" worked. 
Unfortunately the silent failure of "-u"
misdirected me for several days.

In my first email, I reported that "-u" worked
for __gccmain but for no other symbol that I
tried.  This was a red herring.  "-u" failed with
__gccmain just as well.  However,__gccmain became
defined later in the link process for other
reasons, unrelated to "-u".  This lead me to
believe that "-u" worked for this one symbol but
for no others.

Recommendation ---
I would like to recommend that ld be modified to
end with an error (or at least a noticeable
warning) when a symbol is undefined with "-u" and
ld never resolves the problem.

(For reference, this thread started in
address@hidden)

________________________________________
Get your email at 
http://www.prontomail.com 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]