NetBSD/libexec/ld.elf_so
jonathan 5e0e8cec39 More table-driven changes for different toolchains:
* new bsd.own.mk variable OBJECT_FMT with values "a.out" or "ELF".
  * use OBJECT_FMT in Makefile tests that depend on toolchain.
  * Add new bsd.own.mk variable NOSHLIB that, if set indicates a given
    port doesnt yet do shared libraries. Set on powerpc.
  * Document new feature-test variables in src/share/mk/bsd.README.
Tested on i386, mips, fakedup Alpha environment.
1998-02-23 10:09:31 +00:00
..
alpha use CPPFLAGS instead of CFLAGS 1997-10-22 05:45:08 +00:00
arch/alpha use CPPFLAGS instead of CFLAGS 1997-10-22 05:45:08 +00:00
debug.c
debug.h
headers.c
link.h
load.c
Makefile More table-driven changes for different toolchains: 1998-02-23 10:09:31 +00:00
malloc.c WARNS?=1 1997-10-08 08:55:35 +00:00
map_object.c Fill in missing (default) mmap(2) flags. 1998-02-20 09:27:18 +00:00
paths.c WARNS?=1 1997-10-08 08:55:35 +00:00
README
reloc.c
rtld.c WARNS?=1 1997-10-08 08:55:35 +00:00
rtld.h
rtldenv.h WARNS?=1 1997-10-08 08:55:35 +00:00
search.c
symbol.c
sysident.h
xmalloc.c
xprintf.c

$NetBSD: README,v 1.1 1996/12/16 20:37:56 cgd Exp $

BUGS/PROBLEMS:

* rtld.c around line 147:

	#iffdef __alpha__
	/* XXX XXX XXX */
	_rtld_objself.pltgot = NULL;
	#endif

  It's a workaround for a linker bug, and will go away when the linker is
  fixed.

* Formerly, _DYNAMIC was _GLOBAL_OFFSET_TABLE_[0], but that isn't true with
  newer snapshots of gas/binutils (at least on the Alpha), which support
  multiple GOTs.  That's what the OLD_GOT #ifdefs are about.
  
* The method used to relocate ld.so is shoddy and fragile.  Currently it's
  something like:

	(1) assembly code relocates RELATIVE relocations in the GOT
	    (on some ports, all relative relocations; this will probably
	    have to be #ifdef'd in reloc.c), assuming that everything
	    in the GOT is a RELATIVE relocation.

	(2) C code relocates the rest of the loader, excluding those
	    RELATIVE relocations already done (via an ... iffy heuristic).

  Something better (like that the glibc ELF ld.so does) should be done
  eventually, where a single set of C code is compiled twice, once for
  normal use, and once to be used to relocate the shared linker.  No
  relocations should be processed in assembly language.

* On the Alpha, this code Really needs to be checked to be sure that
  it doesn't make calls that could use FP, while doing lazy binding.


TO DO:

* Support for other platforms (e.g. mips)

* Support for coexistance of 32-bit and 64-bit ELF on platforms that can
  do that.

* KNF

* Possible support for ldd (standalone operation) and program loading
  a la the glibc shared loader.