How do I link to a shared lib without having that lib's dependencies (the way MS link does)

Ian Lance Taylor ian@airs.com
Wed Aug 13 16:35:00 GMT 2003


Nick Clifton <nickc@redhat.com> writes:

>   It seems to me however that having three different switches to
>   control the linker's behaviour with undefined references is a bit
>   much.

Take a look at the Solaris linker.  I think it supports something like
-Bundefined and maybe some other -B options along these lines.  Or it
might be -z something--I can't remember.

>   So for example we could have one switch, say,
>   --ignore-unresolved-symbols=<setting> which could take a number of
>   different values:
> 
>     all                  [ignore any unresolved reference]
>     none                 [do not ignore any unresolved reference]
>     in-shared-libraries  [references from one shared library to another]
>     in-object-files      [references in object files]

An orthogonal choice is whether the message should be a warning or an
error.  In a case of static linking, it should clearly be an error.
In other cases, it is less clear.

Ian



More information about the Binutils mailing list