<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/glibc.git, branch hjl/pr17841/master</title>
<subtitle>sourceware.org: git/glibc.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/'/>
<entry>
<title>Compile archives with -fno-pie</title>
<updated>2015-05-28T13:08:28+00:00</updated>
<author>
<name>H.J. Lu</name>
<email>hjl.tools@gmail.com</email>
</author>
<published>2015-03-02T22:53:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/commit/?id=ca1f728cbefd6955735087e45d80620113623b3b'/>
<id>ca1f728cbefd6955735087e45d80620113623b3b</id>
<content type='text'>
When compiler defaults to PIE, we compile archives with -fno-pie.   Since
archives won't be used with PIE, compile them with -fpie isn't necessary.

	[BZ #17841]
	* Makeconfig (no-pie-ccflag): New.  Set to -fno-pie.
	(pic-default): Don't define if $(no-pie-ccflag) is -fno-pie.
	(test-object-suffix): New.
	* Makerules (archive-objects): New.  Set before including
	extra-lib.mk.
	($(archive-objects)): New. New rule to append $(no-pie-ccflag)
	to CFLAGS.
	* extra-lib.mk (archive-objects): New.
	* crypt/Makefile ($(objpfx)md5test): Replace ".o" with
	$(test-object-suffix).
	($(objpfx)md5test-giant): Likewise.
	($(objpfx)sha256test): Likewise.
	($(objpfx)sha512test): Likewise.
	* math/Makefile (LDFLAGS-atest-exp): New.
	(LDFLAGS-atest-sincos): Likewise.
	(LDFLAGS-atest-exp2): Likewise.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When compiler defaults to PIE, we compile archives with -fno-pie.   Since
archives won't be used with PIE, compile them with -fpie isn't necessary.

	[BZ #17841]
	* Makeconfig (no-pie-ccflag): New.  Set to -fno-pie.
	(pic-default): Don't define if $(no-pie-ccflag) is -fno-pie.
	(test-object-suffix): New.
	* Makerules (archive-objects): New.  Set before including
	extra-lib.mk.
	($(archive-objects)): New. New rule to append $(no-pie-ccflag)
	to CFLAGS.
	* extra-lib.mk (archive-objects): New.
	* crypt/Makefile ($(objpfx)md5test): Replace ".o" with
	$(test-object-suffix).
	($(objpfx)md5test-giant): Likewise.
	($(objpfx)sha256test): Likewise.
	($(objpfx)sha512test): Likewise.
	* math/Makefile (LDFLAGS-atest-exp): New.
	(LDFLAGS-atest-sincos): Likewise.
	(LDFLAGS-atest-exp2): Likewise.
</pre>
</div>
</content>
</entry>
<entry>
<title>Support compilers defaulting to PIE</title>
<updated>2015-05-28T12:54:04+00:00</updated>
<author>
<name>H.J. Lu</name>
<email>hjl.tools@gmail.com</email>
</author>
<published>2015-01-14T14:29:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/commit/?id=1ea33bb5517516d1d1005b953c92a071454e66d5'/>
<id>1ea33bb5517516d1d1005b953c92a071454e66d5</id>
<content type='text'>
To support building glibc with GCC 6 configured with --enable-default-pie,
which generates PIE by default, we need to build programs as PIE.  But
elf/tst-dlopen-aout must not be built as PIE since it tests dlopen on
ET_EXEC file and PIE is ET_DYN.

	[BZ #17841]
	* Makeconfig (no-pie-ldflag): New.
	(+link): Set to $(+link-pie) if default to PIE.
	(+link-tests): Set to $(+link-pie-tests) if default to PIE.
	* config.make.in (build-pie-default): New.
	* configure.ac (libc_cv_pie_default): New.  Set to yes if -fPIE
	is default.  AC_SUBST.
	* configure: Regenerated.
	* elf/Makefile (LDFLAGS-tst-dlopen-aout): New.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To support building glibc with GCC 6 configured with --enable-default-pie,
which generates PIE by default, we need to build programs as PIE.  But
elf/tst-dlopen-aout must not be built as PIE since it tests dlopen on
ET_EXEC file and PIE is ET_DYN.

	[BZ #17841]
	* Makeconfig (no-pie-ldflag): New.
	(+link): Set to $(+link-pie) if default to PIE.
	(+link-tests): Set to $(+link-pie-tests) if default to PIE.
	* config.make.in (build-pie-default): New.
	* configure.ac (libc_cv_pie_default): New.  Set to yes if -fPIE
	is default.  AC_SUBST.
	* configure: Regenerated.
	* elf/Makefile (LDFLAGS-tst-dlopen-aout): New.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make sure that calloc is called at least once</title>
<updated>2015-05-28T12:06:53+00:00</updated>
<author>
<name>H.J. Lu</name>
<email>hjl.tools@gmail.com</email>
</author>
<published>2015-05-28T12:06:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/commit/?id=58007e9e68913290b1f4f73afc1055f779a8ed5d'/>
<id>58007e9e68913290b1f4f73afc1055f779a8ed5d</id>
<content type='text'>
PLT relocations aren't required when -z now used.  Linker on master with:

commit 25070364b0ce33eed46aa5d78ebebbec6accec7e
Author: H.J. Lu &lt;hjl.tools@gmail.com&gt;
Date:   Sat May 16 07:00:21 2015 -0700

    Don't generate PLT relocations for now binding

    There is no need for PLT relocations with -z now. We can use GOT
    relocations, which take less space, instead and replace 16-byte .plt
    entres with 8-byte .plt.got entries.

    bfd/

      * elf32-i386.c (elf_i386_check_relocs): Create .plt.got section
      for now binding.
      (elf_i386_allocate_dynrelocs): Use .plt.got section for now
      binding.
      * elf64-x86-64.c (elf_x86_64_check_relocs): Create .plt.got
      section for now binding.
      (elf_x86_64_allocate_dynrelocs): Use .plt.got section for now
      binding.

won't generate PLT relocations with -z now.  elf/tst-audit2.c expect
certain order of execution in ld.so.  With PLT relocations, the GOTPLT
entry of calloc is update to calloc defined in tst-audit2:

(gdb) bt
    skip_ifunc=&lt;optimized out&gt;, reloc_addr_arg=&lt;optimized out&gt;,
    version=&lt;optimized out&gt;, sym=&lt;optimized out&gt;, map=&lt;optimized out&gt;)
    at ../sysdeps/i386/dl-machine.h:329
out&gt;,
    nrelative=&lt;optimized out&gt;, relsize=&lt;optimized out&gt;,
    reladdr=&lt;optimized out&gt;, map=&lt;optimized out&gt;) at do-rel.h:137
reloc_mode=reloc_mode@entry=0,
    consider_profiling=1, consider_profiling@entry=0) at dl-reloc.c:258
    user_entry=0xffffcf1c, auxv=0xffffd0a8) at rtld.c:2133
    start_argptr=start_argptr@entry=0xffffcfb0,
    dl_main=dl_main@entry=0xf7fda6f0 &lt;dl_main&gt;) at
