#
1c232cd5 |
| 06-Oct-2009 |
Robert Watson <rwatson@FreeBSD.org> |
In rtld's map_object(), use pread(..., 0) rather than read() to read the ELF header from the front of the file. As all other I/O on the binary is done using mmap(), this avoids the need for seek pri
In rtld's map_object(), use pread(..., 0) rather than read() to read the ELF header from the front of the file. As all other I/O on the binary is done using mmap(), this avoids the need for seek privileges on the file descriptor during run-time linking.
MFC after: 1 month Sponsored by: Google
show more ...
|
#
11e9b8ba |
| 04-Aug-2009 |
Oleksandr Tymoshenko <gonzo@FreeBSD.org> |
- MFC @196061
|
#
69ca61ba |
| 17-Jul-2009 |
Konstantin Belousov <kib@FreeBSD.org> |
Only perform .bss mapping and cleaning operations when segment file size is not equal to its memory size.
This eliminates unneeded clearing of the text segment that often happens due to text end not
Only perform .bss mapping and cleaning operations when segment file size is not equal to its memory size.
This eliminates unneeded clearing of the text segment that often happens due to text end not being page-aligned.
For instance, $ readelf -l /lib/libedit.so.6 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align LOAD 0x000000 0x00000000 0x00000000 0x139e1 0x139e1 R E 0x1000 LOAD 0x014000 0x00014000 0x00014000 0x00f04 0x00f14 RW 0x1000 DYNAMIC 0x014cc4 0x00014cc4 0x00014cc4 0x000d0 0x000d0 RW 0x4 $ procstat -v $$ (for /bin/sh) 68585 0x28097000 0x280aa000 r-x 6 0 21 14 CN vn /lib/libedit.so.6 68585 0x280aa000 0x280ab000 r-x 1 0 1 0 CN vn /lib/libedit.so.6 <== 68585 0x280ab000 0x280ac000 rwx 1 0 1 0 CN vn /lib/libedit.so.6 Note the splitted map entry marked by '<=='.
Reviewed by: kan Approved by: re (kensmith) MFC after: 1 month
show more ...
|
Revision tags: release/7.2.0_cvs, release/7.2.0 |
|
#
9c797940 |
| 13-Apr-2009 |
Oleksandr Tymoshenko <gonzo@FreeBSD.org> |
- Merge from HEAD
|
#
a3c8e04e |
| 10-Apr-2009 |
Konstantin Belousov <kib@FreeBSD.org> |
Currently, when mapping an object, rtld reserves the whole address space for the mapping by the object' file with the protection and mode of the first loadable segment over the whole region. Then, it
Currently, when mapping an object, rtld reserves the whole address space for the mapping by the object' file with the protection and mode of the first loadable segment over the whole region. Then, it maps other segments at the appropriate addresses inside the region.
On amd64, due to default alignment of the segments being 1Gb, the subsequent segment mappings leave the holes in the region, that usually contain mapping of the object' file past eof. Such mappings prevent wiring of the address space, because the pages cannot be faulted in.
Change the way the mapping of the ELF objects is constructed, by first mapping PROT_NONE anonymous memory over the whole range, and then mapping the segments of the object over it. Take advantage of this new order and allocate .bss by changing the protection of the range instead of remapping.
Note that we cannot simply keep the holes between segments, because other mappings may be made there. Among other issues, when the dso is unloaded, rtld unmaps the whole region, deleting unrelated mappings.
The kernel ELF image activator does put the holes between segments, but this is not critical for now because kernel loads only executable image and interpreter, both cannot be unloaded. This will be fixed later, if needed.
Reported and tested by: Hans Ottevanger <fbsdhackers beasties demon nl> Suggested and reviewed by: kan, alc
show more ...
|
#
11e0093f |
| 10-Apr-2009 |
Konstantin Belousov <kib@FreeBSD.org> |
Update comment to the reality, rtld supports any number of loadable segments. Fix spacing.
Reviewed by: kan
|
#
28551690 |
| 18-Mar-2009 |
Konstantin Belousov <kib@FreeBSD.org> |
Implement the dynamic string token substitution in the rpath and soneeded pathes. The $ORIGIN, $OSNAME, $OSREL and $PLATFORM tokens are supported. Enabling the substitution requires DF_ORIGIN flag in
Implement the dynamic string token substitution in the rpath and soneeded pathes. The $ORIGIN, $OSNAME, $OSREL and $PLATFORM tokens are supported. Enabling the substitution requires DF_ORIGIN flag in DT_FLAGS or DF_1_ORIGIN if DF_FLAGS_1, that may be set with -z origin gnu ld flag. Translation is unconditionally disabled for setuid/setgid processes.
The $ORIGIN translation relies on the AT_EXECPATH auxinfo supplied by kernel.
Requested by: maho Tested by: maho, pho Reviewed by: kan
show more ...
|
Revision tags: release/7.1.0_cvs, release/7.1.0, release/6.4.0_cvs, release/6.4.0, release/7.0.0_cvs, release/7.0.0, release/6.3.0_cvs, release/6.3.0 |
|
#
49f90ad2 |
| 03-Apr-2007 |
Alexander Kabaev <kan@FreeBSD.org> |
Implement dl_iterate_phdr function. Convert boolean flags in internal Obj_Entry structure into bitfields. Properly check for loaded segment alignment in map_object.
|
Revision tags: release/6.2.0_cvs, release/6.2.0, release/5.5.0_cvs, release/5.5.0, release/6.1.0_cvs, release/6.1.0 |
|
#
0eb88f20 |
| 18-Dec-2005 |
Alexander Kabaev <kan@FreeBSD.org> |
Implement ELF symbol versioning using GNU semantics. This code aims to be compatible with symbol versioning support as implemented by GNU libc and documented by http://people.redhat.com/~drepper/symb
Implement ELF symbol versioning using GNU semantics. This code aims to be compatible with symbol versioning support as implemented by GNU libc and documented by http://people.redhat.com/~drepper/symbol-versioning and LSB 3.0.
Implement dlvsym() function to allow lookups for a specific version of a given symbol.
show more ...
|
Revision tags: release/6.0.0_cvs, release/6.0.0, release/5.4.0_cvs, release/5.4.0 |
|
#
ddab7ee8 |
| 27-Feb-2005 |
Doug Rabson <dfr@FreeBSD.org> |
Attempt to free any static TLS space used by a shared library when it is unloaded. This allows applications which load and unload libraries like libGL.so.1 several times to work properly.
MFC after:
Attempt to free any static TLS space used by a shared library when it is unloaded. This allows applications which load and unload libraries like libGL.so.1 several times to work properly.
MFC after: 2 days
show more ...
|
Revision tags: release/4.11.0_cvs, release/4.11.0, release/5.3.0_cvs, release/5.3.0 |
|
#
017246d0 |
| 03-Aug-2004 |
Doug Rabson <dfr@FreeBSD.org> |
Add support for Thread Local Storage.
|
Revision tags: release/4.10.0_cvs, release/4.10.0, release/5.2.1_cvs, release/5.2.1, release/5.2.0_cvs, release/5.2.0, release/4.9.0_cvs, release/4.9.0 |
|
#
da9f2454 |
| 18-Jun-2003 |
Matthew N. Dodd <mdodd@FreeBSD.org> |
- Add support for DT_FLAGS. - Define various things from the most recent ELF spec.
|
Revision tags: release/5.1.0_cvs, release/5.1.0 |
|
#
341b3de6 |
| 31-May-2003 |
Matthew N. Dodd <mdodd@FreeBSD.org> |
Simplify map_object() by breaking out the ELF header validation bits into a separate function.
|
#
78af18bd |
| 04-May-2003 |
David E. O'Brien <obrien@FreeBSD.org> |
Fix signed/unsigned comparison warnings.
|
Revision tags: release/4.8.0_cvs, release/4.8.0 |
|
#
63c1e7cb |
| 14-Mar-2003 |
Alexander Kabaev <kan@FreeBSD.org> |
Free obj->priv field in obj_free functions. This field is NULL on all architectures except ia64, which uses it to keep function description table.
|
Revision tags: release/5.0.0_cvs, release/5.0.0 |
|
#
fa7dd9c5 |
| 16-Dec-2002 |
Matthew Dillon <dillon@FreeBSD.org> |
Change the way ELF coredumps are handled. Instead of unconditionally skipping read-only pages, which can result in valuable non-text-related data not getting dumped, the ELF loader and the dynamic l
Change the way ELF coredumps are handled. Instead of unconditionally 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
show more ...
|
#
8b7f25d4 |
| 23-Oct-2002 |
Alexander Kabaev <kan@FreeBSD.org> |
Add support for binaries with arbitrary number of PT_LOAD sections.
Reviewed by: peter
|
Revision tags: release/4.7.0_cvs, release/4.6.2_cvs, release/4.6.2, release/4.6.1, release/4.6.0_cvs, release/4.5.0_cvs, release/4.4.0_cvs |
|
#
b5393d9f |
| 15-Oct-2001 |
Doug Rabson <dfr@FreeBSD.org> |
Add ia64 support. Various adjustments were made to existing targets to cope with a few interface changes required by the ia64. In particular, function pointers on ia64 need special treatment in rtld.
|
Revision tags: release/4.3.0_cvs, release/4.3.0, release/4.2.0, release/4.1.1_cvs, release/4.1.0, release/3.5.0_cvs, release/4.0.0_cvs, release/3.4.0_cvs, release/3.3.0_cvs |
|
#
a607e5d7 |
| 30-Aug-1999 |
John Polstra <jdp@FreeBSD.org> |
Get the actual pathname of the dynamic linker from the executable's PT_INTERP program header entry, to ensure that gdb always finds the right dynamic linker.
Use obj->relocbase to simplify a few cal
Get the actual pathname of the dynamic linker from the executable's PT_INTERP program header entry, to ensure that gdb always finds the right dynamic linker.
Use obj->relocbase to simplify a few calculations where appropriate.
show more ...
|
#
7360ae0f |
| 30-Aug-1999 |
John Polstra <jdp@FreeBSD.org> |
When checking to see if a shared object is already loaded, look for a device/inode match if no pathname match is found.
|
#
926ea445 |
| 30-Aug-1999 |
John Polstra <jdp@FreeBSD.org> |
Revamp the symbol lookup algorithm to cope better with objects loaded separately by dlopen that have global symbols with identical names. Viewing each dlopened object as a DAG which is linked by its
Revamp the symbol lookup algorithm to cope better with objects loaded separately by dlopen that have global symbols with identical names. Viewing each dlopened object as a DAG which is linked by its DT_NEEDED entries in the dynamic table, the search order is as follows:
* If the referencing object was linked with -Bsymbolic, search it internally. * Search all dlopened DAGs containing the referencing object. * Search all objects loaded at program start up. * Search all objects which were dlopened() using the RTLD_GLOBAL flag (which is now supported too).
The search terminates as soon as a strong definition is found. Lacking that, the first weak definition is used.
These rules match those of Solaris, as best I could determine them from its vague manual pages and the results of experiments I performed.
PR: misc/12438
show more ...
|
#
7f3dea24 |
| 28-Aug-1999 |
Peter Wemm <peter@FreeBSD.org> |
$Id$ -> $FreeBSD$
|
#
bfb1ef60 |
| 18-Jul-1999 |
John Polstra <jdp@FreeBSD.org> |
Change many asserts into normal errors. They were all for conditions caused by invalid shared objects rather than by internal errors.
Enable format string mismatch checking for _rtld_error().
|
Revision tags: release/3.2.0, release/3.1.0, release/3.0.0, release/2.2.8 |
|
#
13575fc4 |
| 04-Sep-1998 |
Doug Rabson <dfr@FreeBSD.org> |
Add alpha support.
Submitted by: John Birrell <jb@cimlogic.com.au> (with extra hacks by me) Obtained from: Probably NetBSD
|
Revision tags: release/2.2.7, release/2.2.6 |
|
#
3124c3e0 |
| 07-Mar-1998 |
John Polstra <jdp@FreeBSD.org> |
Import the ELF dynamic linker. This is the ElfKit version with quite a few enhancements and bug fixes. There are still some known deficiencies, but it should be adequate to get us started with ELF.
Import the ELF dynamic linker. This is the ElfKit version with quite a few enhancements and bug fixes. There are still some known deficiencies, but it should be adequate to get us started with ELF.
Submitted by: John Polstra <jdp@polstra.com>
show more ...
|