<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
<div>I've encountered the problem with weak symbols also, and filed a bug report against ghc (#3333).</div><div><br></div><div>Weak symbols are used by gcc (with elf) to accommodate C++'s compilation model. &nbsp;In C++, it's permitted to define class methods and template code in header files. &nbsp;Because header files can be included in many source files, the same object code will appear in many object files. &nbsp;It's the linker's job to merge these definitions. &nbsp;There's no standard way of handling C++ linking, unfortunately, so handling weak symbols won't necessarily solve the problem for every compiler.</div><div><br></div><div>If there will be no cross-references involving weak symbols between different .a files, such as when you have a C++ library that doesn't depend on other C++ libraries, then it should be sufficient to treat a weak defined symbol as 'defined' and a weak undefined symbol as NULL. &nbsp;However, I don't know if this is really a common case; most C++ code depends on libstdc++, in which case there may be multiple weak symbol definitions.</div><div><br></div><div>--heatsink</div><br>&gt; <br>&gt; Thanks for the reply, Max.<br>&gt; <br>&gt; If it's not something overly complex, I'll try to hack ghc<br>&gt; to see if I can produce a working patch...<br>&gt; <br>&gt; probably that symbol type can be safely ignored by<br>&gt; ghci linker.<br>&gt; <br>&gt; Thanks again for your help<br>&gt; Paolo<br>&gt; <br>&gt; <br>&gt; On Wed, Sep 30, 2009 at 2:29 PM, Max Bolingbroke<br>&gt; &lt;batterseapower@hotmail.com&gt; wrote:<br>&gt; &gt; (Moving to ghc-users)<br>&gt; &gt;<br>&gt; &gt; I'd never seen V in nm output before:<br>&gt; &gt;<br>&gt; &gt; """<br>&gt; &gt; The symbol is a weak object. &nbsp;When a weak defined symbol is linked<br>&gt; &gt; with a normal defined symbol, the normal defined symbol is used with<br>&gt; &gt; no error. &nbsp;When a weak undefined symbol is linked and the symbol is<br>&gt; &gt; not defined, the value of the &nbsp;weak symbol becomes zero with no error.<br>&gt; &gt; &nbsp;On some systems, uppercase indicates that a default value has been<br>&gt; &gt; specified.<br>&gt; &gt; """"<br>&gt; <br>                                               <br /><hr />Hotmail: Trusted email with powerful SPAM protection. <a href='http://clk.atdmt.com/GBL/go/177141665/direct/01/' target='_new'>Sign up now.</a></body>
</html>