FIX: accessing module's virtualized global variables from another module

Mikolaj Golub trociny at freebsd.org
Mon Jul 25 20:46:53 UTC 2011


On Sun, 24 Jul 2011 18:11:14 +0300 Kostik Belousov wrote:

 KB> On Sun, Jul 24, 2011 at 11:02:21AM +0300, Mikolaj Golub wrote:
 >> Also, could someone explain what is kern/link_elf_obj.c for? The patch does
 >> not deal with this file, but I see the reloactions here similar to those in
 >> link_elf.c. So I might need to do similar modifiactions in link_elf_obj.c too,
 >> but I don't know where this code is used (it looks like it is not executed on
 >> my box, so I don't know how to test it).

 KB> The link_elf_obj is a linker for architectures that use object file format
 KB> for the modules. So far, the list consists only of amd64.

Thanks! And there is no need in hacks with relocations in this case: in
link_elf_load_file() it just allocates space in kernel 'set_vnet' set for
'set_vnet' from the module and sets addr to point to this space.

As the fix appears to be link_elf.c specific and the code is used only in this
file I have modified the patch placing set_vnet list and its functions in
link_elf.c.

-- 
Mikolaj Golub

-------------- next part --------------
A non-text attachment was scrubbed...
Name: vnet.set_vnet.patch
Type: text/x-patch
Size: 3970 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-virtualization/attachments/20110725/5eb06f77/vnet.set_vnet.bin


More information about the freebsd-virtualization mailing list