Global variables might declare themselves to be in explicit sections.
Calculate the entity size always to prevent assembler warnings
"entity size for SHF_MERGE not specified" when sections are to be
marked merge-able.
Fixes PR31828.
Differential D53056
[MC][ELF] compute entity size for explicit sections nickdesaulniers on Oct 9 2018, 5:25 PM. Authored by
Details Global variables might declare themselves to be in explicit sections. Fixes PR31828.
Diff Detail
Event TimelineComment Actions This seems to be failing for other arch's: http://lab.llvm.org:8011/builders/clang-cmake-armv7-quick/builds/4325/steps/ninja%20check%201/logs/FAIL%3A%20LLVM%3A%3Asection_mergeable_size.ll @rnk , does the CHECK need to match the full line, or is the .text appearing in the test cases problematic? Comment Actions Looks like the test fails on MacOS: http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/54057/console Error message: LLVM ERROR: Global variable 'a' has an invalid section specifier '.init.rodata': mach-o section specifier requires a segment and section separated by a comma. Not sure how to work around this, short of making it target specific? Comment Actions Thanks for the report, and sorry for adding a red test on OSX. The name of the section is not the important part (it could be called "foo") of the test, just that it have a custom section. The IR from the test is from real code from the Linux kernel. If the format from the error a segment and section separated by a comma is valid on Linux, then that should be fine. But I guess then this issue pops up again for Windows, or anywhere else that doesn't use ELF? So this probably should be made into an ELF only test. I'll look into how to do that, but appreciate any tips. Comment Actions I should probably remove my added test file, and merge the test case into test/MC/ELF/entsize.ll. |