mailing list of musl libc
 help / color / mirror / code / Atom feed
* TLSDESC support added
@ 2014-06-19  7:50 Rich Felker
  0 siblings, 0 replies; only message in thread
From: Rich Felker @ 2014-06-19  7:50 UTC (permalink / raw)
  To: musl

I've just committed a series of changes that add TLSDESC support (so
far, i386 only, but that's mainly due to my lack of setup to test
anything else; expect other archs in the next day or two). Related
changes are detailed below:

1. Huge optimizations of __tls_get_addr

Dynamic TLS on musl should now be considerably faster than on glibc.
Several ingredients went into the optimization:

- Separating the __tls_get_addr common path from the slow path to
  "manually shrink-wrap" the function.

- Assembly code for ___tls_get_addr (3 underscores), the i386-specific
  function with a regparm calling convention, to actually do the work
  rather than pushing its argument to the stack and calling
  __tls_get_addr.

- Powerful new invariant: the DTV never contains gaps. Now a single
  comparison (rather than needing a comparison followed by a null
  check) is sufficient to determine whether TLS for a given module is
  alredy installed and directly accessible via the fast path.

These optimizations also (equally) affect the performance of dynamic
TLS using TLSDESC.

2. Refactoring to remove per-arch code duplication

Dynamic linker relocation operations are now all in dynlink.c rather
than being duplicated across arch-specific files. This will help avoid
subtle bugs when new archs are added or new features/reloc types are
added. It also gives consistent support for both REL and RELA type
reloc records across all archs.

3. Improved error handling/reporting

The error code in the dynamic linker has been conslidated, and it's
now able to report unknown reloc types rather than silently ignoring
them.

Further work on the dynamic linker will continue soon. Some tasks that
are still needed include:

- TLSDESC on all archs where it's defined.
- Checking x32 and fixing anything that's wrong.
- Better microblaze TLS support.
- Timing the new code. :-)

Rich


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-06-19  7:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-19  7:50 TLSDESC support added Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).