../elf/dl-sysdep.c:249
   from /export/build/gnu/glibc-32bit/build-i686-linux/elf/ld.so
(gdb)

and then calloc is called:

(gdb) c
Continuing.

Breakpoint 4, calloc (n=n@entry=20, m=4) at tst-audit2.c:18
18 {
(gdb) bt
    reloc_mode=reloc_mode@entry=0, consider_profiling=1,
    consider_profiling@entry=0) at dl-reloc.c:272
    user_entry=0xffffcf1c, auxv=0xffffd0a8) at rtld.c:2133
    start_argptr=start_argptr@entry=0xffffcfb0,
    dl_main=dl_main@entry=0xf7fda6f0 &lt;dl_main&gt;) at
../elf/dl-sysdep.c:249
   from /export/build/gnu/glibc-32bit/build-i686-linux/elf/ld.so
(gdb)

With GOT relocation, calloc in ld.so is called first:

(gdb) bt
    consider_profiling=1) at dl-reloc.c:272
    user_entry=0xffffcf0c, auxv=0xffffd098) at rtld.c:2074
    start_argptr=start_argptr@entry=0xffffcfa0,
    dl_main=dl_main@entry=0xf7fda6c0 &lt;dl_main&gt;) at
../elf/dl-sysdep.c:249
   from /export/build/gnu/glibc-32bit-test/build-i686-linux/elf/ld.so
(gdb)

and then the GOT entry of calloc is updated:

(gdb) bt
    skip_ifunc=&lt;optimized out&gt;, reloc_addr_arg=&lt;optimized out&gt;,
    version=&lt;optimized out&gt;, sym=&lt;optimized out&gt;, map=&lt;optimized out&gt;)
    at ../sysdeps/i386/dl-machine.h:329
out&gt;,
    nrelative=&lt;optimized out&gt;, relsize=&lt;optimized out&gt;,
    reladdr=&lt;optimized out&gt;, map=&lt;optimized out&gt;) at do-rel.h:137
