[PATCH] D36351: [lld][ELF] Add profile guided section layout

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 6 17:11:49 PST 2018


Michael Spencer <bigcheesegs at gmail.com> writes:

> On Thu, Feb 1, 2018 at 4:25 PM, Rafael Avila de Espindola <
> rafael.espindola at gmail.com> wrote:
>
>>
>> Testing the patch I have hit a case where the sorted program crashes.
>>
>> I have uploaded the test to
>>
>>  https://s3-us-west-2.amazonaws.com/linker-tests/t2.tar.xz
>
>
> The call graph file reduces down to a single line.
>
> __libc_csu_init _init 1
>
> You told the linker it could reorder _init, so it did. This happens to move
> _init to the end of .init. Obviously reordering _init is bad, and I'm
> pretty sure --symbol-ordering-file has the same problem (although it
> prefers to move to the front, so it would happen to work for _init). This
> is part of the reason why I originally restricted this to .text, as it's a
> known safe to reorder section.
>
> There are many ways to solve this, but for now I would prefer to white list
> the sections that are safe to reorder, and ignore any edges that include
> sections not in that list or edges between output sections.

Having a white list of sections is not acceptable for ELF.

Could you report a bug on --symbol-ordering-file with a testcase?

Cheers,
Rafael


More information about the llvm-commits mailing list