From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933767AbdBQKt2 (ORCPT ); Fri, 17 Feb 2017 05:49:28 -0500 Received: from mx2.suse.de ([195.135.220.15]:44858 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932944AbdBQKsG (ORCPT ); Fri, 17 Feb 2017 05:48:06 -0500 From: Jiri Slaby To: mingo@redhat.com Cc: tglx@linutronix.de, hpa@zytor.com, x86@kernel.org, jpoimboe@redhat.com, linux-kernel@vger.kernel.org, Jiri Slaby Subject: [PATCH 07/10] linkage: introduce ALIASes Date: Fri, 17 Feb 2017 11:47:54 +0100 Message-Id: <20170217104757.28588-7-jslaby@suse.cz> X-Mailer: git-send-email 2.11.1 In-Reply-To: <20170217104757.28588-1-jslaby@suse.cz> References: <20170217104757.28588-1-jslaby@suse.cz> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sometimes we see in the assembly: === .align 4 _key_expansion_128: ENTRY_LOCAL(_key_expansion_256a) ... ENDPROC(_key_expansion_256a) ENDPROC(_key_expansion_128) === or === ENTRY(__memcpy) ENTRY(memcpy) ... ENDPROC(memcpy) ENDPROC(__memcpy) === In the former, the outer "function" (alias) _key_expansion_128 is marked as function by ENDPROC, but there is no corresponding ENTRY for that. In the latter, there are nested ENTRYs and ENDPROCs. And since we want them to emit some debuginfo, the nesting makes it impossible. Hence introduce ENTRY_ALIAS/END_ALIAS to differentiate this case -- ENTRY will emit debuginfo, ENTRY_ALIAS will not. Signed-off-by: Jiri Slaby --- include/linux/linkage.h | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/include/linux/linkage.h b/include/linux/linkage.h index ca5d5c01009b..fe5bbdac719b 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h @@ -78,17 +78,35 @@ #define ALIGN __ALIGN #define ALIGN_STR __ALIGN_STR -#ifndef ENTRY_LOCAL -#define ENTRY_LOCAL(name) \ +#ifndef ENTRY_LOCAL_ALIAS +#define ENTRY_LOCAL_ALIAS(name) \ ALIGN ASM_NL \ name: #endif +#ifndef ENTRY_ALIAS +#define ENTRY_ALIAS(name) \ + .globl name ASM_NL \ + ENTRY_LOCAL_ALIAS(name) +#endif + +#ifndef ENTRY_LOCAL +#define ENTRY_LOCAL(name) \ + ENTRY_LOCAL_ALIAS(name) +#endif + #ifndef ENTRY #define ENTRY(name) \ .globl name ASM_NL \ ENTRY_LOCAL(name) #endif + +#ifndef END_ALIAS +#define END_ALIAS(name) \ + .type name, @function ASM_NL \ + END(name) +#endif + #endif /* LINKER_SCRIPT */ #ifndef WEAK @@ -108,8 +126,7 @@ */ #ifndef ENDPROC #define ENDPROC(name) \ - .type name, @function ASM_NL \ - END(name) + END_ALIAS(name) #endif #endif -- 2.11.1