[compiler-rt] r353221 - [InstrProf] Merge COFF .lprof* and .lcovmap sections into .data/.rdata

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 5 13:26:31 PST 2019


Author: rnk
Date: Tue Feb  5 13:26:31 2019
New Revision: 353221

URL: http://llvm.org/viewvc/llvm-project?rev=353221&view=rev
Log:
[InstrProf] Merge COFF .lprof* and .lcovmap sections into .data/.rdata

There is no reason for these sections to remain separate in the final
DLL or EXE.

I have not yet added a InstrProfilingPlatformWindows.c for these, since
avoiding dynamic profile data registration is a larger project for
later.

Modified:
    compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c

Modified: compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c?rev=353221&r1=353220&r2=353221&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c Tue Feb  5 13:26:31 2019
@@ -91,4 +91,13 @@ ValueProfNode *__llvm_profile_end_vnodes
 COMPILER_RT_VISIBILITY ValueProfNode *CurrentVNode = 0;
 COMPILER_RT_VISIBILITY ValueProfNode *EndVNode = 0;
 
+#if defined(_WIN32)
+// Put read-write sections in .data.
+#pragma comment(linker, "/MERGE:.lprfc=.data")
+#pragma comment(linker, "/MERGE:.lprfd=.data")
+// Put read-write sections in .rdata.
+#pragma comment(linker, "/MERGE:.lcovmap=.rdata")
+#pragma comment(linker, "/MERGE:.lprfn=.rdata")
+#endif
+
 #endif




More information about the llvm-commits mailing list