freebsd-nq/sys
Marcel Moolenaar 0f9d8c9b27 Implement elf_reloc(). The RT specification says that we can expect
both Elf_Rel and Elf_Rela types of relocation, so handle them both
even though we only have Rel_Rela ATM. We don't handle 32-bit and
big-endian variants yet. Support for that is not trivial enough to
implement it without any evidence that we ever need it in the near
future.

For the FPTR relocations, we currently use the fptr_storage used by
_reloc() is locore.s. This is in no way a real solution, but for now
provides the service we need to get the basics going.

A static recursive function lookup_fdesc() is used to find the address
of a function in a way that keeps track of the load module so that
we can get the correct GP value if we need to construct an OPD (ie
there's no OPD yet for the function.

For simplicity, we create an OPD for the IPLT relocations as well and
simply fill the user provided function descriptor from the OPD. Since
the the official descriptors are unique, this has no bad side effects.
Note that we ignore the addend for FPTR relocations, but use the
addend for IPLT relocations as an offset to the function address.

This commit allows us to load and relocate modules and modules appear
to work correctly, although we probably need to make sure that we set
GP correctly in all cases when we have inter-module calls. This
especially applies to assembly coded functions that have cross module
calls.
2002-04-21 21:27:57 +00:00
..
alpha Since WITNESS doesn't just do mutexes, remove "mutex" from the WITNESS 2002-04-18 03:44:44 +00:00
amd64 Stylify (mainly line up macro EOL-continuation \'s), and add a dummy 2002-04-21 10:49:00 +00:00
arm Guard against redefining __gnuc_va_list. 2002-03-24 11:25:46 +00:00
boot Improve self-relocation: 2002-04-21 08:49:47 +00:00
cam Fix 3 of the four problems with my last indentation fix. ("fixing" the 2002-04-01 05:41:33 +00:00
coda Don't put a line break in string literals. GCC 3.1 complains and GCC 2002-04-20 01:42:56 +00:00
compat Add an XXX: linux_uselib() should be using vn_open() rather than invoking 2002-04-20 14:43:34 +00:00
conf Reenable the newly unbroken hfa device. 2002-04-20 19:44:38 +00:00
contrib We don't need ip_ipsec_pxy.c in userland. 2002-03-26 13:42:09 +00:00
crypto Remove macros that are defined elsewhere. 2002-04-21 10:32:48 +00:00
ddb Commented out locking that would be used in the ps command if locks were 2002-04-11 21:01:34 +00:00
dev Fix really dumb braino of mine; cast a sizeof() to an int, which it is 2002-04-21 11:02:36 +00:00
fs Don't attempt to decvlare M_DEVFS whern MALLOC_DECLARE is not defined. 2002-04-21 15:47:03 +00:00
geom Make kernel dumps work with GEOM. 2002-04-19 09:24:12 +00:00
gnu Change callers of mtx_init() to pass in an appropriate lock type name. In 2002-04-04 21:03:38 +00:00
i4b Change callers of mtx_init() to pass in an appropriate lock type name. In 2002-04-04 21:03:38 +00:00
i386 Stylify (mainly line up macro EOL-continuation \'s), and add a dummy 2002-04-21 10:49:00 +00:00
ia64 Implement elf_reloc(). The RT specification says that we can expect 2002-04-21 21:27:57 +00:00
isa GC various bits and pieces of USERCONFIG from all over the place. 2002-04-09 11:18:46 +00:00
isofs/cd9660 Change callers of mtx_init() to pass in an appropriate lock type name. In 2002-04-04 21:03:38 +00:00
kern Add function link_elf_get_gp(), specific to ia64 for now, to get 2002-04-21 21:08:30 +00:00
libkern Remove bogus include of <machine/ansi.h>. 2002-04-11 06:53:40 +00:00
modules Move tx(4) driver to sys/dev/tx. BTW split hardware structures and constants 2002-04-19 22:43:57 +00:00
net just merged cosmetic changes from KAME to ease sync between KAME and FreeBSD. 2002-04-19 04:46:24 +00:00
netatalk Change callers of mtx_init() to pass in an appropriate lock type name. In 2002-04-04 21:03:38 +00:00
netatm - Nuke some more not needed #ifdef cruft. 2002-04-21 01:41:05 +00:00
netgraph Use 'struct callout' instead of 'struct callout_handle' to avoid 2002-04-14 17:37:35 +00:00
netinet Add sa_family_t type to <sys/_types.h> and typedefs to <netinet/in.h> 2002-04-20 02:24:35 +00:00
netinet6 just merged cosmetic changes from KAME to ease sync between KAME and FreeBSD. 2002-04-19 04:46:24 +00:00
netipx Change callers of mtx_init() to pass in an appropriate lock type name. In 2002-04-04 21:03:38 +00:00
netkey just merged cosmetic changes from KAME to ease sync between KAME and FreeBSD. 2002-04-19 04:46:24 +00:00
netnatm Change callers of mtx_init() to pass in an appropriate lock type name. In 2002-04-04 21:03:38 +00:00
netncp Add character translation table between Unix and NetWare according 2002-04-20 05:35:02 +00:00
netns Change callers of mtx_init() to pass in an appropriate lock type name. In 2002-04-04 21:03:38 +00:00
netsmb Recongnize more error codes returned by W2K servers. 2002-04-17 03:14:28 +00:00
nfs Remove unused include. 2002-03-20 10:12:07 +00:00
nfsclient The recent NFS forced unmount improvements introduced a side-effect 2002-04-17 01:07:29 +00:00
nfsserver Limit to the maximum allowed reply size the amount of data that 2002-04-21 16:14:54 +00:00
pc98 Rework the kernel environment subsystem. We now convert the static 2002-04-17 13:06:36 +00:00
pccard Change the suser() API to take advantage of td_ucred as well as do a 2002-04-01 21:31:13 +00:00
pci Move tx(4) driver to sys/dev/tx. BTW split hardware structures and constants 2002-04-19 22:43:57 +00:00
posix4 Remove __P. 2002-03-19 22:20:14 +00:00
powerpc Replace inline asm with it's inline function wrapper. 2002-04-20 10:06:22 +00:00
rpc
security/lomac Use the proc lock to protect p_ucred while we read a few items from it. 2002-04-11 21:17:45 +00:00
sparc64 MFi386 1.222. Remove vm_map_growstack and acquisition and release of Giant 2002-04-20 17:28:08 +00:00
svr4
sys Wrap GCC-specific stuff and provide alternative for lint. 2002-04-21 11:11:02 +00:00
tools constify 2002-04-01 19:22:04 +00:00
ufs Remove support for using soon to be retired "special" poll(2) ops. 2002-04-18 14:52:28 +00:00
vm Reintroduce locking on accesses to vm_object_list. 2002-04-20 07:23:22 +00:00
Makefile