glibc:hjl/pr17841/master

Last commit made on 2015-05-28
Get this branch:
git clone -b hjl/pr17841/master https://git.launchpad.net/glibc

Branch merges

Branch information

Name:
hjl/pr17841/master
Repository:
lp:glibc

Recent commits

ca1f728... by "H.J. Lu" <email address hidden>

Compile archives with -fno-pie

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.

1ea33bb... by "H.J. Lu" <email address hidden>

Support compilers defaulting to PIE

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.

58007e9... by "H.J. Lu" <email address hidden>

Make sure that calloc is called at least once

PLT relocations aren't required when -z now used. Linker on master with:

commit 25070364b0ce33eed46aa5d78ebebbec6accec7e
Author: H.J. Lu <email address hidden>
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=<optimized out>, reloc_addr_arg=<optimized out>,
    version=<optimized out>, sym=<optimized out>, map=<optimized out>)
    at ../sysdeps/i386/dl-machine.h:329
out>,
    nrelative=<optimized out>, relsize=<optimized out>,
    reladdr=<optimized out>, map=<optimized out>) 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 <dl_main>) 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 <dl_main>) 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 <dl_main>) 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=<optimized out>, reloc_addr_arg=<optimized out>,
    version=<optimized out>, sym=<optimized out>, map=<optimized out>)
    at ../sysdeps/i386/dl-machine.h:329
out>,
    nrelative=<optimized out>, relsize=<optimized out>,
    reladdr=<optimized out>, map=<optimized out>) 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 <dl_main>) 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 <dlfcn.h>.
 (calloc_called): New.
 (calloc): Allow to be called more than once.
 (do_test): dllopen/dlclose $ORIGIN/tst-auditmod9b.so.

be2e25b... by Wilco Dijkstra <email address hidden>

2015-05-28 Wilco Dijkstra <email address hidden>

        * sysdeps/ieee754/dbl-64/s_fabs.c: (__fabs): Call __builtin_fabs.
        * sysdeps/ieee754/flt-32/s_fabsf.c: (__fabsf): Likewise.

d28311a... by Myllynen

Fix monetary.h comment

On 2015-05-26 21:24, Siddhesh Poyarekar wrote:
> On Tue, May 26, 2015 at 05:13:07PM +0300, Marko Myllynen wrote:
>> this should be obvious, please commit if looks to be ok.
>>
>> 2015-05-26 Marko Myllynen <email address hidden>
>>
>> * stdlib/monetary.h: Fix comment.
>
> 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.

1827059... by Chris Metcalf <email address hidden>

tile: use better variable naming in INLINE_SYSCALL

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.

4da8222... by Roland McGrath <email address hidden>

NaCl: Fix thinko in last change.

1f3a37b... by Roland McGrath <email address hidden>

NaCl: Add NaCl-specific __lll_timedlock_wait.

68c97ae... by Roland McGrath <email address hidden>

Split timed-wait functions out of nptl/lowlevellock.c.

97554e4... by Adhemerval Zanella <email address hidden>

Consolidate gettimeofday across aarch64/s390/tile

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.