[LLVMdev] [lld] -emit-yaml doesnot contain linker added symbols specified with command line options

Nick Kledzik kledzik at apple.com
Wed Aug 28 16:37:40 PDT 2013


On Aug 28, 2013, at 4:24 PM, Shankar Easwaran <shankare at codeaurora.org> wrote:
> Hi Nick,
> 
>>  Also for the case of -u, the Driver can make generic UndefinedAtoms. 
> ELF would want to treat the undefined symbols as a weak undefined symbols. So the driver cant create undefined atoms.
> 
> Below is an example :-
> 
> $cat 1.c
> int _start() { return 0; }
> $gcc -c 1.c
> $ld -u myundef 1.o
> ==> Does not throw any error, the resolver was hinted that myundef was a undefined weak symbol.
Wow.  Reading the gnu ld man page, that is not obvious.  How can you make a non-weak undefined on the command line?  That is, how can you force and error if something is not defined?


>>  Other options may need platform specific atoms which may be created with the help of static Writer methods.
> We wouldnt be able to override the functionality with each flavor, if we have a static method, or you had thought of something else ?
I’m not sure when we would want polymorphism.  If you wanted it in this case, there could be a method on LinkingContext to create a file of UndefinedAtoms, and ELFLinkingContext could override that method to make weak undefines.

-Nick

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130828/d2b2621e/attachment.html>


More information about the llvm-dev mailing list