[PATCH] D45080: [ELF] - Provide a hint about --no-check-sections

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 3 07:15:51 PDT 2018


grimar added a comment.

In https://reviews.llvm.org/D45080#1054585, @ruiu wrote:

> > In this message, I am saying "if you need overlays". That suggests that user *need* it. It is for cases like PR36768. LLD does not support OVERLAYS, though it is a possible legal thing to do.
>
> As I said, if you show something, it suggests users do it even if the hint message comes with a footnote. You cannot really trust all users to understand what "if you need overlays" means. I think you can easily imagine that a user seeing that error message blindly adds that option to "fix" the problem. Unlike you, users are not linker experts, and our hint messages must be relevant to most users, or otherwise it could do harm than good.
>
> Say, do you think that a half of the users who saw this hint message actually need `--no-check-sections`? I honestly don't think so. I cannot even imagine that 10% users who saw this error message have needed `--no-check-sections` because it is hard to imagine that you want to intentionally create overlapped sections.


I generally find it difficult to imagine a user who sees this error honestly. If you write straightforward linker scripts without moving location counter backwards,
I guess such an error is either impossible or means we have a bug in linker. If you don't then most probably you write some kernel script and should know what you do :) 
What is the difference with the "pass '-Wl,-z,notext' to allow text relocations in the output" hint we provide, btw? It is also can be an error, though we hint here.

I think the main use case we really want to think about is a case when somebody tries to switch from bfd to LLD. In this case, providing such a hint would help this user
to resolve the issue. It is user-friendly. First of all, the issue happens because we are incompatible with tools that users used for decades and forcing them to search
in the web or read help about all options we support to make things just work again is not a great experience.

There is a discussion in PR36768's comments about the new option for allowing overlays.
With that, "--no-check-sections" hint for all kind of overlaps will not make sense. 
We might add a just hint for VA overlaps specific to OVERLAY feature only then.


https://reviews.llvm.org/D45080





More information about the llvm-commits mailing list