DragonFly BSD
DragonFly bugs List (threaded) for 2004-08
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: How to debug linker errors?


From: Jeroen Ruigrok/asmodai <asmodai@xxxxxx>
Date: Thu, 5 Aug 2004 07:58:39 +0200

-On [20040805 00:42], walt (wa1ter@xxxxxxxxxxxxx) wrote:
>I can easily see which header files define the 'missing'
>symbols, and those headers were properly included in the
>source files -- which is why there were no compile-time
>errors, obviously.

But are these prototype definitions or the actual function definitions?
Because most of the time a header just defines the prototype and the
subsequent library needs to get linked in (or appropriate object file) in
order to make sure the linker can find the pure function code.

>So what makes the linker choke when trying to link the
>object files?  Just where does the linker go to look
>for 'missing' symbols?

Give me a compilation example.  It all depends on context.

>I get the impression from reading the ld manpage that
>libraries may be treated differently from executable
>files when trying to find symbols -- is this correct?

Libraries are just object files which some twists to makes them shared (when
we're talking about .so here), like relocation sections and so on.

>Any suggestins for further reading on this topic for
>someone who will never be a kernel hacker or compiler
>writer?  ;o)

John R. Levine's Linkers and Loaders is *the* authoratative guide.  I think
he still has it online at linker.iecc.com or in the vicinity of that.

-- 
Jeroen Ruigrok van der Werven <asmodai(at)wxs.nl> / asmodai / kita no mono
Free Tibet! http://www.savetibet.org/ | http://www.tibet.nu/
http://www.tendra.org/   | http://www.in-nomine.org/
To regard the fundamental as the essence, to regard things as coarse, to
regard accumulation as deficiency, and to dwell quietly alone with the
spiritual and the intelligent -- herein lie the techniques of Tao of
the ancients.



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]