Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Apr 1997 13:03:51 +0100 (BST)
From:      Doug Rabson <dfr@nlsystems.com>
To:        James da Silva <jds@torrentnet.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: A new Kernel Module System
Message-ID:  <Pine.BSF.3.95q.970402125452.10467C-100000@kipper.nlsystems.com>
In-Reply-To: <199704012328.SAA25348@bacardi.torrentnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 1 Apr 1997, James da Silva wrote:

> >I plan to link the kernel as if it was a dynamic executable.  This
> >involves hacking ld(1) so that it still generates _DYNAMIC information
> >even if no shared libraries are seen in the link.
> 
> Doug, are you sure you can't do what you want with plain .o files, without
> hacking ld and mucking with -Bshareable?
> 
> I agree with John.  The kernel symbol table is already loaded, or can
> arrange to be loaded anyway.  After that, you suck in the module .o files
> whole, traversing their relocs and just applying them.  The symbol tables
> are pulled into a linked list of symbol tables for searching on subsequent
> linking.
> 
> This is very simple.  I can dig up the code I have that does this (load .o
> and reloc it against previously loaded symbols) if you want, it's less than
> 8k of code.

It actually seemed easier to use the symbol tables from -Bshareable.  No
hacking is required to ld other than a simple change to make sure it
generates a symbol table and _DYNAMIC for /kernel.  The rrs information
has only the exported symbols from the object and includes extra useful
information such as a symbol hashtable for lookups and a list of
dependancies.

> 
> What do you need that the simple method is lacking?

Not much.  The symbol hashtable and dependancy list should be useful
though.

--
Doug Rabson				Mail:  dfr@nlsystems.com
Nonlinear Systems Ltd.			Phone: +44 181 951 1891




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95q.970402125452.10467C-100000>