This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ld can leave undefined symbols in non-relocatable output
Dave Korn wrote:
> Joshua Oreman wrote:
>> Hi everyone,
>>
>> I'm on x86_64 using binutils 2.18.0 on GNU/Linux. I've recently run
>> across some counterintuitive behavior in the linker, but I'm not sure
>> whether it's intended or not. I was hoping someone on this list might
>> be able to clarify whether this is intended and dependable behavior,
>> or a bug.
>
> This is completely as intended and by design. You can leave undefined
> references in ELF executables (both SO libs and applications) and they are
> filled in by the dynamic loader at runtime. Therefore it is not seen as an
> error at link-time if the definition is not available then; it may be supplied
> by a library that is only available then.
PS: See also the documentation for the "--no-undefined" option in the LD
man/info page.
cheers,
DaveK