<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in rtld_lock.c</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>db4a2731 - rtld: initialize default dlerror_seen_val as true</title>
        <link>http://172.16.0.5:8080/history/freebsd-13.1/libexec/rtld-elf/rtld_lock.c#db4a2731</link>
        <description>rtld: initialize default dlerror_seen_val as truePR:	255698(cherry picked from commit 529ab5a75925c9c1eeea0b2712911048119d06ae)

            List of files:
            /freebsd-13.1/libexec/rtld-elf/rtld_lock.c</description>
        <pubDate>Tue, 11 May 2021 23:36:09 +0000</pubDate>
        <dc:creator>Konstantin Belousov &lt;kib@FreeBSD.org&gt;</dc:creator>
    </item>
<item>
        <title>7bbfb5d9 - rtld: make dlerror() thread-local</title>
        <link>http://172.16.0.5:8080/history/freebsd-13.1/libexec/rtld-elf/rtld_lock.c#7bbfb5d9</link>
        <description>rtld: make dlerror() thread-local(cherry picked from commit 4d9128da54f8f8e2a29190ffb18880c4f116a205)

            List of files:
            /freebsd-13.1/libexec/rtld-elf/rtld_lock.c</description>
        <pubDate>Wed, 07 Apr 2021 22:02:33 +0000</pubDate>
        <dc:creator>Konstantin Belousov &lt;kib@FreeBSD.org&gt;</dc:creator>
    </item>
<item>
        <title>b75aa0ea - rtld: workaround for broken ABI</title>
        <link>http://172.16.0.5:8080/history/freebsd-13.1/libexec/rtld-elf/rtld_lock.c#b75aa0ea</link>
        <description>rtld: workaround for broken ABI(cherry picked from commit 08bfbd43594b7642de0d2487550f36b0ee1eceba)

            List of files:
            /freebsd-13.1/libexec/rtld-elf/rtld_lock.c</description>
        <pubDate>Sat, 10 Apr 2021 12:32:24 +0000</pubDate>
        <dc:creator>Konstantin Belousov &lt;kib@FreeBSD.org&gt;</dc:creator>
    </item>
<item>
        <title>fe86eb8f - rtld: unstaticise lockinfo and obj_from_addr()</title>
        <link>http://172.16.0.5:8080/history/freebsd-13.1/libexec/rtld-elf/rtld_lock.c#fe86eb8f</link>
        <description>rtld: unstaticise lockinfo and obj_from_addr()(cherry picked from commit 4d7f08c84bcfcd75ba23b06e07a8e5dba1d4a44f)

            List of files:
            /freebsd-13.1/libexec/rtld-elf/rtld_lock.c</description>
        <pubDate>Sat, 10 Apr 2021 12:30:59 +0000</pubDate>
        <dc:creator>Konstantin Belousov &lt;kib@FreeBSD.org&gt;</dc:creator>
    </item>
<item>
        <title>aef199e5 - Use sigfastblock(2) in rtld.</title>
        <link>http://172.16.0.5:8080/history/freebsd-13.1/libexec/rtld-elf/rtld_lock.c#aef199e5</link>
        <description>Use sigfastblock(2) in rtld.This allows for rtld to not issue two sigprocmask(2) syscalls for eachsymbol binding operation in single-threaded processes.  Rtld needs toblock signals as part of locking to ensure signal safety of the bindprocess, because signal handlers might need to lazily resolve symbolreferences.As result, number of syscalls issued on startup by simple programs notusing libthr, is typically reduced 2x.  For instance, for hello world,I see:non-sigfastblock# (truss ./hello &gt; /dev/null) |&amp; wc -l      63sigfastblock# (truss ./hello &gt; /dev/null) |&amp; wc -l      37Tested by:	phoDisscussed with:	cem, emaste, jillesSponsored by:	The FreeBSD FoundationDifferential revision:	https://reviews.freebsd.org/D12773

            List of files:
            /freebsd-13.1/libexec/rtld-elf/rtld_lock.c</description>
        <pubDate>Sun, 09 Feb 2020 12:22:43 +0000</pubDate>
        <dc:creator>Konstantin Belousov &lt;kib@FreeBSD.org&gt;</dc:creator>
    </item>
