Re: writing a jump table

Brian Raiter <[email protected]> Wed, 16 Mar 2011 19:23:08 -0700
Newsgroups org.kernel.vger.linux-assembly
Message-ID <[email protected]>
> I think I figured it out now. I used gcc to compile PIC for the C
> switch statement and checked what it does. I don't fully understand
> it to be honest, but it seems to do the job also for non PIC code.

Of course -- PIC code just means that the code doesn't assume it knows
where it's located in memory, which for a shared-object library is a
necessary thing. It does mean the code has to jump through a few more
hoops, which is why the compiler doesn't make it the default.

b