[lld] [lld] Mark target section as code section when merging code sections into a data section. (PR #72030)

Jacek Caban via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 12 12:42:27 PST 2023


================
@@ -0,0 +1,57 @@
+# REQUIRES: x86
+
+# Test that merging code section into a data section changes its characteristics.
+
+# RUN: llvm-mc -triple x86_64-windows-msvc %s -filetype=obj -o %t.obj
+# RUN: lld-link -machine:amd64 -dll -noentry -out:%t.dll %t.obj -merge:.testx=.testd -merge:.testx2=.testbss
----------------
cjacek wrote:

I pushed more tests.

I noticed one more problem. To fill gaps between chunks, we memset the whole section to 0xcc. When merging uninitialized chunks into code section, it means that those chunks will not be zeroed. This is a preexisting problem, not specific to this PR, but this PR makes it a bit more widespread by marking more sections as code sections. I will take a look at that.

https://github.com/llvm/llvm-project/pull/72030


More information about the llvm-commits mailing list