summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf
Commit message (Collapse)AuthorAgeFilesLines
* Avoid using the global offset table to get the address of _DYNAMIC injake2003-07-042-1/+18
| | | | | | | | | rtld. When _DYNAMIC is referenced normally from C the global offset table is used implicitly, but newer versions of binutils don't initialize it statically in the binary, so this doesn't work until rtld is relocated, which _DYNAMIC is needed for... So, as on other systems with the same problem, we disassemble a call instruction to _DYNAMIC in order to get its address.
* Fix warnings on 64 bit platforms.mdodd2003-06-191-9/+9
| | | | Noticed by: jake
* Add function prototypes.mdodd2003-06-191-0/+2
|
* LD_DUMP_REL_PRE and LD_DUMP_REL_POST don't output to stderr; don'tmdodd2003-06-191-2/+2
| | | | claim that they do.
* Provide a mechanism for dumping relocation information.mdodd2003-06-194-0/+116
| | | | | | | Setting the LD_DUMP_REL_PRE or LD_DUMP_REL_POST environment variables cause rtld-elf to output a table of all relocations. This is useful for debugging.
* Move MD function prototypes together.mdodd2003-06-191-4/+8
|
* Fix warnings; no parameters in function prototypes.mdodd2003-06-192-3/+3
|
* Avoid a NULL pointer dereference.mdodd2003-06-181-1/+2
|
* Include libmap.h for prototypes.mdodd2003-06-181-0/+1
|
* - Add support for DT_FLAGS.mdodd2003-06-183-1/+21
| | | | - Define various things from the most recent ELF spec.
* Don't fail if we encounter a relocation of type "none". Just ignoremarcel2003-06-071-0/+3
| | | | | | it. It's a no-op relocation. Trigger case: ports/x11-toolkits/pango
* Set CSTD to gnu99. We can only use on of the gnu?9 C languages.obrien2003-06-041-0/+1
| | | | We can't use c89 due to use of 'inline', and c99 produces bad code.
* Assorted mdoc(7) fixes.ru2003-06-021-5/+5
|
* - use issetugid()mdodd2003-05-311-3/+2
| | | | | | - be paranoid about honoring LD_LIBMAP_DISABLE. Suggested by: rwatson
* Simplify map_object() by breaking out the ELF header validation bitsmdodd2003-05-311-58/+67
| | | | into a separate function.
* Provide function entry debugging messages.mdodd2003-05-311-1/+16
|
* Use the environment variable LD_LIBMAP_DISABLE to disablemdodd2003-05-312-3/+11
| | | | libmap.conf(5) functionality.
* Don't post-increment pointers inside a loop conditional.mdodd2003-05-301-11/+11
| | | | | | | | | | | While I'm here: - Let lm_add() call strdup() on its own behalf. - Use a temporary pointer when parsing constraints; only set the constraint pointer on a totally successful match. PR: bin/52783 Submitted by: David P. Reese Jr. <daver@gomerbud.com> Approved by: re (rwatson)
* Allow threading libraries to register their own lockingkan2003-05-2920-480/+558
| | | | | | | | | | implementation in case default one provided by rtld is not suitable. Consolidate various identical MD lock implementation into a single file using appropriate machine/atomic.h. Approved by: re (scottl)
* Initial pass at supporting shared libraries on amd64. There are stillpeter2003-05-242-73/+101
| | | | | | | a few missing relocation types in amd64/reloc.c, but I have not found any of them in use yet. :-) Approved by: re (amd64/* blanket)
* - Use xmalloc() and xstrdup() instead of malloc() and strdup().mdodd2003-05-191-5/+14
| | | | | | - Add a global mapping if we have a successful constrained match. Approved by: re
* Since libmap.conf is referenced in rtld.1, include it in the referencesrwatson2003-05-171-0/+1
| | | | | | section. Approved by: re (scottl)
* mdoc(7) police: Normalize the FILES section.ru2003-05-161-2/+3
| | | | Approved by: re (blanket)
* Rethink the way we count module references. Simply followingkan2003-05-081-18/+30
| | | | | | | | | DT_NEEDED links is not flexible enough for cases where dynamically loaded modules form a dependency cycle. This should fix an infinite recursion problem encountered by Yahoo. Approved by: re (jhb)
* Fix signed/unsigned comparison warnings.obrien2003-05-043-8/+9
|
* Remove 80386 bandaids from code repocopied from i386. rtld_start.S stillpeter2003-04-301-78/+4
| | | | todo.
* Remove redundant strlen checks, do not check the samekan2003-04-301-23/+24
| | | | symbol twice.
* Code cleanups and sanity checking for config file parser.mdodd2003-04-101-19/+52
|
* Dynamic object dependency mapping: libmap.mdodd2003-04-075-5/+238
| | | | | | | This is an optional feature, disabled by default. This will be useful to people testing the various POSIX threading libraries under -CURRENT but can easily serve other needs.
* Fix for ia64/48024 - ensure function pointer equality across elfarun2003-03-191-52/+77
| | | | | | | | | | | | objects. Programs such as sshd depend on two pointers to the same function being equal in a given process. However, the current ia64 implementation ensures that they're equal when both the pointers are instantiated in the same ELF object. The attached patch ensures that they're equal irrespective of where they're instantiated. Reviewed by marcel@ (mentor) and kan@
* Free obj->priv field in obj_free functions. This field is NULLkan2003-03-141-0/+1
| | | | | on all architectures except ia64, which uses it to keep function description table.
* No need to zero fill memory, mmapped anonymously. Kernel willkan2003-03-146-15/+1
| | | | | | return pre-zeroed pages itself. Noticed by: jake
* Do not remove object from the lists at the unref_dag() stage.kan2003-02-171-8/+26
| | | | | | | Introduce a new unlink_object() function and call it in unload_object() instead. Removing the object in unref_dag() is too early, rtld calls _fini() function after that and shared objects might fail resolve their own symbols.
* Advertize rtld(1) as ld.so(1) in manual pages worldphantom2003-02-132-1/+3
|
* Fix a typo in rtld_dirname.kan2003-02-131-1/+1
|
* Implement dlinfo() function.kan2003-02-132-32/+262
| | | | | | | | | | Introdice RTLD_SELF special handle and properly process it within dlsym() and dlinfo() functions. The intention is to improve our compatibility with Solaris and to make a Java port easier. Partially submitted by: phantom
* Add missing include files I forgot about in previous commit.kan2003-02-131-0/+2
|
* Remove /usr/lib/elf from a default search path.kan2003-02-133-19/+17
| | | | | | Move xprintf to malloc.c, it is only used there. Make static. Submitted by: phantom
* When unloading dependencies make sure they are removed from all thekan2003-02-101-9/+10
| | | | | | | | | | | | associated lists: remove RTLD_GLOBAL objects from global objects list; remove the parent object from dldags list of its children. Previosly we were doing that only to the top-level object OF the DAG being unloaded and all its dependencies were ignored, leading to mysterious crashes later. Submitted by: peter (partially)
* Change the way ELF coredumps are handled. Instead of unconditionallydillon2002-12-161-6/+23
| | | | | | | | | | | | | | | | | | | skipping read-only pages, which can result in valuable non-text-related data not getting dumped, the ELF loader and the dynamic loader now mark read-only text pages NOCORE and the coredump code only checks (primarily) for complete inaccessibility of the page or NOCORE being set. Certain applications which map large amounts of read-only data will produce much larger cores. A new sysctl has been added, debug.elf_legacy_coredump, which will revert to the old behavior. This commit represents collaborative work by all parties involved. The PR contains a program demonstrating the problem. PR: kern/45994 Submitted by: "Peter Edwards" <pmedwards@eircom.net>, Archie Cobbs <archie@dellroad.org> Reviewed by: jdp, dillon MFC after: 7 days
* Uniformly refer to a file system as "file system".ru2002-12-121-1/+1
| | | | Approved by: re
* Fix rtld to handle SPARC_R_UA{16,64} relocations correctly.kan2002-12-051-2/+2
| | | | Approved by: re (rwatson)
* rtld support for PowerPC. Mostly obtained from NetBSD, with modsgrehan2002-12-045-0/+926
| | | | | | | | for binutils 2.13 Reviewed by: benno Approved by: re (blanket)
* Put back a test for binaries with no PT_LOAD entries I over-jealoslykan2002-11-291-0/+4
| | | | | | removed in r1.69. Apploved by: re (rwatson)
* Fix the handling of high PLT entries (> 32764) on sparc64. This requirestmm2002-11-1812-213/+242
| | | | | | | | additional arguments to reloc_jmpslot(), which is why MI code and MD code of other platforms had to be changed. Reviewed by: jake Approved by: re
* Add support for binaries with arbitrary number of PT_LOAD sections.kan2002-10-232-45/+55
| | | | Reviewed by: peter
* Change the symbol lookup order to search RTLD_GLOBAL objectskan2002-10-191-12/+12
| | | | | | | | | | before referencing object's DAG. This makes it possible for C++ exceptions to work across shared libraries and brings us closer to the search order used by Solaris/Linux. Reviewed by: jdp Approved by: obrien MFC after: 1 month
* Fix a problem with RTLD_TRACE flag to dlopen(3), which sometimes can returnsobomax2002-10-191-6/+8
| | | | | | | | | | | | | even if there was no error occured (when trying to dlopen(3) object that already linked into executable which does dlopen(3) call). This is more proper fix for `ldd /usr/lib/libc.so' problem, because the new behaviour conforms to documentation. Remove workaround from ldd.c (rev.1.32). PR: 35099 Submitted by: Nathan Hawkins <utsl@quic.net> MFC after: 1 week
* Use the new freebsd output format from Binutils 2.13.1.obrien2002-10-121-2/+2
|
* <machine/atomic.h> requires <sys/types.h>.ru2002-10-092-2/+1
| | | | Reviewed by: jake, mike
OpenPOWER on IntegriCloud