<item>
        <title>b54a59f3 - Reduce size of rtld by 22% by pulling in less code from libc</title>
        <link>http://172.16.0.5:8080/history/freebsd-13.1/libexec/rtld-elf/rtld_lock.c#b54a59f3</link>
        <description>Reduce size of rtld by 22% by pulling in less code from libcCurrently RTLD is linked against libc_nossp_pic which means that any libcsymbol used in rtld can pull in a lot of depedencies. This was causingsymbol such as __libc_interposing and all the pthread stubs to be includedin RTLD even though they are not required. It turns out most of thesedependencies can easily be avoided by providing overrides inside of rtld.This change is motivated by CHERI, where we have an experimental ABI thatrequires additional relocation processing to allow the use of functionpointers inside of rtld. Instead of adding this self-relocation code toRTLD I attempted to remove most function pointers from RTLD and discoveredthat most of them came from the libc dependencies instead of being actuallyused inside rtld.A nice side-effect of this change is that rtld is now 22% smaller on amd64.   text	   data	    bss	    dec	    hex	filename0x21eb6	  0xce0	  0xe60	 145910	  239f6	/home/alr48/ld-elf-x86.before.so.10x1a6ed	  0x728	  0xdd8	 113645	  1bbed	/home/alr48/ld-elf-x86.after.so.1The number of R_X86_64_RELATIVE relocations that need to be processed onstartup has also gone down from 368 to 187 (almost 50% less).Reviewed By:	kibDifferential Revision: https://reviews.freebsd.org/D20663

            List of files:
            /freebsd-13.1/libexec/rtld-elf/rtld_lock.c</description>
        <pubDate>Sun, 30 Jun 2019 11:49:58 +0000</pubDate>
        <dc:creator>Alex Richardson &lt;arichardson@FreeBSD.org&gt;</dc:creator>
    </item>
<item>
        <title>3ab5b6bd - rtld-elf: fix more warnings to allow compiling with WARNS=6</title>
        <link>http://172.16.0.5:8080/history/freebsd-13.1/libexec/rtld-elf/rtld_lock.c#3ab5b6bd</link>
        <description>rtld-elf: fix more warnings to allow compiling with WARNS=6Reviewed By:	kibApproved By:	brooks (mentor)Differential Revision: https://reviews.freebsd.org/D17154

            List of files:
            /freebsd-13.1/libexec/rtld-elf/rtld_lock.c</description>
        <pubDate>Mon, 29 Oct 2018 21:08:28 +0000</pubDate>
        <dc:creator>Alex Richardson &lt;arichardson@FreeBSD.org&gt;</dc:creator>
    </item>
<item>
        <title>e6209940 - libexec: adoption of SPDX licensing ID tags.</title>
        <link>http://172.16.0.5:8080/history/freebsd-13.1/libexec/rtld-elf/rtld_lock.c#e6209940</link>
        <description>libexec: adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.No functional change intended.

            List of files:
            /freebsd-13.1/libexec/rtld-elf/rtld_lock.c</description>
        <pubDate>Mon, 27 Nov 2017 15:25:02 +0000</pubDate>
        <dc:creator>Pedro F. Giffuni &lt;pfg@FreeBSD.org&gt;</dc:creator>
    </item>
