This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/21913] static binaries SIGSEGV in __brk when host's gcc is pie-by-default (i386)
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Mon, 07 Aug 2017 20:26:11 +0000
- Subject: [Bug libc/21913] static binaries SIGSEGV in __brk when host's gcc is pie-by-default (i386)
- Auto-submitted: auto-generated
- References: <bug-21913-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=21913
--- Comment #10 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, hjl/pie/static has been created
at 6a41eb77cc1bb9926c1edcb41f934ad96b43a9d1 (commit)
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6a41eb77cc1bb9926c1edcb41f934ad96b43a9d1
commit 6a41eb77cc1bb9926c1edcb41f934ad96b43a9d1
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Tue Jul 18 10:42:48 2017 -0700
Use hidden visibility for libc.a with PIC
Size comparison of static PIE elf/ldconfig:
On x86-64:
text data bss dec hex
Before: 866113 22952 6336 895401 da9a9
After : 865921 22952 6336 895209 da8e9
On i686:
text data bss dec hex
Before: 782692 12296 3748 798736 c3010
After : 781153 12280 3748 797181 c29fd
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=db2e81b0bb258f9b0b92930bbdf1cbe7bd87c2cd
commit db2e81b0bb258f9b0b92930bbdf1cbe7bd87c2cd
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Mon Jul 17 13:53:52 2017 -0700
Add _dl_relocate_static_pie
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=bff6385dd7f7548290cdf099438153bcae45d93a
commit bff6385dd7f7548290cdf099438153bcae45d93a
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Mon Jul 17 08:54:40 2017 -0700
Define pie-default/default-pie-ldflag for --enable-static-pie
1. Add $(pie-default) to CFLAGS-.o and CFLAGS-.op.
2. Add $(default-pie-ldflag) to +link-static-before-libc.
3. Define +prectorT/+postctorT to $(+prectorS)/$(+postctorS).
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=65a3c646b5cf6c8f0ea5804274e6167f397a1206
commit 65a3c646b5cf6c8f0ea5804274e6167f397a1206
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Tue Jul 18 05:58:21 2017 -0700
x86-64: Check if linker supports static PIE
Need the linker with fix for:
https://sourceware.org/bugzilla/show_bug.cgi?id=21782
Binutils 2.29 is OK.
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=66af3e71af2583d41a4eaa77781bd99110723384
commit 66af3e71af2583d41a4eaa77781bd99110723384
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Mon Jul 17 08:36:45 2017 -0700
Add --enable-static-pie
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=319fc7c7e5fa501263e4408673d63288a846d5d7
commit 319fc7c7e5fa501263e4408673d63288a846d5d7
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sun Jul 23 05:26:26 2017 -0700
Check if -static and -pie work together
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c5cf3025294f43c1f8fd6d28fd4faf3504d81047
commit c5cf3025294f43c1f8fd6d28fd4faf3504d81047
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Jul 21 05:07:19 2017 -0700
Check if -static-pie works
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=add31350f0d488372cfd6a426e434856db613584
commit add31350f0d488372cfd6a426e434856db613584
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Mon Jul 17 08:17:32 2017 -0700
Check if linker supports --no-dynamic-linker
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=66ee1f78e0bab3f3720bb99ae2a05c000bbefac6
commit 66ee1f78e0bab3f3720bb99ae2a05c000bbefac6
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed Jul 19 14:32:42 2017 -0700
i386: Add _startup_sbrk and _startup_fatal [BZ #21913]
On Linux/i386, there are 3 ways to make a system call:
1. call *%gs:SYSINFO_OFFSET. This requires TLS initialization.
2. call *_dl_sysinfo. This requires relocation of _dl_sysinfo.
3. int $0x80. This is slower than #2 and #3, but works everywhere.
When an object file is compiled with PIC, #1 is prefered since it is
faster than #3 and doesn't require relocation of _dl_sysinfo. For
dynamic executables, ld.so initializes TLS. However, for static
executables, before TLS is initialized by __libc_setup_tls, #3 should
be used for syscalls. This patch adds _startup_sbrk and _startup_fatal
to be used in static executables before __libc_setup_tls is called. By
default, they are defined to __sbrk and __libc_fatal, respectively. On
Linux/i386, a special _startup_sbrk is provided and _startup_fatal is
turned into ABORT_INSTRUCTION.
[BZ #21913]
* csu/libc-tls.c: Include <startup.h>.
(__libc_setup_tls): Call _startup_sbrk instead of __sbrk. Call
_startup_fatal instead of __libc_fatal.
* elf/dl-tunables.c: Include <startup.h>.
(tunables_strdup): Call _startup_sbrk instead of __sbrk.
* sysdeps/generic/startup.h: New file.
* sysdeps/unix/sysv/linux/i386/startup.h: Likewise.
* sysdeps/unix/sysv/linux/i386/startup_sbrk.c: Likewise.
* sysdeps/unix/sysv/linux/i386/Makefile (sysdep_routine): Add
startup_sbrk if default to PIE.
(static-only-routines): Likewise.
-----------------------------------------------------------------------
--
You are receiving this mail because:
You are on the CC list for the bug.