reloc_mode=reloc_mode@entry=0,
    consider_profiling=1, consider_profiling@entry=0) at dl-reloc.c:258
    user_entry=0xffffcf0c, auxv=0xffffd098) at rtld.c:2133
    start_argptr=start_argptr@entry=0xffffcfa0,
    dl_main=dl_main@entry=0xf7fda6c0 &lt;dl_main&gt;) at
../elf/dl-sysdep.c:249
   from /export/build/gnu/glibc-32bit-test/build-i686-linux/elf/ld.so
(gdb)

After that, since calloc isn't called from ld.so nor any other modules,
magic in tst-audit2 isn't updated.  Both orders are correct.  This patch
makes sure that calloc in tst-audit2.c is called at least once from ld.so.

	[BZ #18422]
	* Makefile ($(objpfx)tst-audit2): Depend on $(libdl).
	($(objpfx)tst-audit2.out): Also depend on
	$(objpfx)tst-auditmod9b.so.
	* elf/tst-audit2.c: Include &lt;dlfcn.h&gt;.
	(calloc_called): New.
	(calloc): Allow to be called more than once.
	(do_test): dllopen/dlclose $ORIGIN/tst-auditmod9b.so.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PLT relocations aren't required when -z now used.  Linker on master with:

commit 25070364b0ce33eed46aa5d78ebebbec6accec7e
Author: H.J. Lu &lt;hjl.tools@gmail.com&gt;
Date:   Sat May 16 07:00:21 2015 -0700

    Don't generate PLT relocations for now binding

    There is no need for PLT relocations with -z now. We can use GOT
    relocations, which take less space, instead and replace 16-byte .plt
    entres with 8-byte .plt.got entries.

    bfd/

      * elf32-i386.c (elf_i386_check_relocs): Create .plt.got section
      for now binding.
      (elf_i386_allocate_dynrelocs): Use .plt.got section for now
      binding.
      * elf64-x86-64.c (elf_x86_64_check_relocs): Create .plt.got
      section for now binding.
      (elf_x86_64_allocate_dynrelocs): Use .plt.got section for now
      binding.

won't generate PLT relocations with -z now.  elf/tst-audit2.c expect
certain order of execution in ld.so.  With PLT relocations, the GOTPLT
entry of calloc is update to calloc defined in tst-audit2:

(gdb) bt
    skip_ifunc=&lt;optimized out&gt;, reloc_addr_arg=&lt;optimized out&gt;,
    version=&lt;optimized out&gt;, sym=&lt;optimized out&gt;, map=&lt;optimized out&gt;)
    at ../sysdeps/i386/dl-machine.h:329
out&gt;,
    nrelative=&lt;optimized out&gt;, relsize=&lt;optimized out&gt;,
    reladdr=&lt;optimized out&gt;, map=&lt;optimized out&gt;) at do-rel.h:137
reloc_mode=reloc_mode@entry=0,
    consider_profiling=1, consider_profiling@entry=0) at dl-reloc.c:258
    user_entry=0xffffcf1c, auxv=0xffffd0a8) at rtld.c:2133
    start_argptr=start_argptr@entry=0xffffcfb0,
    dl_main=dl_main@entry=0xf7fda6f0 &lt;dl_main&gt;) at
../elf/dl-sysdep.c:249
   from /export/build/gnu/glibc-32bit/build-i686-linux/elf/ld.so
(gdb)

and then calloc is called:

(gdb) c
Continuing.

Breakpoint 4, calloc (n=n@entry=20, m=4) at tst-audit2.c:18
18 {
(gdb) bt
    reloc_mode=reloc_mode@entry=0, consider_profiling=1,
    consider_profiling@entry=0) at dl-reloc.c:272
    user_entry=0xffffcf1c, auxv=0xffffd0a8) at rtld.c:2133
    start_argptr=start_argptr@entry=0xffffcfb0,
    dl_main=dl_main@entry=0xf7fda6f0 &lt;dl_main&gt;) at
../elf/dl-sysdep.c:249
   from /export/build/gnu/glibc-32bit/build-i686-linux/elf/ld.so
(gdb)

With GOT relocation, calloc in ld.so is called first:

(gdb) bt
    consider_profiling=1) at dl-reloc.c:272
    user_entry=0xffffcf0c, auxv=0xffffd098) at rtld.c:2074
    start_argptr=start_argptr@entry=0xffffcfa0,
    dl_main=dl_main@entry=0xf7fda6c0 &lt;dl_main&gt;) at
