<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/libexec/rtld-elf/rtld_lock.c, branch releng/10.2</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F10.2</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F10.2'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2015-04-12T06:45:40Z</updated>
<entry>
<title>MFC r280816:</title>
<updated>2015-04-12T06:45:40Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2015-04-12T06:45:40Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=df043ea3b129c61608b141025365809ee5351563'/>
<id>urn:sha1:df043ea3b129c61608b141025365809ee5351563</id>
<content type='text'>
Change default visibility for rtld to hidden, on x86.
</content>
</entry>
<entry>
<title>MFC r266609:</title>
<updated>2014-06-07T02:45:24Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2014-06-07T02:45:24Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=14683010ac205ebe38bdf613d247876c78d7f77f'/>
<id>urn:sha1:14683010ac205ebe38bdf613d247876c78d7f77f</id>
<content type='text'>
Change the _rtld_atfork() to lock the bind lock in write mode.
</content>
</entry>
<entry>
<title>Rtld links with the specially built pic static libc library to get some</title>
<updated>2011-08-24T20:05:13Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2011-08-24T20:05:13Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0e9a2605200b721fdfcf32d2c95f79a81fc84352'/>
<id>urn:sha1:0e9a2605200b721fdfcf32d2c95f79a81fc84352</id>
<content type='text'>
C runtime services, like printf(). Unfortunately, the multithread-safeness
measures in the libc do not work in rtld environment.

Rip the kernel printf() implementation and use it in the rtld instead of
libc version. This printf does not require any shared global data and thus
is mt-safe. Systematically use rtld_printf() and related functions, remove
the calls to err(3).

Note that stdio is still pulled from libc due to libmap implementaion using
fopen(). This is safe but unoptimal, and can be changed later.

Reported and tested by:	pgj
Diagnosed and reviewed by:	kan (previous version)
Approved by:	re (bz)
</content>
</entry>
<entry>
<title>Use sigsetjmp/siglongjmp with disabled signal mask access for</title>
<updated>2011-02-09T09:20:27Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2011-02-09T09:20:27Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=a7bc470a84ecda53b360df72d35434bef1658131'/>
<id>urn:sha1:a7bc470a84ecda53b360df72d35434bef1658131</id>
<content type='text'>
lock upgrade in rtld. There is no need to care about the mask,
which causes a lot of unneeded sigprocmask(2) calls during each
symbol lookup.
</content>
</entry>
<entry>
<title>Implement support for ELF filters in rtld. Both normal and auxillary</title>
<updated>2010-12-25T08:51:20Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2010-12-25T08:51:20Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8569deaf1cba0d732647f0dae7eb5af2ee5fae1b'/>
<id>urn:sha1:8569deaf1cba0d732647f0dae7eb5af2ee5fae1b</id>
<content type='text'>
filters are implemented.

Filtees are loaded on demand, unless LD_LOADFLTR environment variable
is set or -z loadfltr was specified during the linking. This forces
rtld to upgrade read-locked rtld_bind_lock to write lock when it
encounters an object with filter during symbol lookup.

Consolidate common arguments of the symbol lookup functions in the
SymLook structure.  Track the state of the rtld locks in the
RtldLockState structure. Pass local RtldLockState through the rtld
symbol lookup calls to allow lock upgrades.

Reviewed by:	kan
Tested by:	Mykola Dzham &lt;i levsha me&gt;, nwhitehorn (powerpc)
</content>
</entry>
<entry>
<title>Prefer &lt;sys/param.h&gt; to &lt;machine/param.h&gt; for the definition of</title>
<updated>2009-04-20T10:35:50Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2009-04-20T10:35:50Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=3f2f85a6de550d6a78959495208c9adca7164804'/>
<id>urn:sha1:3f2f85a6de550d6a78959495208c9adca7164804</id>
<content type='text'>
CACHE_LINE_SIZE.

Submitted by:	bde
MFC after:	2 weeks
</content>
</entry>
<entry>
<title>Explicitly include machine/param.h for CACHE_LINE_SIZE.</title>
<updated>2009-04-19T23:03:57Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2009-04-19T23:03:57Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d9d845a99c807804103318ebf47c0152f710e765'/>
<id>urn:sha1:d9d845a99c807804103318ebf47c0152f710e765</id>
<content type='text'>
MFC after:	2 weeks
</content>
</entry>
<entry>
<title>Add two rtld exported symbols, _rtld_atfork_pre and _rtld_atfork_post.</title>
<updated>2008-11-27T11:27:59Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2008-11-27T11:27:59Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=cb5c4b10ba7c6d9f83b961c24be8f766ea6156c0'/>
<id>urn:sha1:cb5c4b10ba7c6d9f83b961c24be8f766ea6156c0</id>
<content type='text'>
Threading library calls _pre before the fork, allowing the rtld to
lock itself to ensure that other threads of the process are out of
dynamic linker. _post releases the locks.

This allows the rtld to have consistent state in the child. Although
child may legitimately call only async-safe functions, the call may
need plt relocation resolution, and this requires working rtld.

Reported and debugging help by:	rink
Reviewed by:	kan, davidxu
MFC after:	1 month (anyway, not before 7.1 is out)
</content>
</entry>
<entry>
<title>Allow multiple locks to be acquired by detecting corresponding</title>
<updated>2008-09-16T01:46:11Z</updated>
<author>
<name>David Xu</name>
<email>davidxu@FreeBSD.org</email>
</author>
<published>2008-09-16T01:46:11Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d8b04dc0d4f3031359b13b393b639c69f134b265'/>
<id>urn:sha1:d8b04dc0d4f3031359b13b393b639c69f134b265</id>
<content type='text'>
bit flag, otherwise if a thread acquired a lock, another thread
or the current thread itself can no longer acquire another lock
because thread_mask_set() return whole flag word, this results
bit leaking in the word and misbehavior in later locking and
unlocking.
</content>
</entry>
<entry>
<title>Fix the problem with the C++ exception handling for the multithreaded</title>
<updated>2008-05-06T09:27:41Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2008-05-06T09:27:41Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e91ff25c0c0b2bd0d7d8bd5b1c96457bf2bef352'/>
<id>urn:sha1:e91ff25c0c0b2bd0d7d8bd5b1c96457bf2bef352</id>
<content type='text'>
programs.

From the PR description:
The gcc runtime's _Unwind_Find_FDE function, invoked during exception
handling's stack unwinding, is not safe to execute from within multiple
threads. FreeBSD' s dl_iterate_phdr() however permits multiple threads
to pass through it though. The result is surprisingly reliable infinite
looping of one or more threads if they just happen to be unwinding at
the 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/123062
Submitted by:	Andy Newman &lt;an at atrn org&gt;
Reviewed by:	kan
MFC after:	2 weeks
</content>
</entry>
</feed>
