Commit Graph

246 Commits

Author SHA1 Message Date
fvdl a904f36474 Don't use multi-line string literals. 2001-06-19 12:07:21 +00:00
fvdl d1d73371a6 Preliminary x86-64 support. Not fully functional yet (toolchain bugs). 2001-06-19 01:11:03 +00:00
nathanw ed485c7ad5 Correct spelling in a comment. 2001-05-28 06:10:20 +00:00
christos 7ddeec7d69 s/warn/xwarnx/ cuts down size by 50% by not pulling in stdio. 2001-05-27 23:26:47 +00:00
christos 21d58e7713 Provide compatibility for the NetBSD-1.5 branch. Note that I used
__NetBSD_Version__ instead of checking if the macro was not already
defined.
2001-05-24 17:42:48 +00:00
christos cb12da02ff Don't include <uvm/uvm_param.h>. It does not appear to be needed by anything.
<uvm/uvm_param.h> does not exist under 1.5.  Tested on i386 and sparc.
Anyway, if it is indeed needed by other platforms then we'll put it back,
but I don't see how since it does not define any types.
2001-05-24 17:41:42 +00:00
christos f8ad0818e5 Unloading objects, can cause other objects whose reference count becomes
0 to be unloaded. Make sure that when we unload those objects we remove
any references to them from the globals list... This fixes SIGSEGV with
apache+mod_php+mysql.

XXX: This fix should be pulled up.

christos
2001-05-10 20:19:25 +00:00
kleink 63ccd3db5b Sync with <sys/exec_elf.h> rev. 1.45: ElfNN_RelA -> ElfNN_Rela. 2001-04-25 12:24:50 +00:00
christos fc18ea2931 avoid nested extern 2001-02-04 22:11:12 +00:00
pk 38fd9b8f99 Avoid the use of a `switch(){}' statement before _rtld_init() is called.
`switch()' code may be translated using a jump table approach which causes
it to reference the equivalent of a global variable, something that must
be avoided before _rtld_init() has run.
2001-02-03 13:25:00 +00:00
christos 5d6793c06c back out previous commit; I found a better way of handling the missing
dependencies.
2001-01-14 09:39:26 +00:00
christos 61944ce838 Don't use ${OBJS} in the dependency line, cause it is not defined yet.
Also add a .NOTMAIN for good measure.
2001-01-14 09:16:47 +00:00
scw b37a02f8c1 Define VARPSZ so dynamic binaries work on both 4K and 8K page size machines. 2000-12-21 09:12:54 +00:00
mycroft 48b362e14c More cruft. 2000-12-15 06:49:19 +00:00
mycroft a19119777a Clean up cruft in here. 2000-12-15 06:46:22 +00:00
mycroft 6ec13b9d73 Return an error when there are too many segments rather than abort()ing.
This way `ldd /usr/libexec/ld.elf_so' doesn't core dump.
2000-11-26 05:22:15 +00:00
mycroft 0581ae5bad Make ldd(1) build again. 2000-11-10 23:53:04 +00:00
mycroft 2d376bed2b When dlopen()ing with RTLD_GLOBAL, also make dependent libraries RTLD_GLOBAL. 2000-11-10 21:31:30 +00:00
simonb ae2c9c22f1 Fix linked-list botch with sysctl-based library selection that meant
only the last line was used.  Allow more than one white space character
between fields.

Reviewed by Christos Zoulas.
2000-11-10 18:19:06 +00:00
simonb 6e63b39fc6 Only need to include <sys/sysctl.h> once. 2000-11-09 23:14:21 +00:00
dan d173359000 format warning fixes from he, after testing on 64-bit elf (alpha) 2000-10-11 20:46:07 +00:00
is 48052d04a3 Format string cleanups by sommerfeld. 2000-10-10 19:54:37 +00:00
eeh 45de780533 Wrong register in machine code description. 2000-09-16 14:04:30 +00:00
scottb b5de616825 copy the real object filename to the rtld object path so that the
Dl_info structure can be properly filled by dladdr().
2000-08-28 04:15:54 +00:00
matt 1ed7963458 Simplify some stuff. 2000-08-07 01:47:04 +00:00
kleink fb21fd7a91 Adjust a comment after the Great Renaming. 2000-07-27 10:44:39 +00:00
mycroft 94581370f5 The ELF ABI declares that argc must fill an `argument slot'. Make it so.
For __sparc_v9__ only, do a hack to make executables work temporarily before
and after the kernel is switched.
2000-07-26 15:40:07 +00:00
mycroft 43cfeb27a9 Catch up with type changes. Also:
* Apply DT_PLTRELSZ to (one of) pltrel or pltrela *after* we've finished
  parsing the headers, so we know which one.
