[PATCH] D37574: [ELF] - Do not merge sections from SHT_GROUP when -relocatable

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 8 03:55:25 PDT 2017


grimar added a comment.

In https://reviews.llvm.org/D37574#863756, @ruiu wrote:

> This does not seems like a correct fix. Why do we merge sections in the first place? If we don't do that for -r, it shouldn't have been the issue, no?


What is intention of relocatable link and why it is called "partial linking" ? As far I understand intention is to speedup final link.
When we have multiple `.text` sections for example, then relocatable link merge them by name to output `.text`. Merging of sections helps to reduce amount of
input sections for latter final link.  We also merge SHT_REL[A] sections when doing that, it should probably help to speedup futher relocation processing as well.
As a last resort is also consistent with GNU linkers, it may be dangerous to deviate without solid reason as all kind of tools may rely on this behavior.


https://reviews.llvm.org/D37574





More information about the llvm-commits mailing list