login
Header Space

 
 

Re: Jump Tables: A Mystery

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
Date: Saturday, August 15, 1992 - 11:41 am

In article <1992Aug15.085244.10732@nntp.hut.fi> sakaria@vipunen.hut.fi (Sakari Aaltonen) writes:

        Think of it in the following way.  The sharable library is nothing
more than some code that is guaranteed to be in a certain spot in virtual
memory (actually, the way it is set up, the name of the sharable library is
buried in your program startup code).  On linux, this address is the same for
every process, so every process can share the code pages for the sharable
libraries. 

        When you link your program to the sharable library, the linker resolves
references to routines in the sharable library by using the actual addresses of
the routines.  This by itself works just fine, except for the fact that
when we update the library to fix bugs the addresses of the routines change
and the executables will no longer work.  This means that you have to relink
all of your programs.

        A jump table is just a series of jmp instructions, one right after
another.  This is usually placed right at the beginning of the sharable image,
and each jmp instruction jumps off to one of the routines in the sharable
image.  The idea is that when a new version of the library comes out, that
the jump table will still be in the same location in memory, and thus
all of the references in your program to the sharable library will still
effectively point to the correct routines.  Therefore you will still be able
to run your program without having to relink it.

        The cost is the extra indirection of the jmp instruction.  The benefit
is that you will not have to relink programs whenever you update the library.
In the past we have not had the jump tables, and it basically meant having to
keep the source code for *everything* on line, so that we could relink whenever
a new library comes out.  It appears as if we are on the verge of relinking for
the last time :-)


        That sounds very much like a jump table to me.  The index is nothing
more than the offset into the jump table, and you obviously need to know the
library name.  The idea behind both the DLLs and the jump tables is that you
can modify the library (i.e. fix bugs, add new functions, etc), without
invalidating any executables that are linked to the library.

-Eric
eric@tantalus.nrl.navy.mil

(My regular new server is down right now, so I am using this address for the
time being).
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: Jump Tables: A Mystery, Eric Youngdale, (Sat Aug 15, 11:41 am)
speck-geostationary