Re: How to export arch specific symbols?

Jan Kloetzke <[email protected]> Sat, 24 May 2008 21:19:01 +0200
Newsgroups gmane.os.openbeos.kernel.devel
Message-ID <[email protected]>
"François Revol" <[email protected]> wrote:
> > I've got the problem that the new vm86_* functions are apparently
> >  not exported
> > by the kernel and cannot be used by the vesa kernel add-on. :-( I
> > hacked
> > around that for me locally but what would be the preferred way to
> > export
> > these symbols?
>
> They should be exported by default since we use ELF...
> but maybe they aren't linked in to kernel.so, which is what the
> KernelAddon rule links to, not kernel_x86.
> You might need to add the missing object to kernel.so in src/system/
> kernel/Jamfile.

Currently all arch stuff is first linked into a single static lib called 
lib$(TARGET_ARCH).a which is then linked to both kernel.so and 
kernel_$(TARGET_ARCH). I don't know the linking rules in detail but it looks 
like only the _used_ symbols from the static library are exported.

This is the linking chain and the nm output grep'ed for "vm86":

arch/x86/vm86.o -> arch/x86/libx86.a --> kernel.so
                                     \-> kernel_x86

vm86.o:
	00000088 t _Z10em_rep_insP11vm86_iframei
	00000198 t _Z11em_rep_outsP11vm86_iframeii
	000001da t _Z19vm86_fault_callbackmmb
	00000000 t _Z6em_insP11vm86_iframei
	000000c4 t _Z7em_outsP11vm86_iframeii
	000001fa T vm86_cleanup
	0000035a T vm86_do_int
	0000023a T vm86_prepare
	         U x86_vm86_enter
	         U x86_vm86_return

libx86.a:
	         U x86_vm86_return
	00000378 t int_bottom_vm86
	0000060a T x86_vm86_enter
	0000064f T x86_vm86_return
	vm86.o:
	00000088 t _Z10em_rep_insP11vm86_iframei
	00000198 t _Z11em_rep_outsP11vm86_iframeii
	000001da t _Z19vm86_fault_callbackmmb
	00000000 t _Z6em_insP11vm86_iframei
	000000c4 t _Z7em_outsP11vm86_iframeii
	000001fa T vm86_cleanup
	0000035a T vm86_do_int
	0000023a T vm86_prepare
	         U x86_vm86_enter
	         U x86_vm86_return

kernel.so / kernel_x86:
	800be908 t int_bottom_vm86
	800beb9a T x86_vm86_enter
	800bebdf T x86_vm86_return

As you can see the vm86_* are gone. :-(

Was there a specific reason to use a static library for the arch stuff? I 
changed the Jamfile to create a libx86.o (via KernelMergeObject rule) instead 
of a libx86.a. Then all symbols are exported as expected...

/Jan

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/