Linux Modules
 help / color / mirror / Atom feed
* [PATCH] module: Remove unused DISCARD_EH_FRAME definition from module.lds.S
@ 2026-06-12 13:38 Petr Pavlu
  2026-06-17 19:29 ` Sami Tolvanen
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Pavlu @ 2026-06-12 13:38 UTC (permalink / raw)
  To: Luis Chamberlain, Petr Pavlu, Daniel Gomez, Sami Tolvanen
  Cc: Aaron Tomlin, Ard Biesheuvel, linux-modules, linux-kernel

The linker script scripts/module.lds.S contains an unused DISCARD_EH_FRAME
definition introduced by commit 68c76ad4a957 ("arm64: unwind: add
asynchronous unwind tables to kernel and modules").

As shown in an earlier version of that patch [1], DISCARD_EH_FRAME was
meant to be used by SANITIZER_DISCARDS in the same file, as follows:

-# define SANITIZER_DISCARDS	*(.eh_frame)
+# define SANITIZER_DISCARDS	DISCARD_EH_FRAME

However, in the meantime, SANITIZER_DISCARDS was removed entirely from
module.lds.S by commit 89245600941e ("cfi: Switch to -fsanitize=kcfi").
Eventually, the mentioned commit 68c76ad4a957 only added the new
DISCARD_EH_FRAME definition to this file without actually using it.

The file include/asm-generic/vmlinux.lds.h contains a similar
DISCARD_EH_FRAME definition for vmlinux to discard .eh_frame sections that
may be present when CONFIG_GCOV_KERNEL, CONFIG_KASAN_GENERIC or
CONFIG_KCSAN is enabled. Testing these options on arm64 with LLVM 19.1 did
not show any unexpected .eh_frame sections in modules.

Remove the unused DISCARD_EH_FRAME definition from scripts/module.lds.S.

Link: https://lore.kernel.org/linux-arm-kernel/20220701152724.3343599-2-ardb@kernel.org/ [1]
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
---
 scripts/module.lds.S | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/scripts/module.lds.S b/scripts/module.lds.S
index b62683061d79..d0f200428957 100644
--- a/scripts/module.lds.S
+++ b/scripts/module.lds.S
@@ -3,11 +3,6 @@
  * Archs are free to supply their own linker scripts.  ld will
  * combine them automatically.
  */
-#ifdef CONFIG_UNWIND_TABLES
-#define DISCARD_EH_FRAME
-#else
-#define DISCARD_EH_FRAME	*(.eh_frame)
-#endif
 
 #include <asm-generic/codetag.lds.h>
 

base-commit: 4549871118cf616eecdd2d939f78e3b9e1dddc48
-- 
2.54.0


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

* Re: [PATCH] module: Remove unused DISCARD_EH_FRAME definition from module.lds.S
  2026-06-12 13:38 [PATCH] module: Remove unused DISCARD_EH_FRAME definition from module.lds.S Petr Pavlu
@ 2026-06-17 19:29 ` Sami Tolvanen
  2026-07-09  8:49   ` Petr Pavlu
  0 siblings, 1 reply; 3+ messages in thread
From: Sami Tolvanen @ 2026-06-17 19:29 UTC (permalink / raw)
  To: Petr Pavlu
  Cc: Luis Chamberlain, Daniel Gomez, Aaron Tomlin, Ard Biesheuvel,
	linux-modules, linux-kernel

On Fri, Jun 12, 2026 at 6:40 AM Petr Pavlu <petr.pavlu@suse.com> wrote:
>
> The linker script scripts/module.lds.S contains an unused DISCARD_EH_FRAME
> definition introduced by commit 68c76ad4a957 ("arm64: unwind: add
> asynchronous unwind tables to kernel and modules").
>
> As shown in an earlier version of that patch [1], DISCARD_EH_FRAME was
> meant to be used by SANITIZER_DISCARDS in the same file, as follows:
>
> -# define SANITIZER_DISCARDS    *(.eh_frame)
> +# define SANITIZER_DISCARDS    DISCARD_EH_FRAME
>
> However, in the meantime, SANITIZER_DISCARDS was removed entirely from
> module.lds.S by commit 89245600941e ("cfi: Switch to -fsanitize=kcfi").
> Eventually, the mentioned commit 68c76ad4a957 only added the new
> DISCARD_EH_FRAME definition to this file without actually using it.
>
> The file include/asm-generic/vmlinux.lds.h contains a similar
> DISCARD_EH_FRAME definition for vmlinux to discard .eh_frame sections that
> may be present when CONFIG_GCOV_KERNEL, CONFIG_KASAN_GENERIC or
> CONFIG_KCSAN is enabled. Testing these options on arm64 with LLVM 19.1 did
> not show any unexpected .eh_frame sections in modules.
>
> Remove the unused DISCARD_EH_FRAME definition from scripts/module.lds.S.
>
> Link: https://lore.kernel.org/linux-arm-kernel/20220701152724.3343599-2-ardb@kernel.org/ [1]
> Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>

Reviewed-by: Sami Tolvanen <samitolvanen@google.com>

Sami

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

* Re: [PATCH] module: Remove unused DISCARD_EH_FRAME definition from module.lds.S
  2026-06-17 19:29 ` Sami Tolvanen
