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

Shankar Easwaran shankare at codeaurora.org
Fri Mar 28 10:14:06 PDT 2014


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> 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.

-

Shankar Easwaran


>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://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/5651de04/attachment.html>


More information about the llvm-commits mailing list