* Fix sparc64 bogons.  (It works now!)
2000-07-26 02:07:34 +00:00
thorpej a8248dcc27 Make it build on non-VARPSZ again. 2000-07-19 15:01:16 +00:00
eeh 55c1b7fb0d Fix some issues with SPARC V9 ELF binaries. 2000-07-18 22:33:55 +00:00
matt 824a084272 More VAX ELF changes. 2000-07-17 02:55:52 +00:00
matt 63465d3193 No need for RELOCATE_SELF since the VAX does real PIC. Rewrite the bind
routine to deal with JMP .vs. CALLx differences.
2000-07-14 22:03:02 +00:00
matt 9118b9fe90 Split DEBUG into two lines to make it easier to enable each separately. 2000-07-14 22:01:09 +00:00
matt 72ed915502 Update to reflect VAX ELF reality. 2000-07-14 22:00:33 +00:00
matt cc5d6b2a4d Initialize ld.elf_so's textsize. 2000-07-14 21:59:58 +00:00
eeh 3cf5c2adbf Added support for the SPARC v9 ABI. 2000-07-13 23:14:17 +00:00
christos 910cd9b309 fix non-portable bit-fields 2000-07-06 03:16:51 +00:00
matt 23bca583f4 shut gcc up about a bogus possibly used before initialized. 2000-07-03 03:33:52 +00:00
matt c72bbb2c51 Treat short and byte print formats as and cast to the right size. 2000-07-03 03:32:57 +00:00
matt 86d15d820b Update to current <machine/asm.h> 2000-07-03 03:31:47 +00:00
matt 5aa9ca0144 If OBJECT_FMT is ELF and MACHINE_ARCH = vax, build ld.elf_so 2000-07-03 03:30:52 +00:00
mrg ad91bba6a6 we now need <uvm/uvm_param.h> 2000-06-26 15:37:26 +00:00
christos baeb94e0b1 Also set __mainprog_obj so .ini sections can call dlopen() 2000-06-16 19:51:05 +00:00
cgd db755e7c76 sweep of my licenses (userland files w/o only my copyright) for
consistency.  (no functional changes)
2000-06-14 17:24:02 +00:00
cgd d220ca5ba3 fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well.  No functional changes.
2000-06-14 06:48:47 +00:00
jdolecek 06d16ede1e slighly move the assert() added in last commit, so that it's
actually useful
2000-06-03 06:51:57 +00:00
jdolecek 2a05365bbb _rtld_unref_dag(): needed->obj might be null if the unreffed object has
some unsatisfied references (most often when compiled without necessary
	-Wl,-R), so check for that instead of causing null-dereference;
	this way the code has a chance to cleanup after itself and report
	the error to caller

Thanks to Jason Thorpe for helping fix this!
2000-06-02 22:52:28 +00:00
matt 0189702cee minor fix now that i've defined the plt0 entry. 2000-05-22 19:17:04 +00:00
bjh21 6c97e2bd78 Initial commit of arm26 port 2000-05-09 21:55:44 +00:00
kleink e425e0a706 PowerPC: support ADDR16_LO, ADDR16_HI and ADDR16_HA relocations. 2000-05-01 11:41:08 +00:00
erh a497b0d8ab Cause ld.elf_so to find the symbols for __progname and environ and set them. If we wait until crt0 gets around to doing it it's too late for any library init functions. 2000-04-15 05:41:46 +00:00
christos 46d52e1ec5 re-indent sanely _rtld_dlsym() [no functional change] 2000-04-15 05:27:49 +00:00
soren 0b24ff5b31 Also print a newline after the error in the xwarnx case. 2000-04-02 23:04:32 +00:00
mycroft 3d5dc334de Don't try to get libc_pic from the libc compile directory. If we're doing a
build, libc has already been installed.
2000-03-26 21:55:55 +00:00
chs 871e0c1533 switch back to using a file mapping for the initial mapping of a new object.
this allows the kernel to use PMAP_PREFER() to give us better alignment on
platforms that care.
2000-02-13 04:28:09 +00:00
scottb 076e309d3e change first argument of dladdr to const. 2000-02-08 16:22:59 +00:00
scottb c0cf420b69 add hooks to support the dladdr function. 2000-02-07 21:40:40 +00:00
kleink 65b8f3b2eb Change _rtld_dlclose() to unload the object via _rtld_unload_object() rather
than by itself.  Besides being duplicated code the open-coded version
also did not take care of cleaning up after the object's DAG(!).
Fixes PR bin/8905.
2000-02-07 19:02:49 +00:00
christos 3bc3e6f774 use xwarnx instead of warnx 2000-01-15 01:03:45 +00:00
christos 3856850e36 don't stutter when printing error messages. 1999-12-27 15:36:36 +00:00
christos b360d70cb7 PR/9031: Scott Ellis: Ignore empty sysctl directive lines. 1999-12-20 02:43:58 +00:00
christos 4374b52ab0 make a debugging formatting statement work portably 1999-12-15 20:13:31 +00:00
christos f0e72d450d Do what the people want. Support full sysctl names. 1999-12-15 05:22:37 +00:00
christos 75bdf8c379 indent properly a debugging statement and fix grammar. 1999-12-13 10:47:38 +00:00
christos aa594cf123 For the benefit of ldd and debuggers, append more Needed_Entry elements
if the library transformation attached more than one element.
1999-12-13 09:22:52 +00:00
christos ea816c78b2 Enable parsing and mapping of hardware dependent libraries in ld.so.conf
To be documented in the man page.
1999-12-13 09:09:34 +00:00
itohy 69c745c3d5 Use "addend" for R_68K_GOT32, R_68K_PC32, and R_68K_32 relocations.
I'm not sure whether R_68K_GOT32 relocations appear in shared
objects, though....

Example:
	lea	%pc@(got+0x1234@GOTPC),%a0	| R_68K_GOT32
	bsrl	foo+0x5678			| R_68K_PC32
	lea	bar+0x9abc,%a1			| R_68K_32
