On Tue, May 11, 2010 at 2:03 AM, Anton Korobeynikov <anton at korobeynikov.info> wrote:> > I think it emits valid output, but I don't think it handles weak symbols > > correctly, as COFF supports true weak symbols, but this code appears to > turn > > them into a linkonce section which is not quite the same thing. > Yes. This was intentional, since: > 1. At the time of writing the code binutils did not support weak stuff > 2. It was my feeling, that weak (especially external weak stuff) on > COFF differs in some details from e.g. weak on MachO/ELF. I might be > wrong, however... > > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University >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. -Nathan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100511/f50cbd14/attachment.html>
Hello, Nathan> 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).Right> 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.What if there will be two weak symbols? -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
> For the windows sub-target is it safe to assume Microsoft's linker is the being targeted?I'd really appreciate if both ms link and gnu ld will be tested, if this is possible. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
On 11 May 2010 18:04, Anton Korobeynikov <anton at korobeynikov.info> wrote:> > For the windows sub-target is it safe to assume Microsoft's linker is the > being targeted? > I'd really appreciate if both ms link and gnu ld will be tested, if > this is possible.I have done some tests with Cygwin, and most things seem okay, e.g. Static Constructors...Virtual Destructors. I did try building llvm-gcc on Cygwin with some hacks, but llvm-gcc requires some inline assembly, I may try and hack that through as assembly code. This involved linking and xgcc ran okay, so things are looking good :) Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100511/912dd092/attachment.html>