[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220904214134.408619-55-jim.cromie@gmail.com>
Date: Sun, 4 Sep 2022 15:41:31 -0600
From: Jim Cromie <jim.cromie@...il.com>
To: jbaron@...mai.com, gregkh@...uxfoundation.org,
dri-devel@...ts.freedesktop.org, amd-gfx@...ts.freedesktop.org,
intel-gvt-dev@...ts.freedesktop.org,
intel-gfx@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Cc: daniel.vetter@...ll.ch, seanpaul@...omium.org, robdclark@...il.com,
linux@...musvillemoes.dk, joe@...ches.com,
Jim Cromie <jim.cromie@...il.com>
Subject: [PATCH v6 54/57] dyndbg: add .gnu.linkonce. & __dyndbg* sections in module.lds.h
For a long time now, loadable modules have tacitly linked the __dyndbg
section into the .ko, as is observable in dmesg by enabling module.c's
pr_debugs and loading a module. Recently, __dyndbg_sites was added,
following the original model.
But now, we need to explicitly name those (__dyndbg, __dyndbg_sites)
sections in order to place new .gnu.linkonce.dyndbg* sections in front
of them.
This gives us the properties we need for _ddebug_map_site() to drop
the _ddebug.site pointer:
fixed offset from &__dyndbg[N] to &__dyndbg[0]
container_of gets &header
header has ptr to __dyndbg_sites[]
__dyndbg_sites[_map] gives de-duplicated site recs
NOTE
HEAD~1 took headers off front of descs,sites and saved them into
_ddebug_info, this puts the gnu.linkonce.* records into those vectors.
Signed-off-by: Jim Cromie <jim.cromie@...il.com>
---
include/asm-generic/module.lds.h | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/include/asm-generic/module.lds.h b/include/asm-generic/module.lds.h
index f210d5c1b78b..328c48dfc88c 100644
--- a/include/asm-generic/module.lds.h
+++ b/include/asm-generic/module.lds.h
@@ -4,7 +4,17 @@
/*
* <asm/module.lds.h> can specify arch-specific sections for linking modules.
- * Empty for the asm-generic header.
+ *
+ * For loadable modules with CONFIG_DYNAMIC_DEBUG, we need to keep the
+ * 2 __dyndbg* ELF sections, which are loaded by module.c
+ *
+ * Pack the 2 __dyndbg* input sections with their respective
+ * .gnu.linkonce. header records into 2 output sections, with those
+ * header records in the 0th element.
*/
+SECTIONS {
+__dyndbg_sites : ALIGN(8) { *(.gnu.linkonce.dyndbg_site) *(__dyndbg_sites) }
+__dyndbg : ALIGN(8) { *(.gnu.linkonce.dyndbg) *(__dyndbg) }
+}
#endif /* __ASM_GENERIC_MODULE_LDS_H */
--
2.37.2
Powered by blists - more mailing lists