[ELF] Name MergeSyntheticSection using an input section instead of the output section
authorFangrui Song <i@maskray.me>
Tue, 2 May 2023 16:35:00 +0000 (09:35 -0700)
committerFangrui Song <i@maskray.me>
Tue, 2 May 2023 16:35:00 +0000 (09:35 -0700)
commit1408504564f2ecc6020eb1b2735d441b3292ea27
tree6bba5d449647fda87fc4d7579c7298fd6eb26434
parent009c053e3f822d0df556c6b39f632e31594373de
[ELF] Name MergeSyntheticSection using an input section instead of the output section

In a link map, the input section name gives more information. See the updated
merge-entsize.s for an example. The output file is unchanged.

Compiler generated input sections with the SHF_MERGE flag have names such as
.rodata.str1.1 and .rodata.cstN, and are not affected by -fdata-sections.

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D149466
lld/ELF/OutputSections.cpp
lld/test/ELF/merge-entsize.s
lld/test/ELF/merge-string-align.s