From patchwork Wed Nov 15 21:34:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 10060291 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 987DF60231 for ; Wed, 15 Nov 2017 21:34:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 859D529F9B for ; Wed, 15 Nov 2017 21:34:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79DCC29FAA; Wed, 15 Nov 2017 21:34:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C39529F9B for ; Wed, 15 Nov 2017 21:34:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759106AbdKOVey (ORCPT ); Wed, 15 Nov 2017 16:34:54 -0500 Received: from mail-io0-f196.google.com ([209.85.223.196]:40630 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758953AbdKOVep (ORCPT ); Wed, 15 Nov 2017 16:34:45 -0500 Received: by mail-io0-f196.google.com with SMTP id 71so3090176ior.7 for ; Wed, 15 Nov 2017 13:34:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9OU4Pv/FSu4XRF9bnbZEO2V0Uc2+aOfzLmZxcTYGPGY=; b=oUAdsttXpbbMyMcuZ1EcuiKWBM++YMoiYs0SDwoHuXuaWhshFSx4G10Qjy8dmjjZSU PHP9v3x5VCNi6nqYBjR6b7rkMR0LLnO795aYSrS9BT0FW3Pi3+yWr+BV4OzfY/HTM3g/ WAnmGW8y35pGmx0R4wSImqQO9gd9NT0rwWe55HcCiyfNJgRxBdLFa8sJ9bSmal8BSuZj TjvGPXw+M+4PYJn+5Gcq2TfBFPL4uEyuiVuzhSGVm3S5Q6GP8mugF7RGxzNHBAwHTDfv /PJVwziikmyH1PZgcv4xu1V3VCgeKtTPDIY2prk/pNLJ94hYniNGWl+MnOWcPKw2BnPz Kbxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9OU4Pv/FSu4XRF9bnbZEO2V0Uc2+aOfzLmZxcTYGPGY=; b=bKkKtWrHSfe+No0NKBizlcaFjuVXUO9ElO+IF/Tq1ynRouFxn9zMY2JWp1Ve9Ms5eU K3ovv0qJBKUJdLcrL6bZ1qELTySv3z1JtA/fuK7qAUtEBbJJG57LQLuBS5oIQBQvvm8o QCgSpCq8lKqiKTDIA4gOH48m4W8MFV2QBAYhh8Ca+V53FlV70mXdwPEZVvKwHBkhl8Sj yAQLw+PcTYLGfdIFEu1dyMcdAQPsCUTyYBRQrTuev5Jume0gv+I2u6FC6eL9FC2jt8kr BHrVk6g3NGbwEmirP1pgTMaXEZN3TfJXWVcWQkYDEx+VZ8QrUO4vHCSL1jCEuVbENgx9 wm5A== X-Gm-Message-State: AJaThX5ebgbjpPt6dw6b6Qi97YaE3UeuRPiWlKxRdiUdUOzNNdCDqI8r NIwXswo8S6rTzgpOJOIAl5hAUA== X-Google-Smtp-Source: AGs4zMZypkVKhAX+jkAht45yf3AKO3djlAw6nyVz4A2fd0W3jWoYDATPN840KjIlTMg79EsWgMsf2Q== X-Received: by 10.107.140.145 with SMTP id o139mr20595257iod.81.1510781683277; Wed, 15 Nov 2017 13:34:43 -0800 (PST) Received: from samitolvanen.mtv.corp.google.com ([100.98.112.14]) by smtp.gmail.com with ESMTPSA id 68sm9735197iov.2.2017.11.15.13.34.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Nov 2017 13:34:42 -0800 (PST) From: Sami Tolvanen To: Alex Matveev , Andi Kleen , Ard Biesheuvel , Greg Hackmann , Kees Cook , linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Rutland , Masahiro Yamada , Maxim Kuvyrkov , Michal Marek , Nick Desaulniers , Yury Norov , Matthias Kaehlcke Cc: Sami Tolvanen Subject: [PATCH v2 02/18] kbuild: fix LD_DEAD_CODE_DATA_ELIMINATION with GNU gold Date: Wed, 15 Nov 2017 13:34:12 -0800 Message-Id: <20171115213428.22559-3-samitolvanen@google.com> X-Mailer: git-send-email 2.15.0.448.gf294e3d99a-goog In-Reply-To: <20171115213428.22559-1-samitolvanen@google.com> References: <20171115213428.22559-1-samitolvanen@google.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Don't remove .head.text or .exitcall.exit when linking with --gc-sections, and include .init.text.* in .init.text and .init.rodata.* in .init.rodata. Signed-off-by: Sami Tolvanen --- include/asm-generic/vmlinux.lds.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index bdcd1caae092..ce0244780988 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -512,7 +512,7 @@ VMLINUX_SYMBOL(__softirqentry_text_end) = .; /* Section used for early init (in .S files) */ -#define HEAD_TEXT *(.head.text) +#define HEAD_TEXT KEEP(*(.head.text)) #define HEAD_TEXT_SECTION \ .head.text : AT(ADDR(.head.text) - LOAD_OFFSET) { \ @@ -557,7 +557,7 @@ MEM_DISCARD(init.data) \ KERNEL_CTORS() \ MCOUNT_REC() \ - *(.init.rodata) \ + *(.init.rodata .init.rodata.*) \ FTRACE_EVENTS() \ TRACE_SYSCALLS() \ KPROBE_BLACKLIST() \ @@ -576,7 +576,7 @@ EARLYCON_TABLE() #define INIT_TEXT \ - *(.init.text) \ + *(.init.text .init.text.*) \ *(.text.startup) \ MEM_DISCARD(init.text) @@ -593,7 +593,7 @@ MEM_DISCARD(exit.text) #define EXIT_CALL \ - *(.exitcall.exit) + KEEP(*(.exitcall.exit)) /* * bss (Block Started by Symbol) - uninitialized data