This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.26.9000-995-g14d886e

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, master has been updated
       via  14d886edbd3d80b771e1c42fbd9217f9074de9c6 (commit)
      from  7d38eb38977980efe703eac93645b1af5a5f8a0c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------;a=commitdiff;h=14d886edbd3d80b771e1c42fbd9217f9074de9c6

commit 14d886edbd3d80b771e1c42fbd9217f9074de9c6
Author: Szabolcs Nagy <>
Date:   Fri Nov 17 10:45:32 2017 +0000

    aarch64: fix start code for static pie
    There are three flavors of the crt startup code:
    1) crt1.o used for non-pie,
    2) Scrt1.o used for dynamic linked pie (dynamic linker relocates),
    3) rcrt1.o used for static linked pie (self relocation is needed)
    In the --enable-static-pie case crt1.o is built with -DPIC and in case
    of static linking it interposes _dl_relocate_static_pie in libc to
    avoid self relocation.
    Scrt1.o is built with -DPIC -DSHARED and it relies on GOT entries that
    the static linker cannot relax and thus need relocation before the
    start code is executed, so rcrt1.o needs separate implementation.
    This implementation does not work for .text > 4G position independent
    executables, which is fine since the toolchain does not support
    -mcmodel=large with -fPIE.
    Tests pass with ld/22269 and ld/22263 binutils bugs fixed.
    	* sysdeps/aarch64/start.S (_start): Handle PIC && !SHARED case.

diff --git a/ChangeLog b/ChangeLog
index 815e735..62e0712 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-12-18  Szabolcs Nagy  <>
+	* sysdeps/aarch64/start.S (_start): Handle PIC && !SHARED case.
 2017-12-16  Aurelien Jarno  <>
 	[BZ #22505]
diff --git a/sysdeps/aarch64/start.S b/sysdeps/aarch64/start.S
index c20433a..0218f8d 100644
--- a/sysdeps/aarch64/start.S
+++ b/sysdeps/aarch64/start.S
@@ -60,7 +60,8 @@ _start:
 	/* Setup stack limit in argument register */
 	mov	x6, sp
-#ifdef SHARED
+#ifdef PIC
+# ifdef SHARED
         adrp    x0, :got:main
 	ldr     PTR_REG (0), [x0, #:got_lo12:main]
@@ -69,6 +70,14 @@ _start:
         adrp    x4, :got:__libc_csu_fini
 	ldr     PTR_REG (4), [x4, #:got_lo12:__libc_csu_fini]
+# else
+	adrp	x0, main
+	add	x0, x0, :lo12:main
+	adrp	x3, __libc_csu_init
+	add	x3, x3, :lo12:__libc_csu_init
+	adrp	x4, __libc_csu_fini
+	add	x4, x4, :lo12:__libc_csu_fini
+# endif
 	/* Set up the other arguments in registers */
 	MOVL (0, main)


Summary of changes:
 ChangeLog               |    4 ++++
 sysdeps/aarch64/start.S |   11 ++++++++++-
 2 files changed, 14 insertions(+), 1 deletions(-)

GNU C Library master sources

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]