Re: How to export arch specific symbols?

"François Revol" <[email protected]> Sun, 25 May 2008 18:07:32 +0200 CEST
Newsgroups gmane.os.openbeos.kernel.devel
Message-ID <2184731420-BeMail@laptop>
> > 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
> 
> 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. :-(
> 

Hmm that's because the .a was linked in without forcing all symbols in.
static libraries by default only link in the needed symbols.

It should likely be linked in with --whole-archive.

> 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...

Or just as an object, that should work.
I don't know why it's still a .a
Ingo ??

François.

-------------------------------------------------------------------------
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/