From patchwork Wed Jan 20 09:05:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 570592 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 52B47140AD9 for ; Wed, 20 Jan 2016 20:10:53 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b=KB1rIlmF; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 2EFE71A19E2 for ; Wed, 20 Jan 2016 20:10:53 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b=KB1rIlmF; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 000361A0E76 for ; Wed, 20 Jan 2016 20:05:57 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b=KB1rIlmF; dkim-atps=neutral Received: by mail-wm0-x235.google.com with SMTP id u188so175652819wmu.1 for ; Wed, 20 Jan 2016 01:05:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=J87a6KfXDIwzfy32lH1V4B4ud/ZmxRvWOTA+S5D7cP4=; b=KB1rIlmFAPzW9/j6za3IyOwf5RxPUojwxMzhw3JZEUCsrdj7gP7L7tHZUAH6PZoYGb oD+at3eJsHwgdSHNBavn85PmzvVtShHa+sDSvuEHk/ylCSTDJ7eQkuSg6llRwaUIE2jK it+0Y5QwPsnlV3aMUpmGsLCz3P4MfQIC8KlXE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=J87a6KfXDIwzfy32lH1V4B4ud/ZmxRvWOTA+S5D7cP4=; b=a/j5uIlGI7PqQpe2dk5uPOLBUv8CXicPK8sxbiT2uTeqIXWIlmbqebDo6N6+WJ+9aT GlcErYsHRLmr/3KFWDkfvfcYE6+WsOgQwEh27zPXItwRCT00C1s/5Nmel9XFecohg73u qOypomiUon1WHHH9WGnO5sQAqmAUVsOyoFLLkQhmPHqz9mLP+ee39Cj4YeVPMutyOLEu 0OrWdruXrCk9RpRqJTqXWw5fhQitfnB/lxziPCsuYjG0twG97CLnMVvSYmWxedcG2X4+ UTmPppbMvJbYBXxHhrlUSfqn5+oz4FbW4GsSI/l3/gmSbPGu0bXv8FwKj8y7gv/3jm+d JFxA== X-Gm-Message-State: AG10YOSF+xXacWMNwSCzFFEWe1287SH7rh//GJlrhWfTVgqB9O68fcGYP0sgpgjBWkvK7+oK X-Received: by 10.28.4.145 with SMTP id 139mr2830557wme.56.1453280754975; Wed, 20 Jan 2016 01:05:54 -0800 (PST) Received: from localhost.localdomain (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by smtp.gmail.com with ESMTPSA id k130sm24234780wmg.6.2016.01.20.01.05.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Jan 2016 01:05:54 -0800 (PST) From: Ard Biesheuvel To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org, keescook@chromium.org, akpm@linux-foundation.org, mingo@kernel.org, hpa@zytor.com, heiko.carstens@de.ibm.com, benh@kernel.crashing.org, mpe@ellerman.id.au, mmarek@suse.cz, rusty@rustcorp.com.au Subject: [PATCH 2/4] powerpc: enable text relative kallsyms for ppc64 Date: Wed, 20 Jan 2016 10:05:36 +0100 Message-Id: <1453280738-18721-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1453280738-18721-1-git-send-email-ard.biesheuvel@linaro.org> References: <1453280738-18721-1-git-send-email-ard.biesheuvel@linaro.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This enables the newly introduced text-relative kallsyms support when building 64-bit targets. This cuts the size of the kallsyms address table in half, and drastically reduces the size of the PIE dynamic relocation section when building with CONFIG_RELOCATABLE=y (by about 3 MB for ppc64_defconfig) Signed-off-by: Ard Biesheuvel Tested-by: Michael Ellerman (powerpc) --- Results for ppc64_defconfig: BEFORE: ======= $ size vmlinux text data bss dec hex filename 19827996 2008456 849612 22686064 15a2970 vmlinux $ readelf -S .tmp_kallsyms2.o There are 9 section headers, starting at offset 0x4513f8: Section Headers: [Nr] Name Type Address Offset Size EntSize Flags Link Info Align ... [ 4] .rodata PROGBITS 0000000000000000 00000100 00000000001fcf00 0000000000000000 A 0 0 256 [ 5] .rela.rodata RELA 0000000000000000 001fd1d8 0000000000254220 0000000000000018 I 7 4 8 [ 6] .shstrtab STRTAB 0000000000000000 001fd000 0000000000000039 0000000000000000 0 0 1 ... $ ls -l arch/powerpc/boot/zImage -rwxrwxr-x 2 ard ard 7533160 Jan 20 08:43 arch/powerpc/boot/zImage AFTER: ====== $ size vmlinux text data bss dec hex filename 16979516 2009992 849612 19839120 12eb890 vmlinux $ readelf -S .tmp_kallsyms2.o There are 8 section headers, starting at offset 0x199bb0: Section Headers: [Nr] Name Type Address Offset Size EntSize Flags Link Info Align ... [ 4] .rodata PROGBITS 0000000000000000 00000100 0000000000199900 0000000000000000 A 0 0 256 [ 5] .shstrtab STRTAB 0000000000000000 00199a00 0000000000000034 0000000000000000 0 0 1 ... $ ls -l arch/powerpc/boot/zImage -rwxrwxr-x 2 ard ard 6985672 Jan 20 08:45 arch/powerpc/boot/zImage --- arch/powerpc/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 94f6c5089e0c..d1c26749632b 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -158,6 +158,7 @@ config PPC select ARCH_HAS_DMA_SET_COHERENT_MASK select ARCH_HAS_DEVMEM_IS_ALLOWED select HAVE_ARCH_SECCOMP_FILTER + select KALLSYMS_TEXT_RELATIVE if PPC64 config GENERIC_CSUM def_bool CPU_LITTLE_ENDIAN