[llvm-commits] [PATCH] [lld] Use CLI/Target entrypoint instead of default "_start" in WriterOptionsELF

Michael Spencer bigcheesegs at gmail.com
Thu Jan 24 12:51:11 PST 2013


On Thu, Jan 24, 2013 at 5:42 AM, Ahmed Bougacha
<ahmed.bougacha at gmail.com> wrote:
> On Thu, Jan 24, 2013 at 2:20 PM, Michael Spencer <bigcheesegs at gmail.com> wrote:
>> On Thu, Jan 24, 2013 at 4:00 AM, Ahmed Bougacha
>> <ahmed.bougacha at gmail.com> wrote:
>>> On Thu, Jan 17, 2013 at 4:24 PM, Shankar Easwaran
>>> <shankare at codeaurora.org> wrote:
>>>> I am working on a patch where the options are going to be defined in the
>>>> target. There would be a TargetInfo class which would define all the needed
>>>> options which WriterELFOptions / ReaderELFOptions would contain.
>>>
>>> Here is an updated version of the entrypoint patch, made much shorter
>>> by your work.
>>>
>>> Thanks,
>>> -- Ahmed Bougacha
>>>
>>>> Thanks
>>>>
>>>> Shankar Easwaran
>>>>
>>>>
>>>> On 1/17/2013 8:43 AM, Ahmed Bougacha wrote:
>>>>
>>>> Hi Michael, Nick, all,
>>>>
>>>> I was toying with lld when I noticed command-line and target-defined
>>>> entrypoints are never used, with the entrypoint always defaulting to
>>>> _start. With the small attached patch it works as expected.
>>>>
>>>> When writing a testcase, I also noticed lld-core doesn't accept a
>>>> --entry= argument, so I added it too. For now, this is only used by
>>>> WriterOptionsELF.
>>>>
>>>> As to other writers, how about making WriterOptionsELF a WriterOptions
>>>> and adding the entrypoint there for all Writers to use? If no one is
>>>> working on it and it's ok I can take care of it.
>>>>
>>>> Thanks,
>>>>
>>>> -- Ahmed Bougacha
>>
>> The patch looks good, but the tests need some fixing.
>>
>> You don't need to put entrypoint in the Inputs folder. That's only for
>> test inputs that can't fit in a file that lit works with. Such as
>> binary files. The test itself should contain that content. See the
>> other objtxt tests.
>
> Right, fixed.
>
>> Also, the test should use the lld -core interface.
>
> It does run lld-core, or maybe you are talking about something else?
>
>> And wrap lines at 80 col, even in tests.
>>
>> - Michael Spencer
>
> -- Ahmed Bougacha

See elf/ifunc.test for an example of lld -core. I just realized that
lld -core currently doesn't work with YAML files, so the patch is
actually fine as is. Do you have commit access?

- Michael Spencer



More information about the llvm-commits mailing list