[PATCH] D48924: [ELF] - Prevent relocation overflow against .bss in some cases.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 6 01:13:19 PDT 2018


grimar added a comment.

In https://reviews.llvm.org/D48924#1153414, @ruiu wrote:

> I doubt if the benefit of this patch exceeds the increased complexity. Isn't this a corner case where no one can really say this is a bug?


GNU linkers have no problems with supporting that. If the user wants to create a large common symbol, why not?
It is an unlucky specific of our implementation that we create "COMMON" input sections out of order in the first place. 
If we would create sections in the same order as objects are specified in the command line, we would not have this issue.

Isn't another our patches that try to workaround possible relocations overflow do something the same (reordering the sections)?

> Can't you simply fix your linker script instead of lld?

There is no linker script used in the initial PR.


https://reviews.llvm.org/D48924





More information about the llvm-commits mailing list