Messages in this thread Patch in this message | | | From | Jim Cromie <> | Subject | [RFC PATCH v4 19/19] dyndbg: RFC add linker rules to module.lds.h | Date | Wed, 17 Mar 2021 00:54:12 -0600 |
| |
Copy the DYNAMIC_DEBUG_DATA macro, that works in vmlinux.lds.h, into module.lds.h This does not work here
The point of the KEEPS is to pack section pairs into consecutive memory, a property we need in order to drop the _ddebug.site pointer.
The problem (ISTM) is that for linking vmlinux, the data is linked into .data (and the sections are subsumed), and it is is accessed by iterating beteween __(fstart|stop)___dyndbg(_sites)? symbols. That breaks down here cuz kernel/module.c specifically grabs the __dyndb* sections by name.
I lack the linker-fu to sort this, so I left my commented out attempts, to show my errors.
no-bisect: expect linker error Signed-off-by: Jim Cromie <jim.cromie@gmail.com> --- include/asm-generic/module.lds.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/include/asm-generic/module.lds.h b/include/asm-generic/module.lds.h index f210d5c1b78b..0074c5f2421b 100644 --- a/include/asm-generic/module.lds.h +++ b/include/asm-generic/module.lds.h @@ -7,4 +7,25 @@ * Empty for the asm-generic header. */ +/* implement dynamic printk debug section packing */ +#if defined(CONFIG_DYNAMIC_DEBUG) || \ + (defined(CONFIG_DYNAMIC_DEBUG_CORE) \ + && defined(DYNAMIC_DEBUG_MODULE)) +#define DYNAMIC_DEBUG_DATA() \ + . = ALIGN(8); \ + KEEP(*(__dyndbg_sites .gnu.linkonce.dyndbg_site)) \ + KEEP(*(__dyndbg .gnu.linkonce.dyndbg)) +#else +#define DYNAMIC_DEBUG_DATA() +#endif + +SECTIONS { +__dyndbg : { (*(__dyndbg .gnu.linkonce.dyndbg)) } +__dyndbg_sites : { (*(__dyndbg_sites .gnu.linkonce.dyndbg_site)) } + + //.data.dyndbg : { DYNAMIC_DEBUG_DATA() } // syntax ok + //: { DYNAMIC_DEBUG_DATA() } + //DYNAMIC_DEBUG_DATA() +} + #endif /* __ASM_GENERIC_MODULE_LDS_H */ -- 2.29.2
| |