Re: [PATCH v2 3/6] Change the symbols order when --ffuntion-sections is enabled

2024-10-03 Thread Rong Xu
In principle, I don't see a problem using the new order unconditionally. This new ordering of sections (.text.unlikely, .text.hot, then .text) differs from the typical user-space ordering when no link-script is used. Usually, the order is .text, .text.hot, and then .text.unlikely (when -z keep-tex

Re: [PATCH v2 3/6] Change the symbols order when --ffuntion-sections is enabled

2024-10-03 Thread Peter Zijlstra
On Wed, Oct 02, 2024 at 04:34:02PM -0700, Rong Xu wrote: > When the -ffunction-sections compiler option is enabled, each function > is placed in a separate section named .text.function_name rather than > putting all functions in a single .text section. > > However, using -function-sections can cau

[PATCH v2 3/6] Change the symbols order when --ffuntion-sections is enabled

2024-10-02 Thread Rong Xu
When the -ffunction-sections compiler option is enabled, each function is placed in a separate section named .text.function_name rather than putting all functions in a single .text section. However, using -function-sections can cause problems with the linker script. The comments included in includ