diff options
author | Fangrui Song <maskray@google.com> | 2020-08-25 13:37:29 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2020-08-25 13:37:29 -0700 |
commit | 82d0749749fafb0303414131dc570781376fdcfb (patch) | |
tree | a5bca539394e632c8e9d820b60b04961d36e4b81 /clang/lib/Lex/ModuleMap.cpp | |
parent | 514d6e9a8d91e739292c9024d677b8d3c6d43f0c (diff) | |
download | llvm-82d0749749fafb0303414131dc570781376fdcfb.zip llvm-82d0749749fafb0303414131dc570781376fdcfb.tar.gz llvm-82d0749749fafb0303414131dc570781376fdcfb.tar.bz2 |
[TargetLoweringObjectFileImpl] Make .llvmbc and .llvmcmd non-SHF_ALLOC
There are two ways .llvmbc can be produced:
* clang -c -fembed-bitcode=all (which also produces .llvmcmd)
* LTO backend: ld.lld -mllvm -lto-embed-bitcode or -plugin-opt=-lto-embed-bitcode
.llvmbc and .llvmcmd have the SHF_ALLOC flag, so they can be dropped by
--gc-sections.
This patch sets SectionKind::Metadata to drop the SHF_ALLOC flag. This
is conceptually correct: the two sections are not part of the process
image, so SHF_ALLOC is not appropriate.
`test/LTO/X86/embed-bitcode.ll`: changed `llvm-objcopy -O binary --only-section` to
`llvm-objcopy --dump-section`. `-O binary` does not dump non-SHF_ALLOC sections.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D86374
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
0 files changed, 0 insertions, 0 deletions