From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968460AbeEYVGh (ORCPT ); Fri, 25 May 2018 17:06:37 -0400 Received: from terminus.zytor.com ([198.137.202.136]:40265 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968376AbeEYVGg (ORCPT ); Fri, 25 May 2018 17:06:36 -0400 Subject: Re: [clang] stack protector and f1f029c7bf To: Nick Desaulniers Cc: Alistair Strachan , Manoj Gupta , Matthias Kaehlcke , Greg Hackmann , sedat.dilek@gmail.com, tstellar@redhat.com, LKML , Kees Cook References: <26B017D5-4063-46CB-8768-B0E5E7CD3838@zytor.com> <319FB971-ABB6-4BE7-969B-D87D84853196@zytor.com> <31A5469A-176F-451F-886A-ECD649DDC78C@zytor.com> From: "H. Peter Anvin" Message-ID: <38f21c66-fa34-3a77-33bc-d15065c15af9@zytor.com> Date: Fri, 25 May 2018 14:06:28 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/25/18 13:36, Nick Desaulniers wrote: > On Fri, May 25, 2018 at 10:56 AM wrote: >> You need the extern inline in the .h file and the out-of-line .S file > both. > > But the out-of-line .S file looks like: > > ... > 10 ENTRY(native_save_fl) > > 11 pushf > > 12 pop %_ASM_AX > > 13 ret > > 14 ENDPROC(native_save_fl) > > 15 EXPORT_SYMBOL(native_save_fl) > ... > > I don't see how you can specify to the linker from assembly source that > this function should be treated as `extern inline`? > "extern inline" is a C directive. In the header file you should provide the inlinable implementation (which is already there.) It means that "if you don't want to inline this there is an external implementation available." > I assume you don't literally mean the C keywords `extern inline` but > whatever the equivalent incantation is needed in terms of assembler > directives (which I also don't know). > > I'm beginning to think that what you'd like to see cannot be expressed (at > least via `extern inline`). >