From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Deacon Subject: Re: [PATCH 7/9] arm64/build: Warn on orphan section placement Date: Tue, 17 Mar 2020 21:56:14 +0000 Message-ID: <20200317215614.GB20788@willie-the-truck> References: <20200228002244.15240-1-keescook@chromium.org> <20200228002244.15240-8-keescook@chromium.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20200228002244.15240-8-keescook@chromium.org> Sender: linux-kbuild-owner@vger.kernel.org To: Kees Cook Cc: Borislav Petkov , "H.J. Lu" , Russell King , Catalin Marinas , Mark Rutland , Peter Collingbourne , James Morse , Arnd Bergmann , Masahiro Yamada , x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, linux-kbuild@vger.kernel.org, clang-built-linux@googlegroups.com, linux-kernel@vger.kernel.org List-Id: linux-arch.vger.kernel.org On Thu, Feb 27, 2020 at 04:22:42PM -0800, Kees Cook wrote: > We don't want to depend on the linker's orphan section placement > heuristics as these can vary between linkers, and may change between > versions. All sections need to be explicitly named in the linker > script. > > Explicitly include debug sections when they're present. Add .eh_frame* > to discard as it seems that these are still generated even though > -fno-asynchronous-unwind-tables is being specified. Add .plt and > .data.rel.ro to discards as they are not actually used. Add .got.plt > to the image as it does appear to be mapped near .data. Finally enable > orphan section warnings. Hmm, I don't understand what .got.plt is doing here. Please can you elaborate? Will From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org ([198.145.29.99]:58620 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726530AbgCQV4V (ORCPT ); Tue, 17 Mar 2020 17:56:21 -0400 Date: Tue, 17 Mar 2020 21:56:14 +0000 From: Will Deacon Subject: Re: [PATCH 7/9] arm64/build: Warn on orphan section placement Message-ID: <20200317215614.GB20788@willie-the-truck> References: <20200228002244.15240-1-keescook@chromium.org> <20200228002244.15240-8-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200228002244.15240-8-keescook@chromium.org> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Kees Cook Cc: Borislav Petkov , "H.J. Lu" , Russell King , Catalin Marinas , Mark Rutland , Peter Collingbourne , James Morse , Arnd Bergmann , Masahiro Yamada , x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, linux-kbuild@vger.kernel.org, clang-built-linux@googlegroups.com, linux-kernel@vger.kernel.org Message-ID: <20200317215614.dbG1397WttcyZM7HK8HTAC41alZ7iHZqqxE9wJz-K4E@z> On Thu, Feb 27, 2020 at 04:22:42PM -0800, Kees Cook wrote: > We don't want to depend on the linker's orphan section placement > heuristics as these can vary between linkers, and may change between > versions. All sections need to be explicitly named in the linker > script. > > Explicitly include debug sections when they're present. Add .eh_frame* > to discard as it seems that these are still generated even though > -fno-asynchronous-unwind-tables is being specified. Add .plt and > .data.rel.ro to discards as they are not actually used. Add .got.plt > to the image as it does appear to be mapped near .data. Finally enable > orphan section warnings. Hmm, I don't understand what .got.plt is doing here. Please can you elaborate? Will