| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Rewrite origin_subst_one() to get rid of the wrong limit on the length
of the resulting string.
MFC r250075:
Properly terminate the result string for intermediate results.
Approved by: re (jpaetzel)
Notes:
svn path=/releng/8.4/; revision=250305
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Map libraries linked with -Ttext-segment=base_addr at base_addr.
Normal libraries have base address 0 and are unaffected by this change.
PR: 176216
Submitted by: Damjan Jovanovic <damjan.jov@gmail.com>
Reviewed by: kib
Notes:
svn path=/stable/8/; revision=247847
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On shared object unload, in __cxa_finalize, call and clear all installed
atexit and __cxa_atexit handlers that are either installed by unloaded
dso, or points to the functions provided by the dso.
Use _rtld_addr_phdr to locate segment information from the address of
private variable belonging to the dso, supplied by crtstuff.c. Provide
utility function __elf_phdr_match_addr to do the match of address against
dso executable segment.
Call back into libthr from __cxa_finalize using weak
__pthread_cxa_finalize symbol to remove any atfork handler which
function points into unloaded object.
The rtld needs private __pthread_cxa_finalize symbol to not require
resolution of the weak undefined symbol at initialization time. This
cannot work, since rtld is relocated before sym_zero is set up.
MFC r211894:
Do not call __pthread_cxa_finalize with invalid struct dl_phdr_info.
Requested and tested by: Peter Jeremy <peter rulingia com>
Notes:
svn path=/stable/8/; revision=235198
|
| |
|
|
|
|
|
|
|
|
|
| |
Introduce implementation-private rtld interface _rtld_addr_phdr, which
fills struct dl_phdr_info for the shared object that contains the
specified address, if any.
Requested and tested by: Peter Jeremy <peter rulingia com>
Notes:
svn path=/stable/8/; revision=235191
|
| |
|
|
|
|
|
| |
Remove write-only variable.
Notes:
svn path=/stable/8/; revision=233172
|
| |
|
|
|
|
|
| |
Optimize tls_get_addr_common().
Notes:
svn path=/stable/8/; revision=233067
|
| |
|
|
|
|
|
| |
Typo.
Notes:
svn path=/stable/8/; revision=229018
|
| |
|
|
|
|
|
| |
Handle the R_386_TLS_TPOFF32 relocation.
Notes:
svn path=/stable/8/; revision=226383
|
| |
|
|
|
|
|
| |
Set TLS block for the main thread after the relocations are processed.
Notes:
svn path=/stable/8/; revision=226382
|
| |
|
|
|
|
|
|
|
| |
Restore the writing of the .bss sections of the dsos.
Revert the optimization of using mprotect(2) to establish .bss, overlap
the section with mmap(2).
Notes:
svn path=/stable/8/; revision=225961
|
| |
|
|
|
|
|
|
|
|
| |
Use the proper dynamic tls block to calculate the tls variable address
in case tls data generation was updated.
PR: misc/160721
Notes:
svn path=/stable/8/; revision=225726
|
| |
|
|
|
|
|
| |
load_object
Notes:
svn path=/stable/8/; revision=220440
|
| |
|
|
|
|
|
|
|
|
|
| |
- Add support for TLS relocations.
- Emitt an error when encountering an unsupported and in case of the
kernel also for unaligned relocations.
- Fix R_SPARC_HIX22 and R_SPARC_LOX10 relocations. Apparently these are
hardly ever used.
Notes:
svn path=/stable/8/; revision=219996
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Remove clause 3 and 4 from TNF licenses. [1]
- Add the _RF_X committed in r212998 (merged to stable/8 in r213478) also
to the tables in the sparc64 reloc.c in order reduce differences between
the kernel and the userland source. This results in no functional change
though.
- Consistently abbreviate the names of the relocations.
- End sentences with dots.
- Fix whitespace.
Obtained from: NetBSD [1]
Notes:
svn path=/stable/8/; revision=219940
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If dlclose() is called recursively from a _fini() function, the inner
dlclose() call may unload the object of the outer call prematurely
because objects are unreferenced before _fini() calls.
Fix this by unreferencing objects after calling objlist_call_fini() in
dlclose(). Therefore objlist_call_fini() now calls the fini function if
the reference count of an object is 1. In addition we must restart the
list_fini traversal after every _fini() call because another dlclose()
call might have modified the reference counts.
Add an XXX comment to objlist_call_fini() about possible race with
dlopen().
PR: 133246, 149464
Notes:
svn path=/stable/8/; revision=219237
|
| |
|
|
|
|
|
|
|
|
| |
Make ldd(1) work when versioned dependency file is cannot be loaded.
MFC r218099:
Fix grammar.
Notes:
svn path=/stable/8/; revision=218365
|
| |
|
|
|
|
|
|
|
| |
Remove SuperH architecture from a comment.
Approved by: kib (mentor)
Notes:
svn path=/stable/8/; revision=218126
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit merges the MIPS platform changes that was now stable in
-CURRENT into 8-STABLE. The MIPS changesets are too many (~400) to list
here. But the changesets merged in this commit that affect other platforms
are summarized below:
r204635 : (changes to sys/dev/hwpmc, lib/libpmc, sys/sys/pmc.h)
Add support for hwpmc(4) on the MIPS 24K, 32 bit, embedded processor.
r205845: (changes to sys/modules/Makefile)
Fix for building modules on mips and arm.
r204031: (changes to sys/kern/link_elf_obj.c)
printf fix, as part of kernel module support for MIPS.
r206404: (changes to sys/arm/include/bus.h)
Add BUS_SPACE_UNRESTRICTED and define it to be ~0, just like all the
other platforms - for arm and mips.
r206819: (changes to sys/vm/)
Add VMFS_TLB_ALIGNED_SPACE option and kmem_alloc_nofault_space(), which
is used to allocate kernel stack address on MIPS.
r208165, r211087: (sys/kern/subr_smp.c, sys/kern/sched_ule.c)
Enable ULE scheduler for MIPS, Fix for an issue in SMP when 32 cpus are
enabled.
r208659: (sys/{ia64/ia64,mips/mips,sun4v/sun4v}/pmap.c)
Simplify the inner loop of get_pv_entry()
r208794: (changes to sys/vm/)
Make vm_contig_grow_cache() extern, and use it when vm_phys_alloc_contig()
fails to allocate MIPS page table pages.
r210327: (changes to sys/vm/)
Support for MIPS page table page allocation. Add a new function 'vm_page_t
vm_page_alloc_freelist(int flind, int order, int req)' to vm/vm_page.c to
allocate a page from a specified freelist, and other related changes.
Reviewed by: alc(vm changes only)
Approved by: kib(re), alc(vm), imp(mips), jmallett(mips), gnn(mips pmc)
Notes:
svn path=/stable/8/; revision=215938
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If dlopen() is called for the dso that has been already loaded as a
dependency, then the dso never has its DAG initialized. Empty DAG
makes ref_dag() call in dlopen() a nop, and the dso refcount is off
by one.
Initialize the DAG on the first dlopen() call, using a boolean flag
to prevent double initialization.
MFC r214776:
Fix style.
MFC r214777:
Change init_dag() to not increment DAG refcount. Unconditionally call
both init_dag() and ref_dag() in dlopen() for the case when the object
was already loaded.
Notes:
svn path=/stable/8/; revision=215084
|
| |
|
|
|
|
|
|
|
|
|
| |
Fix two subtle problems in PPC32 RTLD. The first is a concurrency issue
where long PLT calls in multi-threaded environments could end up with
incorrect jmptab values. The second is that, after the addition of extended
PLT support, I forgot to update the PLT icache synchronization code to cover
the extended PLT instead of just the basic PLT.
Notes:
svn path=/stable/8/; revision=213833
|
| |
|
|
|
|
|
|
|
| |
Plug possible memory leak.
Found by: Coverity Prevent
Notes:
svn path=/stable/8/; revision=209303
|
| |
|
|
|
|
|
|
|
| |
Remove const'ness from dlerror(3) prototype, for consistency with POSIX.
Approved by: cognet
Notes:
svn path=/stable/8/; revision=205979
|
| |
|
|
|
|
|
|
| |
Support the extended PLT format used when objects have more than 8192
PLT relocations on PPC32.
Notes:
svn path=/stable/8/; revision=205383
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Implement rtld part of the support for -z nodlopen (see ld(1)).
MFC r199877:
Allow to load not-openable dso when tracing. This fixes ldd on such dso or
dso linked to non-openable object.
Remove '\n' at the end of error message.
End comments with dot.
Notes:
svn path=/stable/8/; revision=200645
|
| |
|
|
|
|
|
| |
Fix white space in rtld runtime error printf.
Notes:
svn path=/stable/8/; revision=200512
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
Sponsored by: Google
Notes:
svn path=/stable/8/; revision=200509
|
| |
|
|
| |
Notes:
svn path=/stable/8/; revision=199980
|
| |
|
|
|
|
|
| |
Flag controlling origin expansion in DT_FLAGS is DF_ORIGIN, not DF_1_ORIGIN.
Notes:
svn path=/stable/8/; revision=199907
|
| |
|
|
|
|
|
|
|
| |
Apply relocations for PIE binary ELF data structures pointers in rtld.
Approved by: re (kensmith)
Notes:
svn path=/stable/8/; revision=198280
|
| |
|
|
|
|
|
|
|
| |
Requested and tested by: jkim
Reviewed by: kan
Approved by: re (kensmith)
Notes:
svn path=/head/; revision=195745
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=195743
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
compiled with stack protector.
Use libssp_nonshared library to pull __stack_chk_fail_local symbol into
each library that needs it instead of pulling it from libc. GCC
generates local calls to this function which result in absolute
relocations put into position-independent code segment, making dynamic
loader do extra work every time given shared library is being relocated
and making affected text pages non-shareable.
Reviewed by: kib
Approved by: re (kib)
Notes:
svn path=/head/; revision=195697
|
| |
|
|
|
|
|
| |
Approved by: re (impliciti, by approving previos check-in)
Notes:
svn path=/head/; revision=195152
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use libssp_nonshared library to pull __stack_chk_fail_local symbol into
each library that needs it instead of pulling it from libc. GCC generates
local calls to this function which result in absolute relocations put into
position-independent code segment, making dynamic loader do extra work everys
time given shared library is being relocated and making affected text pages
non-shareable.
Reviewed by: kib
Approved by: re (kensmith)
Notes:
svn path=/head/; revision=195151
|
| |
|
|
|
|
|
| |
Submitted by: bf1783 googlemail com
Notes:
svn path=/head/; revision=194705
|
| |
|
|
|
|
|
| |
Submitted by: Christoph Mallon
Notes:
svn path=/head/; revision=194689
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
altered through their .init code. This might happen if init
vector calls dlopen on its own and that dlopen causes some not
yet initialized object to be initialized earlier as part of that
dlopened DAG.
Do not reset module reference counts to zero on final fini vector
run when process is exiting. Just add an additional parameter to
force fini vector invocation regardless of current reference count
value if object was not destructed yet. This allows dlclose called
from fini vector to proceed normally instead of failing with handle
validation error.
Reviewed by: kib
Reported by: venki kaps
Notes:
svn path=/head/; revision=194531
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
dlsym seaches using this handle are expected to look for symbol
definitions in all objects loaded at the program start time along
with all objects currently in RTLD_GLOBAL scope.
Discussed with: kib
Reported by: Maho NAKATA
MFC after: 2 weeks
Notes:
svn path=/head/; revision=194298
|
| |
|
|
|
|
|
| |
OpenGL driver on amd64).
Notes:
svn path=/head/; revision=192922
|
| |
|
|
|
|
|
|
|
|
| |
CACHE_LINE_SIZE.
Submitted by: bde
MFC after: 2 weeks
Notes:
svn path=/head/; revision=191303
|
| |
|
|
|
|
|
| |
MFC after: 2 weeks
Notes:
svn path=/head/; revision=191292
|
| |
|
|
|
|
|
|
|
|
|
| |
that definition in the custom locking code for the run-time linker
rather than local definitions.
Pointed out by: tinderbox
MFC after: 2 weeks
Notes:
svn path=/head/; revision=191291
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=190885
|
| |
|
|
|
|
|
|
|
| |
Fix spacing.
Reviewed by: kan
Notes:
svn path=/head/; revision=190883
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
dlfunc() called dlsym() to do the work, and dlsym() determines the dso
that originating the call by the return address. Due to this, dlfunc()
operated as if the caller is always the libc.
To fix this, move the dlfunc() to rtld, where it can call the internal
implementation of dlsym, and still correctly fetch return address.
Provide usual weak stub for the symbol from libc for static binaries.
dlfunc is put to FBSD_1.0 symver namespace in the ld.so export to
override dlfunc@FBSD_1.0 weak symbol, exported by libc.
Reported, analyzed and tested by: Tijl Coosemans <tijl ulyssis org>
PR: standards/133339
Reviewed by: kan
Notes:
svn path=/head/; revision=190673
|
| |
|
|
| |
Notes:
svn path=/head/; revision=190624
|
| |
|
|
|
|
|
|
|
|
| |
static linker option. Do it by incrementing reference count on the loaded
object and its dependencies.
Reviewed by: davidxu, kan
Notes:
svn path=/head/; revision=190543
|
| |
|
|
|
|
|
|
|
| |
preloaded.
Reported and tested by: ed
Notes:
svn path=/head/; revision=190505
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
the rtld hints file. This environment variable would be unset if the
process is considered as tainted with setuid/setgid. This feature gives
a convenient way of using a custom set of shared library that is not
located in the default location and switch back.
Feature requested by: iXsystems
Original patch by: John Hixson
MFC after: 2 weeks
Notes:
svn path=/head/; revision=190324
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=189959
|