[PATCH] [lld][ELF] Add undefined symbol option to lld

Shankar Kalpathi Easwaran shankarke at gmail.com
Tue Jun 18 09:58:39 PDT 2013



================
Comment at: lib/Driver/LDOptions.td:77
@@ +76,3 @@
+    HelpText<"Force symbol to be entered in the output file as an undefined symbol">;
+def u_alias : Joined<["--"], "undefined=">, Alias<u>;
+
----------------
Rui Ueyama wrote:
> Shankar Kalpathi Easwaran wrote:
> > Rui Ueyama wrote:
> > > Looks like GNU accepts all the following flags:
> > > 
> > >  1. -u foo
> > >  2. -u=foo
> > >  3. --undefined foo
> > >  4. --undefined=foo
> > > 
> > > I think with this patch lld will accept only case 1 and 4. Does the LLVM command option handler the capability to handle all these cases?
> > The option handler supports all combinations, will add them.
> Ah, ok, if we have four "def"s to support all the combinations, I'd rather don't add the last two. We should improve the option parser itself to support this GNU style options instead. OK only with the first two for now.
I dont think the option parser can recognize a different option name for the same option unless you specify it. Its better to support all the options that ld has for compatibility. I am planning to keep the existing code.


http://llvm-reviews.chandlerc.com/D997



More information about the llvm-commits mailing list