Re: [PATCH v3 3/6] modpost: Make mod_device_table aliases more unique

From
Masahiro Yamada <masahiroy@kernel.org>
Date
2025-06-06 05:11:31
Also in
linux-kbuild, lkml
Reply to
Alexey Gladkov, 2025-06-04
On Wed, Jun 4, 2025 at 8:26 PM Alexey Gladkov [off-list ref] wrote:
On Tue, Jun 03, 2025 at 01:18:25AM +0900, Masahiro Yamada wrote:
quoted
quoted
quoted
quoted
Before these patches this was not a problem as non-unique characters are
in separate object files when the module is compiled separately.

But when the modules are compiled into the kernel, there is a symbol
conflict when linking vmlinuz. We have modules that export multiple device
tables from different object files.
This is because the __mod_device_table__* symbols are global, but
I suspect they do not need to be.

Let's test this
https://lore.kernel.org/lkml/20250602105539.392362-1-masahiroy@kernel.org/T/#u (local)
I tested this patch with the config:

make allmodconfig
make mod2yesconfig

and it works.
Good.
Then, __COUNTER__ is unnecessary.
I didn't immediately notice. The patch you suggested works, but these
symbols remain in System.map and it seems in vmlinuz.
Ah, yes, if your patch set is applied.

Currently, MODULE_DEVICE_TABLE() is no-op in vmlinux.

This makes me realize that your v3 4/6
increased the vmlinux image, as MODULE_DEVICE_TABLE()
is kept for modpost.


-- 
Best Regards
Masahiro Yamada
Thread (31 messages) 31 messages, 3 authors, last reply 2025-06-09
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help