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

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 19 08:48:32 PST 2018


peter.smith added a comment.

I agree with James here. I strongly suspect that in systems where merging content is a problem such as embedded systems with overlays or only a subset of memory available for booting there may be little correlation between the input section names chosen by the compiler and that given to the output section.

The only thing I can think of right now that doesn't involve an early assignment of input sections to output sections is to exploit the Repl field. When assigning InputSections to OutputSections then try and match the non-live sections against the InputSection Descriptions. If matches a different OutputSection to the InputSection it was folded into then mark it live and assign it to an OutputSection.

As an aside the approach outlined in https://llvm.org/devmtg/2017-10/slides/LTOLinkerScriptsEdlerVonKoch.pdf seems to favour an early assignment of InputSections to OutputSections I've not seen much movement on getting that upstream since the RFC at http://lists.llvm.org/pipermail/llvm-dev/2018-May/123252.html though.


https://reviews.llvm.org/D54422





More information about the llvm-commits mailing list