<div class="gmail_quote">On Tue, May 11, 2010 at 2:03 AM, Anton Korobeynikov <span dir="ltr"><<a href="mailto:anton@korobeynikov.info">anton@korobeynikov.info</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">> I think it emits valid output, but I don't think it handles weak symbols<br>
> correctly, as COFF supports true weak symbols, but this code appears to turn<br>
> them into a linkonce section which is not quite the same thing.<br>
</div>Yes. This was intentional, since:<br>
1. At the time of writing the code binutils did not support weak stuff<br>
2. It was my feeling, that weak (especially external weak stuff) on<br>
COFF differs in some details from e.g. weak on MachO/ELF. I might be<br>
wrong, however...<br>
<font color="#888888"><br>
--<br>
With best regards, Anton Korobeynikov<br>
Faculty of Mathematics and Mechanics, Saint Petersburg State University<br>
</font></blockquote></div><br><div>It is my understanding that weak symbols are symbols that can be overridden (i.e. library provides a default implementation, and the application may override it). Whereas linkonce (or COMDAT) is for symbol that might show up in multiple object file but are effectively the same so its not particularly important which one is selected. According to Microsoft's COFF documentation, weak linkage is supported. From what I can gather from the documentation, only one symbol may be defined as weak, and the overriding symbol if present would be define normally. Perhaps this is the difference in detail you speak of.<br>
<br></div><div>-Nathan</div>