[PATCH] D43574: [ELF] - Introduce getInputSections() helper.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 22 09:06:27 PST 2018


>> jhenderson wrote:
>>> This isn't a direct equivalent of what was there before, as it only takes account of InputSectionDescription commands, and not other commands, such as BYTE() or symbol >assignments. This has an effect on the layout, though I haven't conclusively determined what (it affects the "Rank" somehow). See PR36475.
>> You right.
>> What we do is set output section flags to flags of synthetic input section. Then we remove this empty section here and mark output
>> section as dead.
>> `adjustSectionsBeforeSorting` might resurrect it and reassign flags to different ones.
>> If script would not contain empty synthetic section in output section description, I think flags would be the same as now.
>> So, this is definitely not a direct equivalent, but I am not sure if it is an issue ?
>
>We should at least have a test showing the difference.
>
>Cheers,
>Rafael

That is true. I wonder if we want to revert this particular place for now or not.

It also can be worth to think about fixing following case:
if output section has input sections A and B and A is removed, then output section remains live,
and has flags from both A and B still. That is not quite correct as well.

So I can suggest to revert this particular place to make initial change be clear NFC and I can work on
patch for above then.

What do you think ?

George.


More information about the llvm-commits mailing list