glibc/csu
Siddhesh Poyarekar 67e58f3941 Add framework for tunables
The tunables framework allows us to uniformly manage and expose global
variables inside glibc as switches to users.  tunables/README has
instructions for glibc developers to add new tunables.

Tunables support can be enabled by passing the --enable-tunables
configure flag to the configure script.  This patch only adds a
framework and does not pose any limitations on how tunable values are
read from the user.  It also adds environment variables used in malloc
behaviour tweaking to the tunables framework as a PoC of the
compatibility interface.

	* manual/install.texi: Add --enable-tunables option.
	* INSTALL: Regenerate.
	* README.tunables: New file.
	* Makeconfig (CPPFLAGS): Define TOP_NAMESPACE.
	(before-compile): Generate dl-tunable-list.h early.
	* config.h.in: Add HAVE_TUNABLES.
	* config.make.in: Add have-tunables.
	* configure.ac: Add --enable-tunables option.
	* configure: Regenerate.
	* csu/init-first.c (__libc_init_first): Move
	__libc_init_secure earlier...
	* csu/init-first.c (LIBC_START_MAIN):... to here.
	Include dl-tunables.h, libc-internal.h.
	(LIBC_START_MAIN) [!SHARED]: Initialize tunables for static
	binaries.
	* elf/Makefile (dl-routines): Add dl-tunables.
	* elf/Versions (ld): Add __tunable_set_val to GLIBC_PRIVATE
	namespace.
	* elf/dl-support (_dl_nondynamic_init): Unset MALLOC_CHECK_
	only when !HAVE_TUNABLES.
	* elf/rtld.c (process_envvars): Likewise.
	* elf/dl-sysdep.c [HAVE_TUNABLES]: Include dl-tunables.h
	(_dl_sysdep_start): Call __tunables_init.
	* elf/dl-tunable-types.h: New file.
	* elf/dl-tunables.c: New file.
	* elf/dl-tunables.h: New file.
	* elf/dl-tunables.list: New file.
	* malloc/tst-malloc-usable-static.c: New test case.
	* malloc/Makefile (tests-static): Add it.
	* malloc/arena.c [HAVE_TUNABLES]: Include dl-tunables.h.
	Define TUNABLE_NAMESPACE.
	(DL_TUNABLE_CALLBACK (set_mallopt_check)): New function.
	(DL_TUNABLE_CALLBACK_FNDECL): New macro.  Use it to define
	callback functions.
	(ptmalloc_init): Set tunable values.
	* scripts/gen-tunables.awk: New file.
	* sysdeps/mach/hurd/dl-sysdep.c: Include dl-tunables.h.
	(_dl_sysdep_start): Call __tunables_init.
2016-12-31 23:49:24 +05:30
..
Makefile Disable stack protector in early static initialization [BZ #7065] 2016-12-26 10:08:45 +01:00
Versions Remove unused %include lines from Versions files. 2014-02-22 00:58:54 -08:00
abi-note.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
check_fds.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dso_handle.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
elf-init.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
errno-loc.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
errno.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
gmon-start.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
init-first.c Add framework for tunables 2016-12-31 23:49:24 +05:30
init.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
libc-start.c Add framework for tunables 2016-12-31 23:49:24 +05:30
libc-tls.c Initialize the stack guard earlier when linking statically [BZ #7065] 2016-12-26 10:08:34 +01:00
start.c More fallout from supporting only ELF 2012-01-08 00:45:01 -05:00
sysdep.c Moved to csu/errno-loc.c. 2005-12-14 15:06:39 +00:00
version.c Update copyright dates not handled by scripts/update-copyrights. 2016-01-04 16:26:30 +00:00