@ 2026-07-09  8:49   ` Petr Pavlu
  0 siblings, 0 replies; 3+ messages in thread
From: Petr Pavlu @ 2026-07-09  8:49 UTC (permalink / raw)
  To: Sami Tolvanen
  Cc: Luis Chamberlain, Daniel Gomez, Aaron Tomlin, Ard Biesheuvel,
	linux-modules, linux-kernel

On 6/17/26 9:29 PM, Sami Tolvanen wrote:
> On Fri, Jun 12, 2026 at 6:40 AM Petr Pavlu <petr.pavlu@suse.com> wrote:
>>
>> The linker script scripts/module.lds.S contains an unused DISCARD_EH_FRAME
>> definition introduced by commit 68c76ad4a957 ("arm64: unwind: add
>> asynchronous unwind tables to kernel and modules").
>>
>> As shown in an earlier version of that patch [1], DISCARD_EH_FRAME was
>> meant to be used by SANITIZER_DISCARDS in the same file, as follows:
>>
>> -# define SANITIZER_DISCARDS    *(.eh_frame)
>> +# define SANITIZER_DISCARDS    DISCARD_EH_FRAME
>>
>> However, in the meantime, SANITIZER_DISCARDS was removed entirely from
>> module.lds.S by commit 89245600941e ("cfi: Switch to -fsanitize=kcfi").
>> Eventually, the mentioned commit 68c76ad4a957 only added the new
>> DISCARD_EH_FRAME definition to this file without actually using it.
>>
>> The file include/asm-generic/vmlinux.lds.h contains a similar
>> DISCARD_EH_FRAME definition for vmlinux to discard .eh_frame sections that
>> may be present when CONFIG_GCOV_KERNEL, CONFIG_KASAN_GENERIC or
>> CONFIG_KCSAN is enabled. Testing these options on arm64 with LLVM 19.1 did
>> not show any unexpected .eh_frame sections in modules.
>>
>> Remove the unused DISCARD_EH_FRAME definition from scripts/module.lds.S.
>>
>> Link: https://lore.kernel.org/linux-arm-kernel/20220701152724.3343599-2-ardb@kernel.org/ [1]
>> Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
> 
> Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Thanks, queued on modules-next for v7.3-rc1.

-- Petr

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

end of thread, other threads:[~2026-07-09  8:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-12 13:38 [PATCH] module: Remove unused DISCARD_EH_FRAME definition from module.lds.S Petr Pavlu
2026-06-17 19:29 ` Sami Tolvanen
2026-07-09  8:49   ` Petr Pavlu

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