[PATCH] D54422: [ELF] - Do not ICF two sections with different output sections when using linker scripts

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 19 07:46:15 PST 2018


jhenderson added a comment.

In https://reviews.llvm.org/D54422#1296590, @ruiu wrote:

> I don't think this is necessarily a bug.  At least, "predicating" the name of an output section does not seems a good idea to me. It is getting too tricky, and I don't like to add more complexity here. I generally do not encourage users use linker scripts as it makes linking slower and trickier, and it is to me an acceptable consequence that ICF folds input sections before linker scripts bin input sections to output sections.


I agree that prediction seems like the wrong approach, unless we can guarantee 100% accuracy (prediction implies that it isn't always accurate). However, @ruiu, whilst you may not encourage users to use linker scripts, they are widely used, and in some instances, potentially even many, there is no reasonable alternative. ICF folding input sections between output sections can result in invalid output, especially if those output sections are supposed to be in different program segments, which could result in runtime crashes. I therefore would consider any such incorrect assignment a bug in LLD.


https://reviews.llvm.org/D54422





More information about the llvm-commits mailing list