From patchwork Thu Jul 14 18:57:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waldemar Brodkorb X-Patchwork-Id: 648528 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from helium.openadk.org (helium.openadk.org [89.238.66.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rr4hZ2nslz9sBg for ; Fri, 15 Jul 2016 04:57:48 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id 098101012E; Thu, 14 Jul 2016 20:57:45 +0200 (CEST) X-Original-To: devel@uclibc-ng.org Delivered-To: devel@helium.openadk.org Received: by helium.openadk.org (Postfix, from userid 1000) id 137171012E; Thu, 14 Jul 2016 20:57:41 +0200 (CEST) Date: Thu, 14 Jul 2016 20:57:41 +0200 From: Waldemar Brodkorb To: devel@uclibc-ng.org Message-ID: <20160714185741.GA22989@waldemar-brodkorb.de> MIME-Version: 1.0 Content-Disposition: inline X-Operating-System: Linux 3.16.0-4-amd64 x86_64 User-Agent: Mutt/1.5.23 (2014-03-12) Subject: [uclibc-ng-devel] [PATCH] cleanup CALL_MCOUNT / PROF X-BeenThere: devel@uclibc-ng.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: uClibc-ng Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devel-bounces@uclibc-ng.org Sender: "devel" As this is only implemented for a few architecture and not well tested, just remove it. Signed-off-by: Waldemar Brodkorb --- Another cleanup patch for sysdep.h. Any comments? --- libc/sysdeps/linux/arm/sysdep.h | 13 +------------ libc/sysdeps/linux/i386/sysdep.h | 15 +-------------- libc/sysdeps/linux/ia64/sysdep.h | 8 ++------ libc/sysdeps/linux/sh/sysdep.h | 23 +---------------------- libc/sysdeps/linux/x86_64/sysdep.h | 19 +------------------ libc/sysdeps/linux/xtensa/sysdep.h | 8 ++------ 6 files changed, 8 insertions(+), 78 deletions(-) diff --git a/libc/sysdeps/linux/arm/sysdep.h b/libc/sysdeps/linux/arm/sysdep.h index 208521f..f8f2f8a 100644 --- a/libc/sysdeps/linux/arm/sysdep.h +++ b/libc/sysdeps/linux/arm/sysdep.h @@ -67,23 +67,12 @@ .globl C_SYMBOL_NAME(name); \ ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),function) \ .align ALIGNARG(4); \ - name##: \ - CALL_MCOUNT + name##: #undef END #define END(name) \ ASM_SIZE_DIRECTIVE(name) -/* If compiled for profiling, call `mcount' at the start of each function. */ -#ifdef PROF -#define CALL_MCOUNT \ - str lr,[sp, #-4]! ; \ - bl PLTJMP(mcount) ; \ - ldr lr, [sp], #4 ; -#else -#define CALL_MCOUNT /* Do nothing. */ -#endif - #ifdef NO_UNDERSCORES /* Since C identifiers are not normally prefixed with an underscore on this system, the asm identifier `syscall_error' intrudes on the diff --git a/libc/sysdeps/linux/i386/sysdep.h b/libc/sysdeps/linux/i386/sysdep.h index 4fa47fc..79e53a1 100644 --- a/libc/sysdeps/linux/i386/sysdep.h +++ b/libc/sysdeps/linux/i386/sysdep.h @@ -47,26 +47,13 @@ ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \ .align ALIGNARG(4); \ C_LABEL(name) \ - cfi_startproc; \ - CALL_MCOUNT + cfi_startproc; #undef END #define END(name) \ cfi_endproc; \ ASM_SIZE_DIRECTIVE(name) \ -/* If compiled for profiling, call `mcount' at the start of each function. */ -#ifdef PROF -/* The mcount code relies on a normal frame pointer being on the stack - to locate our caller, so push one just for its benefit. */ -#define CALL_MCOUNT \ - pushl %ebp; cfi_adjust_cfa_offset (4); movl %esp, %ebp; \ - cfi_def_cfa_register (ebp); call JUMPTARGET(mcount); \ - popl %ebp; cfi_def_cfa (esp, 4); -#else -#define CALL_MCOUNT /* Do nothing. */ -#endif - #ifdef NO_UNDERSCORES /* Since C identifiers are not normally prefixed with an underscore on this system, the asm identifier `syscall_error' intrudes on the diff --git a/libc/sysdeps/linux/ia64/sysdep.h b/libc/sysdeps/linux/ia64/sysdep.h index 3e7e467..3662114 100644 --- a/libc/sysdeps/linux/ia64/sysdep.h +++ b/libc/sysdeps/linux/ia64/sysdep.h @@ -39,15 +39,12 @@ #define C_LABEL(name) name/**/: #endif -#define CALL_MCOUNT - #define ENTRY(name) \ .text; \ .align 32; \ .proc C_SYMBOL_NAME(name); \ .global C_SYMBOL_NAME(name); \ - C_LABEL(name) \ - CALL_MCOUNT + C_LABEL(name) #define HIDDEN_ENTRY(name) \ .text; \ @@ -55,8 +52,7 @@ .proc C_SYMBOL_NAME(name); \ .global C_SYMBOL_NAME(name); \ .hidden C_SYMBOL_NAME(name); \ - C_LABEL(name) \ - CALL_MCOUNT + C_LABEL(name) #define LEAF(name) \ .text; \ diff --git a/libc/sysdeps/linux/sh/sysdep.h b/libc/sysdeps/linux/sh/sysdep.h index 281c415..137dd1d 100644 --- a/libc/sysdeps/linux/sh/sysdep.h +++ b/libc/sysdeps/linux/sh/sysdep.h @@ -42,34 +42,13 @@ ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),function) \ .align ALIGNARG(5); \ C_LABEL(name) \ - cfi_startproc; \ - CALL_MCOUNT + cfi_startproc; #undef END #define END(name) \ cfi_endproc; \ ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(name)) -/* If compiled for profiling, call `mcount' at the start of each function. */ -#ifdef PROF -#define CALL_MCOUNT \ - mov.l 1f,r1; \ - sts.l pr,@-r15; \ - cfi_adjust_cfa_offset (4); \ - cfi_rel_offset (pr, 0); \ - mova 2f,r0; \ - jmp @r1; \ - lds r0,pr; \ - .align 2; \ -1: .long mcount; \ -2: lds.l @r15+,pr; \ - cfi_adjust_cfa_offset (-4); \ - cfi_restore (pr) - -#else -#define CALL_MCOUNT /* Do nothing. */ -#endif - #ifdef __UCLIBC_UNDERSCORES__ /* Since C identifiers are not normally prefixed with an underscore on this system, the asm identifier `syscall_error' intrudes on the diff --git a/libc/sysdeps/linux/x86_64/sysdep.h b/libc/sysdeps/linux/x86_64/sysdep.h index 0e51001..a5971d7 100644 --- a/libc/sysdeps/linux/x86_64/sysdep.h +++ b/libc/sysdeps/linux/x86_64/sysdep.h @@ -42,30 +42,13 @@ ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \ .align ALIGNARG(4); \ C_LABEL(name) \ - cfi_startproc; \ - CALL_MCOUNT + cfi_startproc; #undef END #define END(name) \ cfi_endproc; \ ASM_SIZE_DIRECTIVE(name) -/* If compiled for profiling, call `mcount' at the start of each function. */ -#ifdef PROF -/* The mcount code relies on a normal frame pointer being on the stack - to locate our caller, so push one just for its benefit. */ -#define CALL_MCOUNT \ - pushq %rbp; \ - cfi_adjust_cfa_offset(8); \ - movq %rsp, %rbp; \ - cfi_def_cfa_register(%rbp); \ - call JUMPTARGET(mcount); \ - popq %rbp; \ - cfi_def_cfa(rsp,8); -#else -#define CALL_MCOUNT /* Do nothing. */ -#endif - #ifdef NO_UNDERSCORES /* Since C identifiers are not normally prefixed with an underscore on this system, the asm identifier `syscall_error' intrudes on the diff --git a/libc/sysdeps/linux/xtensa/sysdep.h b/libc/sysdeps/linux/xtensa/sysdep.h index 060b9b9..8d1bfcf 100644 --- a/libc/sysdeps/linux/xtensa/sysdep.h +++ b/libc/sysdeps/linux/xtensa/sysdep.h @@ -45,8 +45,7 @@ .align ALIGNARG(2); \ LITERAL_POSITION; \ C_LABEL(name) \ - abi_entry(sp, FRAMESIZE); \ - CALL_MCOUNT + abi_entry(sp, FRAMESIZE); #define HIDDEN_ENTRY(name) \ .globl C_SYMBOL_NAME(name); \ @@ -55,8 +54,7 @@ .align ALIGNARG(2); \ LITERAL_POSITION; \ C_LABEL(name) \ - abi_entry(sp, FRAMESIZE); \ - CALL_MCOUNT + abi_entry(sp, FRAMESIZE); #undef END #define END(name) ASM_SIZE_DIRECTIVE(name) @@ -92,8 +90,6 @@ #error Unsupported Xtensa ABI #endif #endif -#define CALL_MCOUNT /* Do nothing. */ - /* Linux uses a negative return value to indicate syscall errors, unlike most Unices, which use the condition codes' carry flag.