Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

vmlinux.lds.h: Add markers for text_unlikely and text_hot sections

Add markers like __hot_text_start, __hot_text_end, __unlikely_text_start,
and __unlikely_text_end which will be included in System.map. These markers
indicate how the compiler groups functions, providing valuable information
to developers about the layout and optimization of the code.

Co-developed-by: Han Shen <shenhan@google.com>
Signed-off-by: Han Shen <shenhan@google.com>
Signed-off-by: Rong Xu <xur@google.com>
Suggested-by: Sriraman Tallam <tmsriram@google.com>
Tested-by: Yonghong Song <yonghong.song@linux.dev>
Tested-by: Yabin Cui <yabinc@google.com>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Kees Cook <kees@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

authored by

Rong Xu and committed by
Masahiro Yamada
db0b2991 0043ecea

+12 -2
+12 -2
include/asm-generic/vmlinux.lds.h
··· 549 549 __cpuidle_text_end = .; \ 550 550 __noinstr_text_end = .; 551 551 552 + #define TEXT_UNLIKELY \ 553 + __unlikely_text_start = .; \ 554 + *(.text.unlikely .text.unlikely.*) \ 555 + __unlikely_text_end = .; 556 + 557 + #define TEXT_HOT \ 558 + __hot_text_start = .; \ 559 + *(.text.hot .text.hot.*) \ 560 + __hot_text_end = .; 561 + 552 562 /* 553 563 * .text section. Map to function alignment to avoid address changes 554 564 * during second ld run in second ld pass when generating System.map ··· 575 565 ALIGN_FUNCTION(); \ 576 566 *(.text.asan.* .text.tsan.*) \ 577 567 *(.text.unknown .text.unknown.*) \ 578 - *(.text.unlikely .text.unlikely.*) \ 568 + TEXT_UNLIKELY \ 579 569 . = ALIGN(PAGE_SIZE); \ 580 - *(.text.hot .text.hot.*) \ 570 + TEXT_HOT \ 581 571 *(TEXT_MAIN .text.fixup) \ 582 572 NOINSTR_TEXT \ 583 573 *(.ref.text)