| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
Handle non-PLT GNU IFUNC relocations in rtld
Notes:
svn path=/stable/12/; revision=363372
|
| |
|
|
|
|
|
| |
rtld: Apply relro to itself.
Notes:
svn path=/stable/12/; revision=362604
|
| |
|
|
|
|
|
| |
rtld: Parse own phdr and notes.
Notes:
svn path=/stable/12/; revision=362603
|
| |
|
|
|
|
|
| |
rtld: Allow to load ET_DYN && DF_1_PIE when tracing.
Notes:
svn path=/stable/12/; revision=362526
|
| |
|
|
|
|
|
| |
rtld: Add debug line for dlopen_object().
Notes:
svn path=/stable/12/; revision=362525
|
| |
|
|
|
|
|
| |
Systematically pass RTLD_LO_TRACE to load_needed_objects().
Notes:
svn path=/stable/12/; revision=362524
|
| |
|
|
|
|
|
| |
rtld: set osrel when in the direct exec mode.
Notes:
svn path=/stable/12/; revision=362370
|
| |
|
|
|
|
|
| |
Do not allow to load ET_DYN object with DF_1_PIE flag set.
Notes:
svn path=/stable/12/; revision=361963
|
| |
|
|
|
|
|
| |
rtld direct exec: add -b and -v options.
Notes:
svn path=/stable/12/; revision=361881
|
| |
|
|
|
|
|
|
|
| |
Change link_map::l_addr to mean load offset in ABI-compatible way.
Add link_map::l_refname.
Add rtld feature indicators.
Notes:
svn path=/stable/12/; revision=361564
|
| |
|
|
|
|
|
|
|
| |
Implement RTLD_DEEPBIND.
PR: 246462
Notes:
svn path=/stable/12/; revision=361380
|
| |
|
|
|
|
|
| |
Align initial-exec TLS segments to the p_vaddr % align.
Notes:
svn path=/stable/12/; revision=360457
|
| |
|
|
|
|
|
| |
rtld: ignore static TLS segments when tracing.
Notes:
svn path=/stable/12/; revision=360456
|
| |
|
|
|
|
|
| |
Make p_vaddr % p_align == p_offset % p_align for (some) TLS segments.
Notes:
svn path=/stable/12/; revision=360067
|
| |
|
|
|
|
|
| |
Handle non-plt IRELATIVE relocations, at least for x86.
Notes:
svn path=/stable/12/; revision=358142
|
| |
|
|
|
|
|
| |
Fix indent.
Notes:
svn path=/stable/12/; revision=357949
|
| |
|
|
|
|
|
| |
Resolve relative argv0 for direct exec mode to absolute path for AT_EXECPATH.
Notes:
svn path=/stable/12/; revision=356787
|
| |
|
|
|
|
|
| |
rtld: Return error if $ORIGIN for a dlopen-ed library cannot be resolved.
Notes:
svn path=/stable/12/; revision=356784
|
| |
|
|
|
|
|
| |
Fix AT_EXECPATH for direct exec mode.
Notes:
svn path=/stable/12/; revision=356544
|
| |
|
|
|
|
|
|
|
|
| |
Switch to use shared vnode locks for text files during image activation.
For MFC, VOP_GET_WRITECOUNT was left in the slot for KBI stability, but it
is unused.
Notes:
svn path=/stable/12/; revision=348991
|
| |
|
|
|
|
|
| |
Fix order of destructors between main binary and libraries.
Notes:
svn path=/stable/12/; revision=346537
|
| |
|
|
|
|
|
| |
Fix initial exec TLS mode for dynamically loaded shared objects.
Notes:
svn path=/stable/12/; revision=346155
|
| |
|
|
|
|
|
| |
rtld: disable relro enforcement for irelative relocation processing.
Notes:
svn path=/stable/12/; revision=345731
|
| |
|
|
|
|
|
|
|
|
|
| |
Untangle jemalloc and mutexes initialization.
The merge includes required warnings cleanup by arichardson, both to
avoid conflicts and to make rtld_malloc.c compilable with the libthr
WARNS settings.
Notes:
svn path=/stable/12/; revision=344011
|
| |
|
|
|
|
|
|
| |
Remove now redundand ifunc relocation code which should have been
removed as part of r341441.
Notes:
svn path=/stable/12/; revision=343692
|
| |
|
|
|
|
|
|
|
|
|
| |
Improve R_AARCH64_TLSDESC relocation. The original code did not support
dynamically loaded libraries and used suboptimal access to TLS variables.
New implementation removes lazy resolving of TLS relocation - due to flaw in
TLSDESC design is impossible to switch resolver function at runtime without
expensive locking.
Notes:
svn path=/stable/12/; revision=342847
|
| |
|
|
|
|
|
|
| |
Provide naive but self-contained implementations of memset(3) and
bzero(3) for rtld.
Notes:
svn path=/stable/12/; revision=341773
|
| |
|
|
|
|
|
| |
Some fixes for LD_BIND_NOW + ifuncs.
Notes:
svn path=/stable/12/; revision=341772
|
| |
|
|
|
|
|
| |
rtld: parse FreeBSD Feature Control note on the object load.
Notes:
svn path=/stable/12/; revision=341687
|
| |
|
|
|
|
|
|
| |
rtld: when immediate bind mode is requested, process irelocs in PLT
immediately after other PLT relocs.
Notes:
svn path=/stable/12/; revision=341053
|
| |
|
|
|
|
|
|
|
| |
Initialize ifunc calling machinery earlier.
Approved by: re (gjb)
Notes:
svn path=/stable/12/; revision=340226
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously the combination of relro (implicit), -z now and ifunc use
resulted in a segfault when applying ifuncs after relro (test binary
here just calls amd64_get_fsbase()):
| % env LD_DEBUG=1 libexec/rtld-elf/obj/ld-elf.so.1 a.out
| ...
| enforcing main obj relro
| ...
| resolving ifuncs
| reloc_jmpslot: *0x203198 = 0x189368ea4570
| zsh: bus error (core dumped) LD_DEBUG=1 obj/ld-elf.so.1 ~/a.out
Approved by: re (gjb)
Notes:
svn path=/stable/12/; revision=340225
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
search_library_path().
This corrects the scope of libmap matches.
Reported and tested by: Andreas Longwitz <longwitz@incore.de>
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 1 week
Notes:
svn path=/head/; revision=338956
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The above commit fixed handling overaligned TLS segments in libc's
TLS Variant I implementation, but rtld provides its own implementation
for dynamically-linked executables which lacks these fixes. Thus,
port these changes to rtld.
This was previously commited as r337978 and reverted in r338149 due to
exposing a bug the ARM rtld. This bug was fixed in r338317 by mmel.
Submitted by: James Clarke
Approved by: re (kib)
Reviewed by: kbowling
Testing by: kbowling (powerpc64), br (riscv), kevans (armv7)
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D16510
Notes:
svn path=/head/; revision=338486
|
| |
|
|
|
|
|
|
|
|
| |
Michal Meloun reports that it breaks ctype (isspace()..) related
functions on armv7 so back out while we diagnose the issue.
Reported by: Michal Meloun <melounmichal@gmail.com>
Notes:
svn path=/head/; revision=338149
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The above commit fixed handling overaligned TLS segments in libc's
TLS Variant I implementation, but rtld provides its own implementation
for dynamically-linked executables which lacks these fixes. Thus,
port these changes to rtld.
Submitted by: James Clarke
Reviewed by: kbowling
Testing byL kbowling (powerpc64), br (riscv), kevans (armv7)
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D16510
Notes:
svn path=/head/; revision=337978
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
While here fix capitalization of a few nearby strings, add the
rtld's file name prefix so it's obvious where the message come
from, and return zero when "-h" is used.
Reviewed by: kib
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D16530
Notes:
svn path=/head/; revision=337067
|
| |
|
|
|
|
|
|
|
| |
Submitted by: Luis Pires
Reviewed by: brooks
Differential revision: https://reviews.freebsd.org/D15341
Notes:
svn path=/head/; revision=333398
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
objects' init functions instead of doing the setup via a constructor
in libc as the init functions may already depend on these handlers
to be in place. This gets us rid of:
- the undefined order in which libc constructors as __guard_setup()
and jemalloc_constructor() are executed WRT __sparc_utrap_setup(),
- the requirement to link libc last so __sparc_utrap_setup() gets
called prior to constructors in other libraries (see r122883).
For static binaries, crt1.o still sets up the user trap handlers.
o Move misplaced prototypes for MD functions in to the MD prototype
section of rtld.h.
o Sprinkle nitems().
Notes:
svn path=/head/; revision=328834
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.
The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
No functional change intended.
Notes:
svn path=/head/; revision=326274
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The result looks like this:
--- przed 2017-10-21 23:19:21.445034000 +0100
+++ po 2017-10-21 23:18:50.031865000 +0100
@@ -11,7 +11,6 @@ mmap(0x0,102,PROT_READ,MAP_PRIVATE,3,0x0) = 343665418
close(3) = 0 (0x0)
open("/usr/local/etc/libmap.d",O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC,0165) ERR#2 'No such file or directory'
munmap(0x80067d000,102) = 0 (0x0)
-access("/usr/local/lib/libintl.so.8",F_OK) = 0 (0x0)
openat(AT_FDCWD,"/usr/local/lib/libintl.so.8",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
fstat(3,{ mode=-rw-r--r-- ,inode=642560,size=55188,blksize=32768 }) = 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34366541824 (0x80067d000)
@@ -20,14 +19,13 @@ mmap(0x800877000,40960,PROT_READ|PROT_EXEC,MAP_PRIVATE
mmap(0x800a81000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0xa000) = 34370752512 (0x800a81000)
munmap(0x80067d000,4096) = 0 (0x0)
close(3) = 0 (0x0)
-access("/usr/local/lib/libc.so.7",F_OK) ERR#2 'No such file or directory'
+openat(AT_FDCWD,"/usr/local/lib/libc.so.7",O_RDONLY|O_CLOEXEC|O_VERIFY,00) ERR#2 'No such file or directory'
openat(AT_FDCWD,"/var/run/ld-elf.so.hints",O_RDONLY|O_CLOEXEC,00) = 3 (0x3)
read(3,"Ehnt\^A\0\0\0\M^@\0\0\0\M-2\0\0"...,128) = 128 (0x80)
fstat(3,{ mode=-r--r--r-- ,inode=970684,size=306,blksize=32768 }) = 0 (0x0)
lseek(3,0x80,SEEK_SET) = 128 (0x80)
read(3,"/lib:/usr/lib:/usr/lib/compat:/u"...,178) = 178 (0xb2)
close(3) = 0 (0x0)
-access("/lib/libc.so.7",F_OK) = 0 (0x0)
openat(AT_FDCWD,"/lib/libc.so.7",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=1605239,size=1910320,blksize=32768 }) = 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34366541824 (0x80067d000)
Reviewed by: kib
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12766
Notes:
svn path=/head/; revision=324953
|
| |
|
|
|
|
|
|
|
|
| |
from the binary startup code.
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Notes:
svn path=/head/; revision=324952
|
| |
|
|
|
|
|
|
|
| |
Suggested by: kib
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Notes:
svn path=/head/; revision=324951
|
| |
|
|
|
|
|
|
|
|
|
| |
which I'm going to do in a subsequent commit, would make it even uglier.
No functional changes.
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Notes:
svn path=/head/; revision=324950
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Newer binutils supports extensions to the MIPS ABI for non-PIC code
that is used when compiling O32 binaries with clang 5 (but not used
for N64 oddly enough). These extensions require support for
R_MIPS_COPY relocations as well as a second PLT GOT using
R_MIPS_JUMP_SLOT relocations.
For R_MIPS_COPY, use the same approach as on other architectures where
fixups are deferred to the MD do_copy_relocations.
The additional PLT GOT for jump slots is located in a .got.plt section
which is identified by a DT_MIPS_PLTGOT dynamic entry. This GOT also
requires fixups for the first two GOT entries just as the normal GOT.
However, the entry point for this second GOT uses a different calling
convention. Rather than passing an offset into the GOT, it passes an
offset into the .rel.plt section. This requires a second entry point
(_rtld_pltbind_start) which calls the normal _rtld_bind() rather than
_mips_rtld_bind(). This also means providing a real version of
reloc_jmpslot() which is used by _rtld_bind().
In addition, add real implementions of reloc_plt() and
reloc_jmpslots() which walk .rel.plt handling R_MIPS_JUMP_SLOT
relocations.
Reviewed by: kib
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D12326
Notes:
svn path=/head/; revision=323501
|
| |
|
|
|
|
|
|
|
|
|
| |
'obj' is not initialized here.
Reviewed by: kib
MFC after: 1 week
Sponsored by: DARPA / AFRL
Notes:
svn path=/head/; revision=323025
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
o Replace __riscv64 with (__riscv && __riscv_xlen == 64)
This is required to support new GCC 7.1 compiler.
This is compatible with current GCC 6.1 compiler.
RISC-V is extensible ISA and the idea here is to have built-in define
per each extension, so together with __riscv we will have some subset
of these as well (depending on -march string passed to compiler):
__riscv_compressed
__riscv_atomic
__riscv_mul
__riscv_div
__riscv_muldiv
__riscv_fdiv
__riscv_fsqrt
__riscv_float_abi_soft
__riscv_float_abi_single
__riscv_float_abi_double
__riscv_cmodel_medlow
__riscv_cmodel_medany
__riscv_cmodel_pic
__riscv_xlen
Reviewed by: ngie
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D11901
Notes:
svn path=/head/; revision=322168
|
| |
|
|
|
|
|
|
|
| |
Submitted by: Tatu Kilappa <tatu.kilappa@iki.fi>
PR: 221032
MFC after: 2 weeks
Notes:
svn path=/head/; revision=321607
|
| |
|
|
|
|
|
|
|
|
|
| |
always use >= instead of > to avoid truncation.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D11474
MFC after: 3 days
Notes:
svn path=/head/; revision=320665
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Use the standard syntax of name@version, I do not expect a confusion
due to unlikely possibility of the name containing the '@' character.
Requested by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Notes:
svn path=/head/; revision=320658
|