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.

alloc_tag: remove empty module tag section

The empty MOD_CODETAG_SECTIONS() macro added an incomplete .data section
in module linker script, which caused symbol lookup tools like gdb to
misinterpret symbol addresses e.g., __ib_process_cq incorrectly mapping to
unrelated functions like below.

(gdb) disas __ib_process_cq
Dump of assembler code for function trace_event_fields_cq_schedule:

Removing the empty section restores proper symbol resolution and layout,
ensuring .data placement behaves as expected.

Link: https://lkml.kernel.org/r/20250610162258.324645-1-cachen@purestorage.com
Fixes: 0db6f8d7820a ("alloc_tag: load module tags into separate contiguous memory")
22d407b164ff ("lib: add allocation tagging support for memory allocation profiling")
Signed-off-by: Casey Chen <cachen@purestorage.com>
Reviewed-by: Yuanyuan Zhong <yzhong@purestorage.com>
Acked-by: Suren Baghdasaryan <surenb@google.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Luis Chamberalin <mcgrof@kernel.org>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Casey Chen and committed by
Andrew Morton
7e43195c 38b0ece6

-11
-6
include/asm-generic/codetag.lds.h
··· 11 11 #define CODETAG_SECTIONS() \ 12 12 SECTION_WITH_BOUNDARIES(alloc_tags) 13 13 14 - /* 15 - * Module codetags which aren't used after module unload, therefore have the 16 - * same lifespan as the module and can be safely unloaded with the module. 17 - */ 18 - #define MOD_CODETAG_SECTIONS() 19 - 20 14 #define MOD_SEPARATE_CODETAG_SECTION(_name) \ 21 15 .codetag.##_name : { \ 22 16 SECTION_WITH_BOUNDARIES(_name) \
-5
scripts/module.lds.S
··· 52 52 .data : { 53 53 *(.data .data.[0-9a-zA-Z_]*) 54 54 *(.data..L*) 55 - MOD_CODETAG_SECTIONS() 56 55 } 57 56 58 57 .rodata : { 59 58 *(.rodata .rodata.[0-9a-zA-Z_]*) 60 59 *(.rodata..L*) 61 - } 62 - #else 63 - .data : { 64 - MOD_CODETAG_SECTIONS() 65 60 } 66 61 #endif 67 62 MOD_SEPARATE_CODETAG_SECTIONS()