This is the mail archive of the mailing list for the glibc 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: undefined non-weak symbols

On Sat, May 03, 2003 at 07:35:38PM -0400, Jack Howarth wrote:
> Jakub,
>    I've asked you this a couple times before but I don't think
> I ever got a response (unless I missed it) and know some other
> debian folks are interested in the answer as well. Awhile back
> you told me that the warning issued from prelink of...
> prelink: Warning: /usr/lib/ has undefined non-weak symbols
> ...indicates that these libs would be prelinkable


> (but that the not in the most optimal fashion).


> I am wondering if these undefined non-weak
> can be avoided by following any specific rules in how shared libs are
> compiled and linked? Or is this more of a random occurance due to how
> binutils decides to do the linking internally? Thanks in advance for
> any information.

E.g. on my box I get among other things:
prelink: Warning: /usr/lib/ has undefined non-weak symbols

Now, if you want to investigate this, you can do:
ldd /usr/lib/

It will print normal ldd output plus tons of warnings like:
undefined symbol: gdk_root_window       (/usr/lib/
undefined symbol: gdk_threads_mutex     (/usr/lib/
undefined symbol: gdk_display   (/usr/lib/
undefined symbol: gdk_font_equal        (/usr/lib/
undefined symbol: gdk_selection_property        (/usr/lib/

Now, one has to decide whether these are undefined on purpose (such as
in some modules which use some symbols exported from binaries,
or if those symbols can be picked up from different libraries which
implement the same functions differently, etc.),
or if this is just ommision of a some library which is always needed
for it to work in its DT_NEEDED.
In the case of this looks obvious - the library
clearly cannot work without loaded as well, so the fix
should be just make sure gcc -shared ... -o is passed
-lgdk-1.2 on its command line. How to do that is application specific
obviously. And ideally, once a fix exists, it should of course be merged
to upstream maintainers of the project.
If this is not done, all these undefined symbols mean prelink conflicts
in all binaries which use these libraries.
E.g. on my box, there are 211 such undefined symbols in
(all of them because of missing in DT_NEEDED), and every
program which links against whether directly or indirectly
has those 211 completely unnecessary conflicts (e.g. gnome-terminal
has 479 of them, while if link command was fixed,
it would already have just 268).

Hope this helps...


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