[PATCH] D32612: Remove LinkerScript::flush

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Tue May 2 03:03:53 PDT 2017


Yes that approach would fail in the current implementation with
synchronize being done after SHF_LINK_ORDER reordering. When I was
experimenting with Thunks, the synchronize() was done before the
SHF_LINK_ORDER sections were reordered, I then reordered the
InputSectionDescription view of the SHF_LINK_ORDER sections.


On 28 April 2017 at 21:29, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:
> On 27 April 2017 at 19:30, Peter Smith via Phabricator
> <reviews at reviews.llvm.org> wrote:
>> peter.smith added a comment.
>>
>> This looks good to me too.
>>
>> One thing I observed when writing the code in the initial Thunks submission to insert the Thunks back into the InputSectionDescriptions was that the order of OutputSections::Sections should match the order of InputSectionDescription::Sections (on the assumption that any additional Sections added to OutputSections::Sections were added on the end). If I'm correct I think you may be able to:
>>
>> - Extract the last InputSectionBase from the last InputSectionDescription
>> - Find this section in OutputSection::Sections
>> - From the next section to the end of OutputSection::Sections should be your missing sections.
>>
>> I may have missed something though.
>
> For SHF_LINK_ORDER this fails, no?
>
>> Looking forward we'll need to make some changes to OutputSections::finalize(), if there are orphan link-order sections (the sentinel .ARM.exidx) for example they will get added to a new InputSectionDescription. The current sort of link order sections will only work on a single InputSectionDescription. When I get back to the office on Tuesday I'll rebase https://reviews.llvm.org/D32233, and my Thunks patches on top of this.
>>
>>
>> https://reviews.llvm.org/D32612
>>
>>
>>


More information about the llvm-commits mailing list