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: 10060313 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 2225E60231 for ; Wed, 15 Nov 2017 21:36:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F73F2A118 for ; Wed, 15 Nov 2017 21:36:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 045A22A312; Wed, 15 Nov 2017 21:36:05 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 90CD22A118 for ; Wed, 15 Nov 2017 21:36:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=H/n/x2/q+fzIem1/hw+Qt3bUfBBCM7sRwTHAQTEBKLo=; b=tn0I3HgYzejqKco0+XH1oD0jzM raYRuMvtIoGzylkk56rOfVFcijx3hhKXxoy85iMgyN8Vzyr9vbuc1dJ2KwDO05tF1zBa4RTmjRAb9 sC0wC62aznCfZs7FQTBZf2xBVn8MANQ7iqqvjPSs4r91c12JZnISSO0bLP9jw277sAWAuGoKa30lX 6DQ+i2y20uQcHT8QG7DJYKckoxIrZH0K7MompKAjCDkLz9iJQE8CgEfBhbI+w4vXs/RxZiX+LBlFO P5+0vHw9PH+97d/pBtOPhIoMMtuSvvUfm8kW6XnyX0kezsUwoTggtYZj1l7z0dF/qzpgfB2bpRCj1 NNA3wy3g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eF5Ld-0001bX-IE; Wed, 15 Nov 2017 21:35:53 +0000 Received: from mail-io0-x242.google.com ([2607:f8b0:4001:c06::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eF5Kq-00088O-JI for linux-arm-kernel@lists.infradead.org; Wed, 15 Nov 2017 21:35:06 +0000 Received: by mail-io0-x242.google.com with SMTP id u42so3084053ioi.9 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=Mk82W9JF3XkVDV/ik6Fl3E1/FDNgKhnTvntqwyaVZH3iY6r+WIaNX3+IO+QIEqHmHL CQTiVXDSGkhthIqzFzphX9+DeGRPfWZbk7FzyZ99F8DfpOutfeX6Z4LTrYm4MH3mId0L ehsodaPImel7YXynMVdkhBUNLdfuz0XKobYE/hvORU2zYvMsV/eEBIPUDjtUmzcdECtI YJ3Dtw5GFT+BIGrEJ6z7FT3TqYeKatg5MG9XDGxL7mr+bmTdAZe0yVO2z8BAxM2+0jhJ JO8yUdt7y2KFY+VurfpUJ/8xLmEGuWdwzLbUhxQ5AXSKmY8stp5D8vJ/lN2z0g+2Hk8m umrA== X-Gm-Message-State: AJaThX5Zq+ERjeGle/x+bq0ne/fyMMD0Y5ol29yAb9w2W8+lGAWDCVl7 YAPgOn1NlO7Gzi0G2qa/4FFKWw== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171115_133504_749819_93D7E31C X-CRM114-Status: UNSURE ( 9.52 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sami Tolvanen MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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