<item>
        <title>b88a8d3d - Fix acquisition of nested write compat rtld locks.</title>
        <link>http://172.16.0.5:8080/history/freebsd-13.1/libexec/rtld-elf/rtld_lock.c#b88a8d3d</link>
        <description>Fix acquisition of nested write compat rtld locks.Obtaining compat rtld lock in write mode sets process signal mask toblock all signals.  Previous mask is stored in the global variableoldsigmask.  If a lock is write-locked while another lock is alreadywrite-locked, oldsigmask is overwritten by the total mask and on thelast unlock, all signals except traps appear to be blocked.Fix this by counting the write-lock nested level, and only storing tooldsigmask/restoring from it at the outermost level.Masking signals disables involuntary preemption for libc_r, and therecould be no voluntary context switches in the locked code(dl_iterate_phdr(3) keeps a lock around user callback, but it wasadded long after libc_r was renounced).  Due to this, remembering thelevel in the global variable after the lock is obtained should besafe, because no two libc_r threads can acquire different write locksin parallel.PR:	215826Reported by:	kamiTested by:	yamagi@yamagi.org (previous version)To be reviewed by:	kanSponsored by:	The FreeBSD FoundationMFC after:	2 weeks

            List of files:
            /freebsd-13.1/libexec/rtld-elf/rtld_lock.c</description>
        <pubDate>Tue, 10 Jan 2017 19:26:55 +0000</pubDate>
        <dc:creator>Konstantin Belousov &lt;kib@FreeBSD.org&gt;</dc:creator>
    </item>
<item>
        <title>e7bfd34b - Use ANSI C definitions, update comment.</title>
        <link>http://172.16.0.5:8080/history/freebsd-13.1/libexec/rtld-elf/rtld_lock.c#e7bfd34b</link>
        <description>Use ANSI C definitions, update comment.Sponsored by:	The FreeBSD FoundationMFC after:	1 week

            List of files:
            /freebsd-13.1/libexec/rtld-elf/rtld_lock.c</description>
        <pubDate>Tue, 10 Jan 2017 17:05:34 +0000</pubDate>
        <dc:creator>Konstantin Belousov &lt;kib@FreeBSD.org&gt;</dc:creator>
    </item>
<item>
        <title>0c4f9ecd - Change compiler setting to make default visibility of the symbols for</title>
        <link>http://172.16.0.5:8080/history/freebsd-13.1/libexec/rtld-elf/rtld_lock.c#0c4f9ecd</link>
        <description>Change compiler setting to make default visibility of the symbols forrtld on x86 to be hidden.  This is a micro-optimization, which allowsintrinsic references inside rtld to be handled without indirectionthrough PLT.  The visibility of rtld symbols for other objects in thesymbol namespace is controlled by a version script.Reviewed by:	kan, jillesSponsored by:	The FreeBSD FoundationMFC after:	2 weeks

            List of files:
            /freebsd-13.1/libexec/rtld-elf/rtld_lock.c</description>
        <pubDate>Sun, 29 Mar 2015 18:53:21 +0000</pubDate>
        <dc:creator>Konstantin Belousov &lt;kib@FreeBSD.org&gt;</dc:creator>
    </item>
<item>
        <title>1c70d007 - Right now, the rtld prefork hook locks the rtld bind lock in the read</title>
        <link>http://172.16.0.5:8080/history/freebsd-13.1/libexec/rtld-elf/rtld_lock.c#1c70d007</link>
        <description>Right now, the rtld prefork hook locks the rtld bind lock in the readmode.  This allows the binder to be functional in the child after thefork (assuming no lazy loading of a filter is needed), but other rtldservices which require write lock on rtld_bind_lock cause deadlock, ifcalled by child.Change the _rtld_atfork() to lock the bind lock in write mode, makingthe rtld fully functional after the fork.Pre-resolve the symbols which are called by the libthr&apos; fork()interposer, since dynamic resolution causes deadlock due to thertld_bind_lock already owned in the write mode.Reported and tested by:	phoSponsored by:	The FreeBSD FoundationMFC after:	2 weeks

            List of files:
            /freebsd-13.1/libexec/rtld-elf/rtld_lock.c</description>
        <pubDate>Sat, 24 May 2014 10:23:06 +0000</pubDate>
        <dc:creator>Konstantin Belousov &lt;kib@FreeBSD.org&gt;</dc:creator>
    </item>
