linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] alloc_tag: remove empty module tag section from
@ 2025-06-05 19:01 Casey Chen
  2025-06-05 19:01 ` [PATCH 1/1] alloc_tag: remove empty module tag section from linker script Casey Chen
  0 siblings, 1 reply; 5+ messages in thread
From: Casey Chen @ 2025-06-05 19:01 UTC (permalink / raw)
  To: linux-mm, surenb, kent.overstreet; +Cc: yzhong, cachen

We found gdb misinterpret symbol addresses e.g., __ib_process_cq from
ib_core.ko:
  (gdb) disas __ib_process_cq
  Dump of assembler code for function trace_event_fields_cq_schedule:
  ...

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

The module tag section added by the empty MOD_CODETAG_SECTIONS() macro looks
suspicious. With and without the fix, .data section placement looks different:

Without the fix, .data is placed at 0x300:
  Section Headers:
    [Nr] Name              Type             Address           Offset
         Size              EntSize          Flags  Link  Info  Align
    ...
    [51] .data             PROGBITS         0000000000000300  0004a180
         0000000000004a20  0000000000000000  WA       0     0     32

With the fix, .data is placed at 0x0:
    [48] .data             PROGBITS         0000000000000000  00049d20
         0000000000004a20  0000000000000000  WA       0     0     32

My gcc/ld/gdb versions are as below.
  $ gcc --version
  gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0

  $ ld --version
  GNU ld (GNU Binutils for Ubuntu) 2.38

  $ gdb --version
  GNU gdb (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1

Does anybody have an idea how the misinterpretation happens ? Also I don't
understand the use of MOD_CODETAG_SECTIONS() very well. I am thinking it is
for some future use to have module tags whose lifespan is same as the module.
It is empty and shouldn't cause any issue.

Casey Chen (1):
  alloc_tag: remove empty module tag section from linker script

 scripts/module.lds.S | 5 -----
 1 file changed, 5 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-06-09 22:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-05 19:01 [PATCH 0/1] alloc_tag: remove empty module tag section from Casey Chen
2025-06-05 19:01 ` [PATCH 1/1] alloc_tag: remove empty module tag section from linker script Casey Chen
2025-06-05 20:07   ` Suren Baghdasaryan
2025-06-09 21:15     ` Casey Chen
2025-06-09 22:55       ` Suren Baghdasaryan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox