[PATCH] [ELF] Support --defsym option to define an absolute symbol.

Rui Ueyama ruiu at google.com
Fri Mar 28 11:21:15 PDT 2014


On Fri, Mar 28, 2014 at 10:14 AM, Shankar Easwaran
<shankare at codeaurora.org>wrote:

>  On 3/28/2014 11:57 AM, Rui Ueyama wrote:
>
> On Fri, Mar 28, 2014 at 9:53 AM, Rui Ueyama <ruiu at google.com> <ruiu at google.com> wrote:
>
>
>  On Fri, Mar 28, 2014 at 9:42 AM, Shankar Kalpathi Easwaran <shankarke at gmail.com> wrote:
>
>
>    Ok, I agree about that its more complex to have the complete --defsym
> option.
>
>   Once the above comment is fixed, this patch LGTM.
>
>
> ================
> Comment at: lib/Core/LinkingContext.cpp:59-61
> @@ -58,5 +58,5 @@
>
> -std::unique_ptr<File> LinkingContext::createUndefinedSymbolFile() const {
> -  return createUndefinedSymbolFile("command line option -u");
> +std::unique_ptr<File> LinkingContext::createCommandLineFile() const {
> +  return createCommandLineFile("<command line option -u or --defsym>");
>  }
>
> ----------------
> Can we use a separate string for -u and --defsym. We could have a
> createCommandLineFile with a StringRef like how PECOFF does, so that we can
> support more command line defined by various options.
>
>  It's actually pretty odd that we have a piece of code in LinkingContext
> that creates what seems ELF-specific thing ("<command line option -u or
> --defsym>"). Need to be refactored. Anyways I'll create a separate file for
> --defsym.
>
>
>  It turned out that it's not that easy -- each *Flavor*LinkingContext is
> expected to create at most one file for its internal use. If it doesn't
> need one, createCommandLIneFile return a nullptr, or a file instance
> otherwise. That's working well, so we should keep it. Let's go with a
> single file here.
>
>
>
> createInternalFiles would create a separate --defsym file and add it to
> the list of internal files, and append to the list of internal files.
>

I don't see the benefit of having many files instead of one unified virtual
file that driver creates. Maybe it's sometimes useful for debugging? I
don't have strong opinion on this, so I'll create a separate file and add
it in createInternalFiles for now.

-
>
> Shankar Easwaran
>
>
>
>
> _______________________________________________
> llvm-commits mailing listllvm-commits at cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
>
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140328/af128c62/attachment.html>


More information about the llvm-commits mailing list