<item>
        <title>0e9a2605 - Rtld links with the specially built pic static libc library to get some</title>
        <link>http://172.16.0.5:8080/history/freebsd-13.1/libexec/rtld-elf/rtld_lock.c#0e9a2605</link>
        <description>Rtld links with the specially built pic static libc library to get someC runtime services, like printf(). Unfortunately, the multithread-safenessmeasures in the libc do not work in rtld environment.Rip the kernel printf() implementation and use it in the rtld instead oflibc version. This printf does not require any shared global data and thusis mt-safe. Systematically use rtld_printf() and related functions, removethe calls to err(3).Note that stdio is still pulled from libc due to libmap implementaion usingfopen(). This is safe but unoptimal, and can be changed later.Reported and tested by:	pgjDiagnosed and reviewed by:	kan (previous version)Approved by:	re (bz)

            List of files:
            /freebsd-13.1/libexec/rtld-elf/rtld_lock.c</description>
        <pubDate>Wed, 24 Aug 2011 20:05:13 +0000</pubDate>
        <dc:creator>Konstantin Belousov &lt;kib@FreeBSD.org&gt;</dc:creator>
    </item>
<item>
        <title>a7bc470a - Use sigsetjmp/siglongjmp with disabled signal mask access for</title>
        <link>http://172.16.0.5:8080/history/freebsd-13.1/libexec/rtld-elf/rtld_lock.c#a7bc470a</link>
        <description>Use sigsetjmp/siglongjmp with disabled signal mask access forlock upgrade in rtld. There is no need to care about the mask,which causes a lot of unneeded sigprocmask(2) calls during eachsymbol lookup.

            List of files:
            /freebsd-13.1/libexec/rtld-elf/rtld_lock.c</description>
        <pubDate>Wed, 09 Feb 2011 09:20:27 +0000</pubDate>
        <dc:creator>Konstantin Belousov &lt;kib@FreeBSD.org&gt;</dc:creator>
    </item>
<item>
        <title>8569deaf - Implement support for ELF filters in rtld. Both normal and auxillary</title>
        <link>http://172.16.0.5:8080/history/freebsd-13.1/libexec/rtld-elf/rtld_lock.c#8569deaf</link>
        <description>Implement support for ELF filters in rtld. Both normal and auxillaryfilters are implemented.Filtees are loaded on demand, unless LD_LOADFLTR environment variableis set or -z loadfltr was specified during the linking. This forcesrtld to upgrade read-locked rtld_bind_lock to write lock when itencounters an object with filter during symbol lookup.Consolidate common arguments of the symbol lookup functions in theSymLook structure.  Track the state of the rtld locks in theRtldLockState structure. Pass local RtldLockState through the rtldsymbol lookup calls to allow lock upgrades.Reviewed by:	kanTested by:	Mykola Dzham &lt;i levsha me&gt;, nwhitehorn (powerpc)

            List of files:
            /freebsd-13.1/libexec/rtld-elf/rtld_lock.c</description>
        <pubDate>Sat, 25 Dec 2010 08:51:20 +0000</pubDate>
        <dc:creator>Konstantin Belousov &lt;kib@FreeBSD.org&gt;</dc:creator>
    </item>
<item>
        <title>3f2f85a6 - Prefer &lt;sys/param.h&gt; to &lt;machine/param.h&gt; for the definition of</title>
        <link>http://172.16.0.5:8080/history/freebsd-13.1/libexec/rtld-elf/rtld_lock.c#3f2f85a6</link>
        <description>Prefer &lt;sys/param.h&gt; to &lt;machine/param.h&gt; for the definition ofCACHE_LINE_SIZE.Submitted by:	bdeMFC after:	2 weeks

            List of files:
            /freebsd-13.1/libexec/rtld-elf/rtld_lock.c</description>
        <pubDate>Mon, 20 Apr 2009 10:35:50 +0000</pubDate>
        <dc:creator>Robert Watson &lt;rwatson@FreeBSD.org&gt;</dc:creator>
    </item>
