[PATCH] D45841: Keep the output text sections with prefixes ".text.hot" , ".text.unlikely", ".text.startup", ".text.exit" separate

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 23 03:06:45 PDT 2018


grimar added a comment.

I think this is OK, but since it changes the traditional legacy "GNU" linkers behavior, don't we want a flag to disable that?
Since gold has a flag, we will need to support it anyways I think, so we probably should have -no-<something>/-<something> flags,
matching the gold ones and just a different default value.



================
Comment at: ELF/Writer.cpp:107
   for (StringRef V :
-       {".text.", ".rodata.", ".data.rel.ro.", ".data.", ".bss.rel.ro.",
+       {".text.hot.", ".text.unlikely.", ".text.startup.", ".text.exit.",
+        ".text.", ".rodata.", ".data.rel.ro.", ".data.", ".bss.rel.ro.",
----------------
This needs a comment I think.


================
Comment at: test/ELF/text-section-prefix.s:12
+
+.globl _start, f, f_hot, f_startup, f_exit, f_unlikely
+_start:
----------------
You do not need symbols, no? Just having different .text.* sections should be enough for this test case.


https://reviews.llvm.org/D45841





More information about the llvm-commits mailing list