Re: Link modules to DYN type

2023-05-04 Thread Zhenlei Huang
> On Apr 28, 2023, at 12:32 AM, Zhenlei Huang wrote: > > > >> On Apr 26, 2023, at 7:12 PM, Konstantin Belousov > > wrote: >> >> On Wed, Apr 26, 2023 at 12:55:02PM +0200, Hans Petter Selasky wrote: >>> On 4/26/23 12:36, Zhenlei Huang wrote: Hi, I'm

Re: Link modules to DYN type

2023-04-27 Thread Zhenlei Huang
> On Apr 26, 2023, at 7:12 PM, Konstantin Belousov wrote: > > On Wed, Apr 26, 2023 at 12:55:02PM +0200, Hans Petter Selasky wrote: >> On 4/26/23 12:36, Zhenlei Huang wrote: >>> Hi, >>> >>> I'm recently working on https://reviews.freebsd.org/D39638 (sysctl(9): >>> Enable vnet sysctl variables

Re: Link modules to DYN type

2023-04-26 Thread Jan Martin Mikkelsen
> On 26. Apr 2023, at 13:38, Hans Petter Selasky wrote: > > On 4/26/23 13:12, Konstantin Belousov wrote: >> No, in-kernel linker does not behave this way. >> Modules need to contain explicit reference to all modules they depend upon, >> using the MODULE_DEPEND() macro. Only symbols from the

Re: Link modules to DYN type

2023-04-26 Thread Konstantin Belousov
On Wed, Apr 26, 2023 at 01:38:32PM +0200, Hans Petter Selasky wrote: > On 4/26/23 13:12, Konstantin Belousov wrote: > > No, in-kernel linker does not behave this way. > > Modules need to contain explicit reference to all modules they depend upon, > > using the MODULE_DEPEND() macro. Only symbols

Re: Link modules to DYN type

2023-04-26 Thread Hans Petter Selasky
On 4/26/23 13:12, Konstantin Belousov wrote: No, in-kernel linker does not behave this way. Modules need to contain explicit reference to all modules they depend upon, using the MODULE_DEPEND() macro. Only symbols from the dependencies are resolved. All modules get an implicit reference to

Re: Link modules to DYN type

2023-04-26 Thread Konstantin Belousov
On Wed, Apr 26, 2023 at 12:55:02PM +0200, Hans Petter Selasky wrote: > On 4/26/23 12:36, Zhenlei Huang wrote: > > Hi, > > > > I'm recently working on https://reviews.freebsd.org/D39638 (sysctl(9): > > Enable vnet sysctl variables be loader tunable), > > the changes to `sys/kern/link_elf_obj.c`

Re: Link modules to DYN type

2023-04-26 Thread Hans Petter Selasky
On 4/26/23 12:36, Zhenlei Huang wrote: Hi, I'm recently working on https://reviews.freebsd.org/D39638 (sysctl(9): Enable vnet sysctl variables be loader tunable), the changes to `sys/kern/link_elf_obj.c` are runtime tested, but not those to `sys/kern/link_elf.c` . After some hacking I

Link modules to DYN type

2023-04-26 Thread Zhenlei Huang
Hi, I'm recently working on https://reviews.freebsd.org/D39638 (sysctl(9): Enable vnet sysctl variables be loader tunable), the changes to `sys/kern/link_elf_obj.c` are runtime tested, but not those to `sys/kern/link_elf.c` . After some hacking I realized that `link_elf.c` is for EXEC