Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Apr 1997 18:28:38 -0500 (EST)
From:      James da Silva <jds@torrentnet.com>
To:        dfr@nlsystems.com
Cc:        freebsd-current@freebsd.org
Subject:   Re: A new Kernel Module System
Message-ID:  <199704012328.SAA25348@bacardi.torrentnet.com>
In-Reply-To: <Pine.BSF.3.95q.970401184204.4064C-100000@kipper.nlsystems.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Doug writes:
>On Tue, 1 Apr 1997, John Polstra wrote:
>
>> > I am pretty sure that if I link a bunch of objects together using
>> > -Bshareable, then ld(1) will generate a symbol table for me.
>> 
>> Yes, you're right.  I stand corrected.  You get zillions of warnings
>> about RRS text relocations, but the output file does seem to be
>> legitimate.
>> 
>> I still have doubts that this buys you anything, though.  Is there any
>> advantage over just using the static symbol table and relocations?
>> Remember, you'll have to link against kernel symbols too, and it won't
>> have a run-time symbol table.
>
>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.

What do you need that the simple method is lacking?
Jaime
...........................................................................
:  James da Silva  <jds@torrentnet.com>        :  Stand on my shoulders,  :
:  Torrent Networking Technologies Corp.       :      not on my toes.     :



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704012328.SAA25348>