[lld] [lld][COFF] Fill only gaps in code sections. (PR #72138)
Jacek Caban via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 14 11:49:03 PST 2023
================
@@ -2021,8 +2021,16 @@ void Writer::writeSections() {
// instead of leaving as NUL bytes (which can be interpreted as
// ADD instructions).
if ((sec->header.Characteristics & IMAGE_SCN_CNT_CODE) &&
- (ctx.config.machine == AMD64 || ctx.config.machine == I386))
- memset(secBuf, 0xCC, sec->getRawSize());
+ (ctx.config.machine == AMD64 || ctx.config.machine == I386)) {
+ uint32_t prevEnd = 0;
+ for (Chunk *c : sec->chunks) {
----------------
cjacek wrote:
Done, thanks!
https://github.com/llvm/llvm-project/pull/72138
More information about the llvm-commits
mailing list