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: Nick Clifton
Subject: Re: cannot undefine with -u option to ld
Date: 18 Sep 2001 10:50:24 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Hi,

> 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.

This is actually the accepted behaviour and probably should not be
changed.  (There can be quite a few undefined symbol references even
in a fully resolved link).

If you need to force a symbol to be resolved, simply place it into an
object file and then include it on the link command line.  eg to force
a reference to "foo":

  % cat foo.c
  int foo_ref asm ("foo");

  % gcc -c foo.c

  % gcc myprog.o foo.o


Cheers
        Nick




reply via email to

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