This is the mail archive of the glibc-cvs@sourceware.org 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.23-555-gefbe665


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  efbe665c3a2d344b0d64456cf29499ba53c2965a (commit)
      from  468700675f7f36d55758c36b1ed902250470e8ec (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 -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=efbe665c3a2d344b0d64456cf29499ba53c2965a

commit efbe665c3a2d344b0d64456cf29499ba53c2965a
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Mon Jul 11 09:46:08 2016 +0100

    [AArch64] Fix libc internal asm profiling code
    
    When glibc is built with --enable-profile, the ENTRY of
    asm functions includes CALL_MCOUNT for profiling.
    (matters for binaries static linked against libc_p.a.)
    
    CALL_MCOUNT did not save/restore argument registers
    around the _mcount call so it clobbered them.
    (it is enough to only save/restore the arguments passed
    to a given asm function, but that would be too many asm
    changes so it is simpler to always save all argument
    registers in this macro.)
    
    float args are not saved: mcount does not clobber the
    float regs and currently no asm function takes float
    arguments anyway.
    
    	[BZ #18707]
    	* sysdeps/aarch64/Makefile (CFLAGS-mcount.c): Add -mgeneral-regs-only.
    	* sysdeps/aarch64/sysdep.h (CALL_MCOUNT): Save argument registers.

diff --git a/ChangeLog b/ChangeLog
index 222e4d3..8e230e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-07-11  Szabolcs Nagy  <szabolcs.nagy@arm.com>
+
+	[BZ #18707]
+	* sysdeps/aarch64/Makefile (CFLAGS-mcount.c): Add -mgeneral-regs-only.
+	* sysdeps/aarch64/sysdep.h (CALL_MCOUNT): Save argument registers.
+
 2016-07-08  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
 	* sysdeps/unix/sysv/linux/sysdep.h
diff --git a/sysdeps/aarch64/Makefile b/sysdeps/aarch64/Makefile
index 0632355..562c137 100644
--- a/sysdeps/aarch64/Makefile
+++ b/sysdeps/aarch64/Makefile
@@ -12,3 +12,7 @@ endif
 ifeq ($(subdir),csu)
 gen-as-const-headers += tlsdesc.sym
 endif
+
+ifeq ($(subdir),gmon)
+CFLAGS-mcount.c += -mgeneral-regs-only
+endif
diff --git a/sysdeps/aarch64/sysdep.h b/sysdeps/aarch64/sysdep.h
index 6b728ec..e045759 100644
--- a/sysdeps/aarch64/sysdep.h
+++ b/sysdeps/aarch64/sysdep.h
@@ -66,9 +66,38 @@
 /* If compiled for profiling, call `mcount' at the start of each function.  */
 #ifdef	PROF
 # define CALL_MCOUNT						\
-	str	x30, [sp, #-16]!;				\
+	str	x30, [sp, #-80]!;				\
+	cfi_adjust_cfa_offset (80);				\
+	cfi_rel_offset (x30, 0);				\
+	stp	x0, x1, [sp, #16];				\
+	cfi_rel_offset (x0, 16);				\
+	cfi_rel_offset (x1, 24);				\
+	stp	x2, x3, [sp, #32];				\
+	cfi_rel_offset (x2, 32);				\
+	cfi_rel_offset (x3, 40);				\
+	stp	x4, x5, [sp, #48];				\
+	cfi_rel_offset (x4, 48);				\
+	cfi_rel_offset (x5, 56);				\
+	stp	x6, x7, [sp, #64];				\
+	cfi_rel_offset (x6, 64);				\
+	cfi_rel_offset (x7, 72);				\
+	mov	x0, x30;					\
 	bl	mcount;						\
-	ldr	x30, [sp], #16	;
+	ldp	x0, x1, [sp, #16];				\
+	cfi_restore (x0);					\
+	cfi_restore (x1);					\
+	ldp	x2, x3, [sp, #32];				\
+	cfi_restore (x2);					\
+	cfi_restore (x3);					\
+	ldp	x4, x5, [sp, #48];				\
+	cfi_restore (x4);					\
+	cfi_restore (x5);					\
+	ldp	x6, x7, [sp, #64];				\
+	cfi_restore (x6);					\
+	cfi_restore (x7);					\
+	ldr	x30, [sp], #80;					\
+	cfi_adjust_cfa_offset (-80);				\
+	cfi_restore (x30);
 #else
 # define CALL_MCOUNT		/* Do nothing.  */
 #endif

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                |    6 ++++++
 sysdeps/aarch64/Makefile |    4 ++++
 sysdeps/aarch64/sysdep.h |   33 +++++++++++++++++++++++++++++++--
 3 files changed, 41 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
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]