linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Casey Chen <cachen@purestorage.com>
To: linux-mm@kvack.org, surenb@google.com, kent.overstreet@linux.dev
Cc: yzhong@purestorage.com, cachen@purestorage.com
Subject: [PATCH 1/1] alloc_tag: remove empty module tag section from linker script
Date: Thu,  5 Jun 2025 13:01:28 -0600	[thread overview]
Message-ID: <20250605190128.2287011-2-cachen@purestorage.com> (raw)
In-Reply-To: <20250605190128.2287011-1-cachen@purestorage.com>

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.

Fixes: 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>
---
 scripts/module.lds.S | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/scripts/module.lds.S b/scripts/module.lds.S
index 711c6e029936..c071ca4beedd 100644
--- a/scripts/module.lds.S
+++ b/scripts/module.lds.S
@@ -50,17 +50,12 @@ SECTIONS {
 	.data : {
 		*(.data .data.[0-9a-zA-Z_]*)
 		*(.data..L*)
-		MOD_CODETAG_SECTIONS()
 	}
 
 	.rodata : {
 		*(.rodata .rodata.[0-9a-zA-Z_]*)
 		*(.rodata..L*)
 	}
-#else
-	.data : {
-		MOD_CODETAG_SECTIONS()
-	}
 #endif
 	MOD_SEPARATE_CODETAG_SECTIONS()
 }
-- 
2.34.1



  reply	other threads:[~2025-06-05 19:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-05 19:01 [PATCH 0/1] alloc_tag: remove empty module tag section from Casey Chen
2025-06-05 19:01 ` Casey Chen [this message]
2025-06-05 20:07   ` [PATCH 1/1] alloc_tag: remove empty module tag section from linker script Suren Baghdasaryan
2025-06-09 21:15     ` Casey Chen
2025-06-09 22:55       ` Suren Baghdasaryan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250605190128.2287011-2-cachen@purestorage.com \
    --to=cachen@purestorage.com \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-mm@kvack.org \
    --cc=surenb@google.com \
    --cc=yzhong@purestorage.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox