aboutsummaryrefslogtreecommitdiff
path: root/libexec/rtld-aout
Commit message (Collapse)AuthorAgeFilesLines
* MFC: Fixed style of INSTALLFLAGS assignments.Ruslan Ermilov2002-07-171-1/+1
| | | | Notes: svn path=/stable/4/; revision=100238
* MFC:David Malone2002-03-041-1/+1
| | | | | | | | Change brk's prototype from char *brk(const char *) to int brk(const void *) and sbrk's prototype from char *sbrk(int) to void *sbrk(intptr_t). Notes: svn path=/stable/4/; revision=91631
* MFC: markup and misc fixes.Ruslan Ermilov2001-08-161-2/+2
| | | | | | | Approved by: re Notes: svn path=/stable/4/; revision=81771
* MFC: MAN[1-9] -> MAN.Ruslan Ermilov2001-04-251-1/+1
| | | | Notes: svn path=/stable/4/; revision=75952
* MFC: recent mdoc(7) fixes.Ruslan Ermilov2001-03-051-16/+9
| | | | Notes: svn path=/stable/4/; revision=73778
* MFC: Prepare for mdoc(7)NG.Ruslan Ermilov2001-01-161-1/+1
| | | | Notes: svn path=/stable/4/; revision=71105
* MFC: Prepare for mdoc(7)NG.Ruslan Ermilov2000-12-271-1/+1
| | | | Notes: svn path=/stable/4/; revision=70398
* MFC: add /dev/zero and use PATH_* where possible.David E. O'Brien2000-12-111-2/+3
| | | | Notes: svn path=/stable/4/; revision=69839
* Move the man pages for the a.out dynamic linker into the 1aoutJohn Polstra2000-01-292-227/+2
| | | | | | | | | | section. I created rtld.1aout earlier with a repository copy. This clears the way for the ELF dynamic linker man page, which I will commit next. Notes: svn path=/head/; revision=56789
* .Nm += "rtld"Alexey Zelkin1999-09-282-2/+4
| | | | | | | apropos(1) now knows about rtld(1) manpage. Notes: svn path=/head/; revision=51746
* $Id$ -> $FreeBSD$Peter Wemm1999-08-2813-13/+13
| | | | Notes: svn path=/head/; revision=50476
* Fix a bug in the handling of minor version numbers. Formerly, theJohn Polstra1998-11-071-13/+34
| | | | | | | | | | | | | | | | | | | rtld would accept the first shared library it found with the right major version number, even if the minor version number was too low. If a different version of the shared library with an adequate minor version number appeared later in the search path, it would not be found. Now the rtld searches all locations first looking for a library with a minor version that is high enough. Only if such a library is not found will it fall back to accepting a minor version number that is too low. As before, a warning comes out in that case. This solves some problems encountered when building an older world on a -current system. Notes: svn path=/head/; revision=40983
* Don't recognize a file as an a.out shared library unless it has atJohn Polstra1998-09-051-6/+4
| | | | | | | | | | | | | | | least 2 version numbers. This fixes the bug where the dynamic linker would try to load an ELF shared library if it found one. Note, this change also fixes the same thing in "ld", because the code is shared. For "ld" there is still a problem with ".a" libraries, which cannot be distinguished by name. I haven't decided what, if anything, to do about that. Notes: svn path=/head/; revision=38870
* Chaneg MACHINE to MACHINE_ARCH to support MACHINE=pc98.John Birrell1998-09-051-3/+3
| | | | Notes: svn path=/head/; revision=38853
* Pass me the pointy hat with the extra sequins. Just a moment, while I getStephen McKay1998-08-221-6/+20
| | | | | | | | | | | | it to sit right... The __error() hack gave out the wrong address. It returned the address of errno in ld.so instead of the address of errno in the main program. Oops. The hack is now correct, just in time to be obsoleted by elf. Notes: svn path=/head/; revision=38480
* Since I got no objections to this patch, and no one has offered anyStephen McKay1998-06-211-1/+70
| | | | | | | | | | | | | | | alternative, I present .. ta! da! .. the __error() hack. This patch to the a.out dynamic loader provides old a.out binaries with __error() if they are linked with an older libc that lacks it, but are also linked against a library that needs it. There is a smaller, tricker hack that takes advantage of the fact that ld.so has __error() too, courtesy of the new libc, but this hack is the straightforward version. Notes: svn path=/head/; revision=37092
* Search for libraries in dlopen() when the specified pathBrian Somers1998-06-073-8/+13
| | | | | | | | | contains no ``/''s. Elf already searches it seems. Mostly submitted by: Mike Smith <mike@smith.net.au> Notes: svn path=/head/; revision=36717
* Seperate the Paul Kranenburg a.out rtld stuff into a stand-alone area awayPeter Wemm1998-06-011-5/+3
| | | | | | | | from the gpl ld code. This is part 2 of something that I began in 1996. A repository copy has happened behind cvs's back. Notes: svn path=/head/; revision=36565
* ELF preparation step 2:Søren Schmidt1998-05-262-4/+4
| | | | | | | | | | | | | | | | | Move a.out libraries to /usr/lib/aout to make space for ELF libs. Make rtld usr /usr/lib/aout as default library path. Make ldconfig reject /usr/lib as an a.out library path. Fix various Makefiles for LIBDIR!=/usr/lib breakage. This will after a make world & reboot give a system that no longer uses /usr/lib/*, infact one could remove all the old libraries there, they are not used anymore. We are getting close to an ELF make world, but I'll let this all settle for a week or two... Notes: svn path=/head/; revision=36397
* Implement dladdr.John Polstra1998-02-061-4/+94
| | | | Notes: svn path=/head/; revision=33137
* Make emacs work again. This is a workaround for the fact that theJohn Polstra1997-12-051-18/+33
| | | | | | | | | | | | | | | | | | | | | | | emacs a.out file, self-generated by emacs's "unexec" function in "unexsunos4.c", is invalid. In particular, its "_end" symbol has the wrong value. The dynamic linker was using the value of that symbol to initialize its sbrk break level. The workaround is to peek at the executable's a.out header in memory, and calculate what "_end" should be based on the segment sizes. I will work out a fix for emacs and send it to the FSF. This dynamic linker workaround is still worthwhile, if only to avoid forcing all emacs users to build a new version. Note: xemacs gives a bogus warning at startup, for related reasons. The warning is harmless and can safely be ignored. I will send a patch to the xemacs maintainers to get rid of it, and meanwhile add a patch file to our port. Notes: svn path=/head/; revision=31546
* Get rid of the dynamic linker's internal malloc package, and arrangeJohn Polstra1997-11-292-266/+473
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | things so that it uses the same malloc as is used by the program being executed. This has several advantages, the big one being that you can now debug core dumps from dynamically linked programs and get useful information out of them. Until now, that didn't work. The internal malloc package placed the tables describing the loaded shared libraries in a mapped region of high memory that was not written to core files. Thus the debugger had no way of determining what was loaded where in memory. Now that the dynamic linker uses the application's malloc package (normally, but not necessarily, the system malloc), its tables end up in the regular heap area where they will be included in core dumps. The debugger now works very well indeed, thank you very much. Also ... Bring the program a little closer to conformance with style(9). There is still a long way to go. Add minimal const correctness changes to get rid of compiler warnings caused by the recent const changes in <dlfcn.h> and <link.h>. Improve performance by eliminating redundant calculations of symbols' hash values. Notes: svn path=/head/; revision=31445
* Many places in the code NULL is used in integer context, wherePoul-Henning Kamp1997-09-181-2/+2
| | | | | | | | | | | | plain 0 should be used. This happens to work because we #define NULL to 0, but is stylistically wrong and can cause problems for people trying to port bits of code to other environments. PR: 2752 Submitted by: Arne Henrik Juul <arnej@imf.unit.no> Notes: svn path=/head/; revision=29574
* spelling corrections.Wolfram Schneider1997-09-132-6/+6
| | | | | | | | PR: docs/4450 Submitted by: josh@quick.net Notes: svn path=/head/; revision=29329
* - In dlsym(), if the lookup fails using the original symbol, prepend anNate Williams1997-08-191-2/+30
| | | | | | | | | | underscore and try looking it up again. This is a non-issue if we switch to ELF. Reviewed by: sef, jdp Notes: svn path=/head/; revision=28434
* Implement dlsym(RTLD_NEXT, symbol).John Polstra1997-08-021-12/+64
| | | | Notes: svn path=/head/; revision=27838
* Typo fix.Masafumi Max NAKANE1997-05-272-6/+6
| | | | | | | | PR: 3693 Submitted by: Kazuo Horikawa <k-horik@yk.rim.or.jp> Notes: svn path=/head/; revision=26195
* Changes to support the kernel linker:Doug Rabson1997-05-131-1/+4
| | | | | | | | | | | | | | | | | Add a -Bforcedynamic option which generates a dynamic object even if no shared libraries were given in the link. Make RRS in text section warnings conditional on "-assert pure-text" so that I can link non-PIC kernel modules without tons of link errors. Changes to bsd.lib.mk to follow. Fix a couple of bugs exposed by the fact that the kernel is not linked at zero. Reviewed by: jdp Notes: svn path=/head/; revision=25774
* Fix a bug that caused the relocs for linker set members in sharedJohn Polstra1997-04-301-1/+3
| | | | | | | | | | libraries to come out as 1-byte relocations instead of 4-byte relocations. Submitted by: Doug Rabson <dfr@nlsystems.com> Notes: svn path=/head/; revision=25300
* Fixed `make depend' and related bogons. LDFLAGS was used forBruce Evans1997-04-161-10/+2
| | | | | | | | | | | | | | ld-specific flags. LDFLAGS is really for ld-related flags for cc, not for ld, and some flags, e.g., -Bshareable, mean completely different things to cc and ld. Having the wrong things in LDFLAGS also broke the standard ${PROG} target. This was kludged around by using a special rule that depended on LDFLAGS being bogus. Fixing `make depend' broke the special rule but fixed the standard rule (except in the DESTDIR case, which was handled more strictly here than elsewhere). Notes: svn path=/head/; revision=24979
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-2213-13/+13
| | | | Notes: svn path=/head/; revision=22996
* Use xmalloc instead of malloc in two places, so that out-of-memoryJohn Polstra1997-01-241-1/+1
| | | | | | | | | conditions will be detected. Submitted by: Philippe Charnier <charnier@xp11.frmug.org> Notes: svn path=/head/; revision=21967
* Pay attention to the environment variable "LD_IGNORE_MISSING_OBJECTS".John Polstra1997-01-173-2/+61
| | | | | | | | | | | | If it is set to a nonempty string, then simply skip any missing shared libraries. This came up in a discussion long ago as a potentially useful feature at sysinstall time. For example, an X11 utility could be used without the X libraries being present, provided the utility had a mode in which no X functions were actually called. Notes: svn path=/head/; revision=21819
* If a library is found in the hints file, but the library doesn't exist,John Polstra1997-01-141-0/+4
| | | | | | | | | | | | ignore the hint. This is a straightforward fix, and it should go into 2.2 after a burn-in period of a few days. Noticed by: bde Notes: svn path=/head/; revision=21693
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-1413-13/+13
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Sort cross references.Wolfram Schneider1997-01-132-6/+6
| | | | Notes: svn path=/head/; revision=21635
* Use the RTLD_NOW symbol, now that it is defined in <dlfcn.h>.John Polstra1997-01-121-4/+3
| | | | Notes: svn path=/head/; revision=21620
* Correct typos and spelling errors.John Polstra1997-01-122-10/+10
| | | | Notes: svn path=/head/; revision=21578
* Add support for the LD_BIND_NOW environment variable. If it is set to aJohn Polstra1997-01-123-30/+71
| | | | | | | | | | | | | | | | | | | | | | | | nonempty string, then function calls are relocated at program start-up rather than lazily. This variable is standard on Sun and SVR4 systems. The dlopen() function now supports both lazy and immediate binding, as determined by its "mode" argument, which can be either 1 (RTLD_LAZY) or 2 (RTLD_NOW). I will add defines of these symbols to <dlfcn.h> as soon as I've done a little more checking to make sure they won't cause collisions or bootstrapping problems that would break "make world". The "LD_*" environment variables which alter dynamic linker behavior are now treated as unset if they are set to the empty string. This agrees with the standard SVR4 conventions for the dynamic linker. Add a work-around for programs compiled with certain buggy versions of crt0.o. The buggy versions failed to set the "crt_ldso" member of the interface structure. This caused certain error messages from the dynamic linker to begin with "(null)" instead of the pathname of the dynamic linker. Notes: svn path=/head/; revision=21577
* Add support for the LD_BIND_NOW environment variable. If it is set to aJohn Polstra1997-01-122-2/+21
| | | | | | | | | | | | | | nonempty string, then function calls are relocated at program start-up rather than lazily. This variable is standard on Sun and SVR4 systems. The dlopen() function now supports both lazy and immediate binding, as determined by its "mode" argument, which can be either 1 (RTLD_LAZY) or 2 (RTLD_NOW). I will add defines of these symbols to <dlfcn.h> as soon as I've done a little more checking to make sure they won't cause collisions or bootstrapping problems that would break "make world". Notes: svn path=/head/; revision=21574
* Fix spelling error in manpage.Steven Wallace1996-12-262-4/+4
| | | | Notes: svn path=/head/; revision=20930
* If errors occur during the loading of the shared libraries required byJohn Polstra1996-10-241-10/+30
| | | | | | | | | | | | | | | | the main program, report them directly from the dynamic linker and die there, rather than returning an error message to crt0.o. This enables the printing of error messages even for old executables, whose version of crt0.o is not able to print them. This fix closes PR bin/1869. The code in crt0.o for printing error messages from the dynamic linker is no longer used, because of this change. But it must remain, for backward compatibility with older dynamic linkers. Notes: svn path=/head/; revision=19158
* Fix two minor typos in the manual page.John Polstra1996-10-182-6/+6
| | | | Notes: svn path=/head/; revision=19010
* Add the search directories from the hints file only the first time it isJohn Polstra1996-10-101-2/+5
| | | | | | | | | opened. After that, the directories are already present, and there is no point in adding them again. This doesn't fix any bugs; it's just for efficiency. Notes: svn path=/head/; revision=18862
* Fix a bug that caused a segmentation violation if dlsym() was calledJohn Polstra1996-10-101-2/+2
| | | | | | | with its first argument equal to NULL. Notes: svn path=/head/; revision=18849
* There's no need to 'unsetenv()' unsafe environment variables explicitlyNate Williams1996-10-011-6/+1
| | | | | | | | | since rt_readenv() already takes care of not setting unsafe variables. This was part of the changes I submitted to Peter and John during the review which must have gotten missed. Notes: svn path=/head/; revision=18625
* Sigh, oh well, here's my obligigatory "oops" commit. I don't quite knowPeter Wemm1996-10-011-1/+13
| | | | | | | | | | how I managed to get this out of sync, but I did. I guess that's what I get for directly committing from different machines that I was testing on. Pointed out by: Paul Traina <pst@freebsd.org> Notes: svn path=/head/; revision=18618
* Update to handle new version ld.so.hints and info in executable forPeter Wemm1996-10-014-62/+331
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | configurable fallback search paths, as well as new crt interface version. Also: - even faster getenv(), get all environment variable settings in a single pass. - ldd printf-like format specifications - minor code cleanups, one vsprintf -> vsnprintf (harmless) The library search sequence is a little more complete now. Before, it'd search $LD_LIBRARY_PATH (by opendir/readdir/closedir), then read the hints file, then read /usr/lib (again by scanning thr directory). It would then fail if there was no "found" library. Now, it does LD_LIBRARY_PATH and the hints file the same, but then uses a longer fallback path. The -R path is fetched from the executable if specified at build time, the ldconfig path is appended, and /usr/lib is appended to that. Duplicates are suppressed. This means that simply placing a new library in /usr/local/lib will work (the same as it did in /usr/lib) without needing ldconfig -m. It will find it quicker if the ldconfig is run though. Similar changes have been made to the NetBSD ld.so, but ours is rather different now due to John Polstra's speedups and fixes from a while back. The ldd printf-like format support came direct from NetBSD. Reviewed by: nate, jdp Notes: svn path=/head/; revision=18599
* Update the backends to go with the top-level ld changes. The non-i386Peter Wemm1996-10-013-11/+34
| | | | | | | | | | changes are for completeness, I don't think they work. There are changes to deal with the new include files. Obtained from: NetBSD (mostly) Notes: svn path=/head/; revision=18596
* Support for .weak (in addition to the N_INDR stab) for gcc/g++. Also dealPeter Wemm1996-10-015-19/+562
| | | | | | | | | | | | | with the -R option and store the path in the dynamic header when specified. The $LD_RUN_PATH environment variable is not checked yet. While here, split up the code a bit more to enable more selective replacing of GPL'ed components that are linked with ld.so with others. Obtained from: NetBSD (mostly, the breakup is my fault) Notes: svn path=/head/; revision=18595