[LLVMdev] [lld] -emit-yaml doesnot contain linker added symbols specified with command line options
Shankar Easwaran
shankare at codeaurora.org
Wed Aug 28 16:57:02 PDT 2013
Hi Nick,
On 8/28/2013 6:37 PM, Nick Kledzik wrote
> $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?
I think the linker will barf only if the input file contained an
undefined symbol and not by any other means.
>>> 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.
Yes this will work for undefined atoms that need to be supported by all
flavors. All the implicit files that are needed would be added to a
vector of files in the inputGraph,
addImplicitFiles would splice/prepend to the list of input files which
it already has.
Do you think that we still want the Writer::addFiles API, as this
already covers the functionalities that is needed.
Thanks
Shankar Easwaran
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation
More information about the llvm-dev
mailing list