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: Get rid of weak symbols in static objects


Momchil Velikov <velco@fadata.bg> writes:

> >> I find useful to maintain the following invariant:
> >> 
> >> "Statically linked executables do not contain undefined symbols
> >> (unless --noinhibit-exec is given)."
> 
> Ian> Why is that useful?
> 
>   It roughly useful by the same reasons dead code elimination is
> useful.

Well, no.  Dead code elimination saves space in the executable and may
save space in the instruction cache.  Changing the handle of
unresolved weak undefined symbols has no comparable effect.

> Besides the generally good idea of being permissive in what
> you accept, but strict in what you output.

Well, it does depend upon your definition of what the proper strict
output is.

> >> From my point of view a weak undefined symbol which never sees a
> Ian> definition really is undefined.  The linker resolves it as though it
> Ian> has the value zero, but the linker never defines it in the usual
> Ian> sense.
> 
>   IMHO, it defines them exactly in the usual sense -- having a value
> to perform relocations with.

But the usual sense does include a symbol, which is absent in this
case.

Ian


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