[lld] [ELF] Orphan placement: remove hasInputSections condition (PR #93761)
Igor Kudrin via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 10 17:42:38 PDT 2024
igorkudrin wrote:
> OK, your argument is that .other (`hasInputSection==false`) might be A or AX and you would prefer that an orphan is not placed after it.
Not exactly. The output section '.other' could be `AX` (`hasInputSection==true`) or `A` (`hasInputSection==false`), which could trigger different placement of orphans, which in turn could surprise a developer. I wouldn't mind if its flags were the same regardless of whether it has input sections.
I prefer to follow [the principle of least astonishment](https://en.wikipedia.org/wiki/Principle_of_least_astonishment) here.
> I think both arguments are reasonable and no one is significantly better than the other. I believe we should follow Occam's razor and make the simplification... It's useful to make the rules easier to explain.
I agree. Which explanations for these two cases do you think of?
https://github.com/llvm/llvm-project/pull/93761
More information about the llvm-commits
mailing list