From patchwork Thu Nov 30 23:38:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 10085797 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 55BD2602BC for ; Thu, 30 Nov 2017 23:40:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4631C2A17C for ; Thu, 30 Nov 2017 23:40:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3AF792A1FB; Thu, 30 Nov 2017 23:40:28 +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 C92252A17C for ; Thu, 30 Nov 2017 23:40:27 +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=yRlUiwtj8vtTIkk5Bhz8/NMDKMQIlbMuUu3TVUcIep0=; b=Y5jp1OCpNj0c/SKaVxrfPc2VoE nq3afoxhp3x/SoB50Y0fSAm2u3V4J+gEXSOPWSR7h7EcSAGJ7IV84kT7sbnHBQr0rKYZmPv6EfF+7 w7R1gq5K9/XzhAGVNqa/U05J1fN9qMjW7v08yv0IDtIJYfF12/XDhSCjjN8bsWgKjyJfI5vEZdmnX 0HL4WF/2qRJn21FmWJhtfIgjHYU2iw6KhoE55KfC39yKkzU+JKw249POE84fZR7zvFuRUlu/O7zsI 7LvMwasiGXDHvuktegGyytxdfAnMNjiVqfi5iG/PC3JoNm3782tvb7m/8t6SoE5zddoWfe5GsgOiU DJ/lgU+w==; 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 1eKYRO-0002zP-RL; Thu, 30 Nov 2017 23:40:26 +0000 Received: from mail-it0-x244.google.com ([2607:f8b0:4001:c0b::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eKYQR-00010J-G8 for linux-arm-kernel@lists.infradead.org; Thu, 30 Nov 2017 23:39:35 +0000 Received: by mail-it0-x244.google.com with SMTP id f190so497206ita.5 for ; Thu, 30 Nov 2017 15:39:11 -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=kcNfnLsDsq+8Qk0UpSEsjuJn2km725DmFTFvpzdA5+M=; b=LqoFeabKJ6UDt6f1Z1siOyotuLOYV9zXj8ne95An+t0MeUYoZEY65bbjra+r3KiXgK eiY3+wwGEdrFMMoeKxmyg7CAgG9bZKfwXk/eF1BX6IfSs22QhMK77K/1TaTtGXDgakGC VoIQnBh7my1UEVnMh3RDZG/8MQUwqS5m7ACKR9wUrNuhBM68VRyd/AmYKP3GA7pnz+0Z +caaxQY9kUTODdOC1SbpGQ7G2S6J4oO3U8izg57dkiF7C/i9OLwwUJz4mZfbZMcP/AeZ 73UX40eQFRxRqlwzOyD1EwzhVliDafXSDOpNza+mqlnY1YeMpD6eN+GciDIcZF+USmCp Y1VQ== 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=kcNfnLsDsq+8Qk0UpSEsjuJn2km725DmFTFvpzdA5+M=; b=QJvwXmXe3UhXS8SRDW9LuCBt3YvVE5Wf0mNvX4kWuc4Yy7pzEZ2bWOv+Tq9syR0s5h RT3LJkHCNDZu10+y/xygHQeu/KrOrNDIvq2oGgMuEn1jNpPgcHW7Q479a5Os2vT027Nz 0khnn8m7cgXAjkw53FzbC+s8vLfBXBVj0zpQmXzYRWcYDRFwZf0NcvW0D50jTy8s7zL9 eKN/QJogeyvtwCPh6cV2Rt5RcwI4xBoKVfd59MCOc9LCEZkFv4QU9oW1+g23nZOP33v/ TgZDWbIehRTyRP3ztheh9CbBmDrZDXNeRZ0TmHDxayx6AApNR9JXHq8TJliy9W2CNirW 2tkg== X-Gm-Message-State: AJaThX6UPxCK6FqOtkzussiW0SsmuCVaFWM0ctCPc6lR1NQCcsFZF9EN 6QvdK+R2FN4H0mh2Cl3ObrgCvQ== X-Google-Smtp-Source: AGs4zMajpBUF3E/DTVnKaIvajTSErdOo8ULFLsfDbEEmxaTeeJ/ArGC9sWyc0j1WnARp0LbHtk5EcA== X-Received: by 10.36.77.79 with SMTP id l76mr5606075itb.14.1512085150782; Thu, 30 Nov 2017 15:39:10 -0800 (PST) Received: from samitolvanen.mtv.corp.google.com ([100.98.112.14]) by smtp.gmail.com with ESMTPSA id h73sm2896676itb.21.2017.11.30.15.39.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Nov 2017 15:39:10 -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 , Nicholas Piggin Subject: [PATCH v2 1/7] kbuild: fix LD_DEAD_CODE_DATA_ELIMINATION Date: Thu, 30 Nov 2017 15:38:59 -0800 Message-Id: <20171130233905.130602-2-samitolvanen@google.com> X-Mailer: git-send-email 2.15.0.531.g2ccb3012c9-goog In-Reply-To: <20171130233905.130602-1-samitolvanen@google.com> References: <20171129234442.655-1-samitolvanen@google.com> <20171130233905.130602-1-samitolvanen@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171130_153928_467600_F9E710C0 X-CRM114-Status: UNSURE ( 9.26 ) 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 Reviewed-by: Nicholas Piggin --- 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 ee8b707d9fa9..eb4199c12bd2 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -515,7 +515,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) { \ @@ -560,7 +560,7 @@ MEM_DISCARD(init.data) \ KERNEL_CTORS() \ MCOUNT_REC() \ - *(.init.rodata) \ + *(.init.rodata .init.rodata.*) \ FTRACE_EVENTS() \ TRACE_SYSCALLS() \ KPROBE_BLACKLIST() \ @@ -579,7 +579,7 @@ EARLYCON_TABLE() #define INIT_TEXT \ - *(.init.text) \ + *(.init.text .init.text.*) \ *(.text.startup) \ MEM_DISCARD(init.text) @@ -596,7 +596,7 @@ MEM_DISCARD(exit.text) #define EXIT_CALL \ - *(.exitcall.exit) + KEEP(*(.exitcall.exit)) /* * bss (Block Started by Symbol) - uninitialized data