1999-12-08 08:47:10 +00:00
fredb d37aed91fb More CL* fallout. 1999-12-05 18:36:25 +00:00
thorpej 3bf43967ff Name consistencty nit: curmark -> _rtld_curmark 1999-11-10 18:48:19 +00:00
thorpej 70e2953dac Some slight cosmetic cleanup. 1999-11-10 18:34:49 +00:00
mycroft bbe4b07983 Make this more likely to compile with ld.elf_so changes. (But this is
untested.)
1999-11-07 08:08:15 +00:00
mycroft 4bbb8dc9fb Make this more likely to compile with ld.elf_so changes. (But this is
untested.)
1999-11-07 08:01:51 +00:00
mycroft 7ea23adf34 More fallout. 1999-11-07 06:48:21 +00:00
mycroft 4b9f2ff9e0 Fix fallout from MD ld.elf_so changes. 1999-11-07 06:41:49 +00:00
mycroft 305c949781 Changes from msaitoh to fix local/global symbol confusion, and to fix weak
symbol support -- updated by me for elf.h changes.
1999-11-07 00:21:12 +00:00
erh 6752f572d8 Remove ELFNAME defines since they are defined in sys/exec_elf.h 1999-11-04 02:00:17 +00:00
simonb d10f49f606 More SVR4-style ELF cleanups. 1999-10-28 23:58:21 +00:00
tsubai 64ac9d7bdb Revert to rev. 1.4. This file didn't need to change. 1999-10-28 09:50:07 +00:00
kleink 522cbf0248 Update to match new SVR4-style definition names in <sys/exec_elf.h>. 1999-10-25 13:55:06 +00:00
hannken 222397ee58 Undo last change. While these macros are defined in exec_elf.h, they are
enclosed by `#ifdef _KERNEL'.
1999-10-22 10:39:16 +00:00
hannken db05621dec Undo last change. While these macros are defined in exec_elf.h, they are
enclosed by `#ifdef _KERNEL'.
1999-10-22 10:30:08 +00:00
erh b11baa5513 Remove ELFNAME macros which are already defines in exec_elf.h 1999-10-21 21:15:04 +00:00
itohy 6fa7d72ce5 Make __SVR4_ABI__ optional. 1999-10-18 03:26:53 +00:00
kleink 83265a56f2 Bump text alignments to 4 bytes. 1999-08-23 09:13:25 +00:00
matt 741f18b695 Initial VAX ELF32 support (mostly untested). It's checked primarily for
testing and archival for now.  I don't expect anyone to work with it
since the binutils and gas changes are still pending.  But you got to
crawl before you walk.
1999-08-21 19:26:18 +00:00
christos 46cd6f2aad reflect reality 1999-08-20 21:12:47 +00:00
christos 2f37f42366 fix typo 1999-08-20 21:10:27 +00:00
christos fb292d7f02 enable /etc/ld.so.conf processing
[reviewed by thorpej]
1999-08-19 23:42:15 +00:00
thorpej 5c5817ee4a When allocating the entire address space of an object, map an anonymous
region first (using the data/bss protection) covering it, then overlay
the text and data regions at the appropriate offsets within the region,
and then unmap any gap between the text and data.

The previous method of maping the entire address space with the actual
file object itself is incorrect, as it may extend past the end of the
file if the section alignment is large enough.

This bug was the source of the libposix failure on the SPARC and another
similar failure (with libc!) on the Alpha (failure was accompanied by
a "uvn_io: size check fired" message on the console).
1999-08-06 22:33:49 +00:00
kleink 1cc052ce00 Rearrange the shared library search path precedences to LD_LIBRARY_PATH >
runpath > built-in default; this is the behaviour of the SVR4 shared loader,
and gives users the opportunity to override the runpath.  (Addresses a report
on current-users by John Kohl.)
1999-08-01 19:47:07 +00:00
thorpej 4d256c199f When dlopen()'ing a shared object without an absolute pathname, search
for it in the rpath of the main program as well as the path specified
in LD_LIBRARY_PATH.
1999-07-22 00:18:19 +00:00
thorpej 206408b533 Protect certain definitions from view by crt0, by wrapping them in
#ifdef _RTLD_SOURCE.

Should fix the "variable page size" build error of crt0 on the SPARC.
1999-07-05 17:55:34 +00:00
christos 00e5621847 We need to compile with -DVARPSZ, because the sparc has a variable page
size depending on arch. Make it an error to compile without it. This
caused -lposix linked programs to fail.
1999-06-22 16:28:22 +00:00
thorpej 3787c5c3d8 MAP_COPY -> MAP_PRIVATE 1999-06-17 21:09:47 +00:00
kleink 8788923e6a Turn bool, true and false into an enumeration and enumeration constants to
avoid integer promotion warnings.
1999-06-16 15:41:24 +00:00
kleink 571aef82d9 Don't include the ident .note assembly when linting. 1999-06-15 15:54:28 +00:00
castor c195474580 This should use MACHINE_ARCH and test on "mipseb" instead of MACHINE and
"newsmips"
1999-06-07 18:04:31 +00:00
kleink 4a61873f68 Update for m68k. 1999-05-31 14:52:11 +00:00
kleink 8b74e6d78e Implement LD_PRELOAD support. 1999-05-31 14:48:16 +00:00
tsubai c47f82d209 syncicache is needed... 1999-05-21 08:00:11 +00:00