[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:19:28 PDT 2018


grimar added a comment.

In https://reviews.llvm.org/D45841#1073829, @tmsriram wrote:

> I was thinking a lot more about this and playing with it.  Two things:
>
> - This patch will break symbol-ordering-file for symbols that are in two different output sections.
> - This patch could also affect linker scripts which assume all .text is in the same output section.
>
>   Given this, I believe it might be better to not change the default behavior and have this feature under a flag, just like what gold does.  What do you think?


I do not think linker scripts is a problem probably. When you write a script, you usually explicitly say where to put the sections,
so if script wants all `.text*` to be in a single section it just do `.text : { *(.text) }` and I think this is what scripts usually do.
If they don't, then there will be multiple `.text` sections, but I am not sure it is correct for the script to assume that case without listing the output section `.text`.

For symbol-ordering-file, disabling the feature looks like a solution.

But actually following the gold behaviour (so to have the feature under the flag and do not change the default) looks good to me for start, as it is safe and can
easily be switched.


https://reviews.llvm.org/D45841





More information about the llvm-commits mailing list