From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755422AbdCJO60 (ORCPT ); Fri, 10 Mar 2017 09:58:26 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:56818 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755378AbdCJO6Z (ORCPT ); Fri, 10 Mar 2017 09:58:25 -0500 Date: Fri, 10 Mar 2017 15:58:20 +0100 (CET) From: Thomas Gleixner To: Vivek Goyal cc: Mike Galbraith , Borislav Petkov , "Tobin C. Harding" , LKML , Nicholas Mc Guire , x86@kernel.org, Dave Young , Baoquan He Subject: Re: kexec, x86/purgatory: Cleanup the unholy mess In-Reply-To: <20170310142418.GA20954@redhat.com> Message-ID: References: <1489153665.4410.4.camel@gmx.de> <20170310142418.GA20954@redhat.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 10 Mar 2017, Vivek Goyal wrote: > I think we probably will have to initialize these global variables in > purgatory itself and that puts them in .data section and relocation > works. > > That's how the code was intially. I initialized value of > purgatory_sha256_digest in the code and then did "readelf -a purgatory.o" > and symbol section index changed from COM to 3. > > 13: 0000000000000000 32 OBJECT GLOBAL DEFAULT 3 > purgatory_sha256_digest > > [ 3] .data PROGBITS 0000000000000000 00000120 > 0000000000000020 0000000000000000 WA 0 0 32 Yeah, and then instead of doing it proper you relied on compiler/link magic which is unreliable, undocumented and uncomprehensible. But that's just compatible to the rest of kexec. Works for me is never a good engineering principle. Thanks, tglx