Fix initial exec TLS mode for dynamically loaded shared objects.If dso uses initial exec TLS mode, rtld tries to allocate TLS instatic space. If there is no space left, the dlopen(3) fails. If spa
Fix initial exec TLS mode for dynamically loaded shared objects.If dso uses initial exec TLS mode, rtld tries to allocate TLS instatic space. If there is no space left, the dlopen(3) fails. If spaceif allocated, initial content from PT_TLS segment is distributed toall threads' pcbs, which was missed and caused un-initialized TLSsegment for such dso after dlopen(3).The mode is auto-detected either due to the relocation used, or if theDF_STATIC_TLS dynamic flag is set. In the later case, the TLS segmentis tried to allocate earlier, which increases chance of the dlopen(3)to succeed. LLD was recently fixed to properly emit the flag, ld.bdfdid it always.Initial test by: dumbbellTested by: emaste (amd64), ian (arm)Tested by: Gerald Aryeetey <aryeeteygerald_rogers.com> (arm64)Sponsored by: The FreeBSD FoundationMFC after: 2 weeksDifferential revision: https://reviews.freebsd.org/D19072
show more ...
lib: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using mis-identified many licenses so this was mostly a manual - errorpr
lib: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using mis-identified 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.
Fix misleading comment.Not a functional change.MFC after: 3 days
libthr: fix warnings at WARNS=6Fix more warnings about redundant declarations.Reviewed by: kib emasteMFC after: 3 daysSponsored by: Dell EMCDifferential Revision: https://reviews.freebsd.org/D
libthr: fix warnings at WARNS=6Fix more warnings about redundant declarations.Reviewed by: kib emasteMFC after: 3 daysSponsored by: Dell EMCDifferential Revision: https://reviews.freebsd.org/D10932
Merge all the copies of _tcb_ctor and _tcb_dtor.The amd64, i386, and sparc64 versions were identical, with the onedifference where the former two used inline asm instead of _tcb_get. Ihave compar
Merge all the copies of _tcb_ctor and _tcb_dtor.The amd64, i386, and sparc64 versions were identical, with the onedifference where the former two used inline asm instead of _tcb_get. Ihave compared the function before and after replacing the asm with _tcb_getand found the object files to be identical.The arm, mips, and powerpc versions were almost identical. The onlydifference was the powerpc version used an alignment of 1 where arm andmips used 16. As this is an increase in alignment is will be safe.Along with this arm, mips, and powerpc all passed, when initial was true,the value returned from _tcb_get as the first argument to_rtld_allocate_tls. This would then return this pointer back to the caller.We can remove these extra calls by checking if initial is set and settingthe thread control block directly. As this is what the sparc64 code doeswe can use it directly.As after these observations all the architectures can now have identicalcode we can merge them into a common file.Differential Revision: https://reviews.freebsd.org/D1556Reviewed by: kibSponsored by: The FreeBSD Foundation
Merging of projects/armv6, part 2Handle TLS for ARMv6 and ARMv7
Add thread-local storage support for arm:- Switch to Variant I TCB layout- Use function from rtld for TCB allocation/deallocation
style(9)
- Remove variable _thr_scope_system, all threads are system scope.- Rename _thr_smp_cpus to boolean variable _thr_is_smp.- Define CPU_SPINWAIT macro for each arch, only X86 supports it.
Remove unused variable.Reviewed by: cognet
Use the new atomic_cmpset_32().
Import my recent 1:1 threading working. some features improved includes: 1. fast simple type mutex. 2. __thread tls works. 3. asynchronous cancellation works ( using signal ). 4. thread synchroni
Import my recent 1:1 threading working. some features improved includes: 1. fast simple type mutex. 2. __thread tls works. 3. asynchronous cancellation works ( using signal ). 4. thread synchronization is fully based on umtx, mainly, condition variable and other synchronization objects were rewritten by using umtx directly. those objects can be shared between processes via shared memory, it has to change ABI which does not happen yet. 5. default stack size is increased to 1M on 32 bits platform, 2M for 64 bits platform.As the result, some mysql super-smack benchmarks show performance isimproved massivly.Okayed by: jeff, mtm, rwatson, scottl