../elf/dl-sysdep.c:249
   from /export/build/gnu/glibc-32bit-test/build-i686-linux/elf/ld.so
(gdb)

and then the GOT entry of calloc is updated:

(gdb) bt
    skip_ifunc=&lt;optimized out&gt;, reloc_addr_arg=&lt;optimized out&gt;,
    version=&lt;optimized out&gt;, sym=&lt;optimized out&gt;, map=&lt;optimized out&gt;)
    at ../sysdeps/i386/dl-machine.h:329
out&gt;,
    nrelative=&lt;optimized out&gt;, relsize=&lt;optimized out&gt;,
    reladdr=&lt;optimized out&gt;, map=&lt;optimized out&gt;) at do-rel.h:137
reloc_mode=reloc_mode@entry=0,
    consider_profiling=1, consider_profiling@entry=0) at dl-reloc.c:258
    user_entry=0xffffcf0c, auxv=0xffffd098) at rtld.c:2133
    start_argptr=start_argptr@entry=0xffffcfa0,
    dl_main=dl_main@entry=0xf7fda6c0 &lt;dl_main&gt;) at
../elf/dl-sysdep.c:249
   from /export/build/gnu/glibc-32bit-test/build-i686-linux/elf/ld.so
(gdb)

After that, since calloc isn't called from ld.so nor any other modules,
magic in tst-audit2 isn't updated.  Both orders are correct.  This patch
makes sure that calloc in tst-audit2.c is called at least once from ld.so.

	[BZ #18422]
	* Makefile ($(objpfx)tst-audit2): Depend on $(libdl).
	($(objpfx)tst-audit2.out): Also depend on
	$(objpfx)tst-auditmod9b.so.
	* elf/tst-audit2.c: Include &lt;dlfcn.h&gt;.
	(calloc_called): New.
	(calloc): Allow to be called more than once.
	(do_test): dllopen/dlclose $ORIGIN/tst-auditmod9b.so.
</pre>
</div>
</content>
</entry>
<entry>
<title>2015-05-28  Wilco Dijkstra  &lt;wdijkstr@arm.com&gt;</title>
<updated>2015-05-28T10:42:55+00:00</updated>
<author>
<name>Wilco Dijkstra</name>
<email>wdijkstr@arm.com</email>
</author>
<published>2015-05-28T10:42:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/commit/?id=be2e25bbd78f9fdf27bed254d02915d019c5b363'/>
<id>be2e25bbd78f9fdf27bed254d02915d019c5b363</id>
<content type='text'>
        * sysdeps/ieee754/dbl-64/s_fabs.c: (__fabs): Call __builtin_fabs.
        * sysdeps/ieee754/flt-32/s_fabsf.c: (__fabsf): Likewise.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
        * sysdeps/ieee754/dbl-64/s_fabs.c: (__fabs): Call __builtin_fabs.
        * sysdeps/ieee754/flt-32/s_fabsf.c: (__fabsf): Likewise.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix monetary.h comment</title>
<updated>2015-05-27T02:37:07+00:00</updated>
<author>
<name>Marko Myllynen</name>
<email>myllynen@redhat.com</email>
</author>
<published>2015-05-27T02:37:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/commit/?id=d28311a19d7fd09f96c4b5c9a1dbf65b88dc3282'/>
<id>d28311a19d7fd09f96c4b5c9a1dbf65b88dc3282</id>
<content type='text'>
On 2015-05-26 21:24, Siddhesh Poyarekar wrote:
&gt; On Tue, May 26, 2015 at 05:13:07PM +0300, Marko Myllynen wrote:
&gt;&gt; this should be obvious, please commit if looks to be ok.
&gt;&gt;
&gt;&gt; 2015-05-26  Marko Myllynen  &lt;myllynen@redhat.com&gt;
&gt;&gt;
&gt;&gt; 	* stdlib/monetary.h: Fix comment.
&gt;
&gt; Patch didn't apply to master, but I've fixed it up and pushed it.

sorry about that (a whitespace hickup) - but your patch changed the
wrong comment, so here's a new patch to fix the fix.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On 2015-05-26 21:24, Siddhesh Poyarekar wrote:
&gt; On Tue, May 26, 2015 at 05:13:07PM +0300, Marko Myllynen wrote:
&gt;&gt; this should be obvious, please commit if looks to be ok.
&gt;&gt;
&gt;&gt; 2015-05-26  Marko Myllynen  &lt;myllynen@redhat.com&gt;
&gt;&gt;
&gt;&gt; 	* stdlib/monetary.h: Fix comment.
&gt;
&gt; Patch didn't apply to master, but I've fixed it up and pushed it.

sorry about that (a whitespace hickup) - but your patch changed the
wrong comment, so here's a new patch to fix the fix.
</pre>
</div>
</content>
</entry>
<entry>
<title>tile: use better variable naming in INLINE_SYSCALL</title>
<updated>2015-05-27T00:29:56+00:00</updated>
<author>
<name>Chris Metcalf</name>
<email>cmetcalf@ezchip.com</email>
</author>
<published>2015-05-27T00:29:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/commit/?id=1827059925140a1f0c16faf23ee895ee72f84efc'/>
<id>1827059925140a1f0c16faf23ee895ee72f84efc</id>
<content type='text'>
At issue for INLINE_SYSCALL was that it used "err" and "val"
as variable names in a #define, so that if it was used in a context
where the "caller" was also using "err" or "val", and those
variables were passed in to INLINE_SYSCALL, we would end up
referencing the internal shadowed variables instead.

For example, "char val" in check_may_shrink_heap() in
sysdeps/unix/sysv/linux/malloc-sysdep.h was being shadowed by
the syscall return "val" in INLINE_SYSCALL, causing the "char val"
not to get updated at all, and may_shrink_heap ended up always false.

A similar fix was made to INTERNAL_VSYSCALL_CALL.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
At issue for INLINE_SYSCALL was that it used "err" and "val"
as variable names in a #define, so that if it was used in a context
where the "caller" was also using "err" or "val", and those
variables were passed in to INLINE_SYSCALL, we would end up
referencing the internal shadowed variables instead.

For example, "char val" in check_may_shrink_heap() in
sysdeps/unix/sysv/linux/malloc-sysdep.h was being shadowed by
the syscall return "val" in INLINE_SYSCALL, causing the "char val"
not to get updated at all, and may_shrink_heap ended up always false.

A similar fix was made to INTERNAL_VSYSCALL_CALL.
</pre>
</div>
</content>
</entry>
<entry>
<title>NaCl: Fix thinko in last change.</title>
<updated>2015-05-26T23:11:46+00:00</updated>
<author>
<name>Roland McGrath</name>
<email>roland@hack.frob.com</email>
</author>
<published>2015-05-26T23:11:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/commit/?id=4da82229f0ea9dd50e43f15705ee92d5d30c4158'/>
<id>4da82229f0ea9dd50e43f15705ee92d5d30c4158</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>NaCl: Add NaCl-specific __lll_timedlock_wait.</title>
<updated>2015-05-26T22:30:47+00:00</updated>
<author>
<name>Roland McGrath</name>
<email>roland@hack.frob.com</email>
</author>
<published>2015-05-26T22:30:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/commit/?id=1f3a37b19ccc481197ffd6a5cf014dfb07c6dd4e'/>
<id>1f3a37b19ccc481197ffd6a5cf014dfb07c6dd4e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Split timed-wait functions out of nptl/lowlevellock.c.</title>
<updated>2015-05-26T21:49:13+00:00</updated>
<author>
<name>Roland McGrath</name>
<email>roland@hack.frob.com</email>
</author>
<published>2015-05-26T21:49:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/commit/?id=68c97aef626e489effeffe6d1d6a4f14656a720c'/>
<id>68c97aef626e489effeffe6d1d6a4f14656a720c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Consolidate gettimeofday across aarch64/s390/tile</title>
<updated>2015-05-26T20:03:35+00:00</updated>
<author>
<name>Adhemerval Zanella</name>
<email>adhemerval.zanella@linaro.com</email>
</author>
<published>2015-04-17T14:48:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/commit/?id=97554e4382e5d85eccf146b58f85aaad7e3d687c'/>
<id>97554e4382e5d85eccf146b58f85aaad7e3d687c</id>
<content type='text'>
This patch removes the architecture specific gettimeofday implementation
to use the vDSO symbol and consolidate it on a common Linux one.
Similar to clock_gettime and clock_getres vDSO implementation, each port
that supports gettimeofday through vDSO should just implement INLINE_VSYSCALL
to access the symbol and define HAVE_{GETTIME,GETRES}_VSYSCAL as 1.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch removes the architecture specific gettimeofday implementation
to use the vDSO symbol and consolidate it on a common Linux one.
Similar to clock_gettime and clock_getres vDSO implementation, each port
that supports gettimeofday through vDSO should just implement INLINE_VSYSCALL
to access the symbol and define HAVE_{GETTIME,GETRES}_VSYSCAL as 1.
</pre>
</div>
</content>
</entry>
</feed>
