From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH v3] kallsyms: add support for relative offsets in kallsyms address table Date: Thu, 21 Jan 2016 15:20:45 -0800 Message-ID: <20160121152045.82639ae577d816198607d650@linux-foundation.org> References: <1453373299-28181-1-git-send-email-ard.biesheuvel@linaro.org> <1453396783-21591-1-git-send-email-ard.biesheuvel@linaro.org> <20160121145008.746fc62fbe3fbc685869da57@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from mail.linuxfoundation.org ([140.211.169.12]:35337 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751017AbcAUXUq (ORCPT ); Thu, 21 Jan 2016 18:20:46 -0500 In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: To: Kees Cook Cc: Ard Biesheuvel , LKML , "linux-s390@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "x86@kernel.org" , Ingo Molnar , "H. Peter Anvin" , Heiko Carstens , "benh@kernel.crashing.org" , Michael Ellerman , Michal Marek , Rusty Russell , Arnd Bergmann , linux-arch On Thu, 21 Jan 2016 14:55:00 -0800 Kees Cook wrote: > IIUC, this means that the relocation work done after decompression now > doesn't have to do relocation updates for all these values, which > means a smaller relocation table as well. Makes sense, thanks. I altered the changelog : Similar to how relative extables are implemented, it is possible to : emit the kallsyms table in such a way that it contains offsets relative : to some anchor point in the kernel image rather than absolute : addresses. : : The benefit is that such table entries are no longer subject to dynamic : relocation when the build time so the relocation work done after : decompression now doesn't have to do relocation updates for all these : values, which means a smaller relocation table as well. : : Also, the runtime offsets of the kernel image are different. Also, on : 64-bit architectures, it essentially cuts the size of the address table : in half since offsets can typically be expressed in 32 bits. : : Since it is useful for some architectures (like x86) to retain the ability : to emit absolute values as well, this patch adds support for both, by : emitting absolute addresses as positive 32-bit values, and addresses : relative to the lowest encountered relative symbol as negative values, : which are subtracted from the runtime address of this base symbol to : produce the actual address. : : Support for the above is enabled by default for all architectures except : IA-64, whose symbols are too far apart to capture in this manner.