<item>
        <title>d9d845a9 - Explicitly include machine/param.h for CACHE_LINE_SIZE.</title>
        <link>http://172.16.0.5:8080/history/freebsd-13.1/libexec/rtld-elf/rtld_lock.c#d9d845a9</link>
        <description>Explicitly include machine/param.h for CACHE_LINE_SIZE.MFC after:	2 weeks

            List of files:
            /freebsd-13.1/libexec/rtld-elf/rtld_lock.c</description>
        <pubDate>Sun, 19 Apr 2009 23:03:57 +0000</pubDate>
        <dc:creator>Robert Watson &lt;rwatson@FreeBSD.org&gt;</dc:creator>
    </item>
<item>
        <title>cb5c4b10 - Add two rtld exported symbols, _rtld_atfork_pre and _rtld_atfork_post.</title>
        <link>http://172.16.0.5:8080/history/freebsd-13.1/libexec/rtld-elf/rtld_lock.c#cb5c4b10</link>
        <description>Add two rtld exported symbols, _rtld_atfork_pre and _rtld_atfork_post.Threading library calls _pre before the fork, allowing the rtld tolock itself to ensure that other threads of the process are out ofdynamic linker. _post releases the locks.This allows the rtld to have consistent state in the child. Althoughchild may legitimately call only async-safe functions, the call mayneed plt relocation resolution, and this requires working rtld.Reported and debugging help by:	rinkReviewed by:	kan, davidxuMFC after:	1 month (anyway, not before 7.1 is out)

            List of files:
            /freebsd-13.1/libexec/rtld-elf/rtld_lock.c</description>
        <pubDate>Thu, 27 Nov 2008 11:27:59 +0000</pubDate>
        <dc:creator>Konstantin Belousov &lt;kib@FreeBSD.org&gt;</dc:creator>
    </item>
<item>
        <title>d8b04dc0 - Allow multiple locks to be acquired by detecting corresponding</title>
        <link>http://172.16.0.5:8080/history/freebsd-13.1/libexec/rtld-elf/rtld_lock.c#d8b04dc0</link>
        <description>Allow multiple locks to be acquired by detecting correspondingbit flag, otherwise if a thread acquired a lock, another threador the current thread itself can no longer acquire another lockbecause thread_mask_set() return whole flag word, this resultsbit leaking in the word and misbehavior in later locking andunlocking.

            List of files:
            /freebsd-13.1/libexec/rtld-elf/rtld_lock.c</description>
        <pubDate>Tue, 16 Sep 2008 01:46:11 +0000</pubDate>
        <dc:creator>David Xu &lt;davidxu@FreeBSD.org&gt;</dc:creator>
    </item>
<item>
        <title>e91ff25c - Fix the problem with the C++ exception handling for the multithreaded</title>
        <link>http://172.16.0.5:8080/history/freebsd-13.1/libexec/rtld-elf/rtld_lock.c#e91ff25c</link>
        <description>Fix the problem with the C++ exception handling for the multithreadedprograms.From the PR description:The gcc runtime&apos;s _Unwind_Find_FDE function, invoked during exceptionhandling&apos;s stack unwinding, is not safe to execute from within multiplethreads. FreeBSD&apos; s dl_iterate_phdr() however permits multiple threadsto pass through it though. The result is surprisingly reliable infinitelooping of one or more threads if they just happen to be unwinding atthe same time.Introduce the new lock that is write locked around the dl_iterate_pdr,thus providing required exclusion for the stack unwinders.PR:	threads/123062Submitted by:	Andy Newman &lt;an at atrn org&gt;Reviewed by:	kanMFC after:	2 weeks

            List of files:
            /freebsd-13.1/libexec/rtld-elf/rtld_lock.c</description>
        <pubDate>Tue, 06 May 2008 09:27:41 +0000</pubDate>
        <dc:creator>Konstantin Belousov &lt;kib@FreeBSD.org&gt;</dc:creator>
    </item>
</channel>
</rss>
