From patchwork Wed Nov 29 23:44:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 10083933 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 3FECE6020B for ; Wed, 29 Nov 2017 23:46:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 315A729C84 for ; Wed, 29 Nov 2017 23:46:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 25A2B29D55; Wed, 29 Nov 2017 23:46:24 +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 B290529C84 for ; Wed, 29 Nov 2017 23:46:23 +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=L7izQDAEYttRzozqZ3aMDoaMeC3jrD6masjpQubji7E=; b=lchY8ghnftxv84Rc3Q60cmQoLT Ve1WVkxKmqNoXnrs/7Mu549CfqQI2hWkGKhwx+DE8CYwNUDpGOQHwK6+18dtznI9yy+ApZzmCYT5e K2/JaCeDxyCv0a/ALLfhGRYuM7/xZa1v5miLGcVgw4ssDEKFQM/LCCMGyoS1k9kVCEJfTatJFeovT ch6cQyLeIK7s6+koJ/K3nLHoO5z4EiBNzVRgvrjme+PEHwY2x/B3q3DodmZdb1Wyh6keFii8jZmrm tA7jtmLLv3NSEauSBgTXC058BtToAxJY0HPM3g7Wp17XRhKnAHV+VMQnMOwVM2X8x6i+iNKEkb2iV Umap1UBA==; 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 1eKC3b-0005tK-0f; Wed, 29 Nov 2017 23:46:23 +0000 Received: from mail-pl0-x244.google.com ([2607:f8b0:400e:c01::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eKC2X-0003Yz-CM for linux-arm-kernel@lists.infradead.org; Wed, 29 Nov 2017 23:45:32 +0000 Received: by mail-pl0-x244.google.com with SMTP id s10so3062820plj.5 for ; Wed, 29 Nov 2017 15:44:57 -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=B9QnQ0XtQrSdzTOeVKwnXHh07YEtxvCtA8FmQLvHzFQ=; b=Ts1yl9W3iEJFc/n/GrmLQE6rgM2lOtsKSTFVI0dcvdAaX+Q9U3gJDJ6KV4iH1mXXMQ MDPkduaihIiUvm/1DMxzUKzgipK6x/AC1zyLGItPeJ5CLZQwQgJ+hSBRXw6hVcpIIFCF LQPzr/Kum+Aqfcq9RaLE1r7T3UcMcxaptv7/sj531DK9vpXehyD2dmmjL6V5fyuWQkCS 7CiEU5QBJCVbDAUGraxGuLEmEc0sh6IZEXg5ibblTvb2P7feSEavMUFK/EOi2ni7g0yC xqJPalnw40b7bdlr/F0WFwtwXFKr7+qfdiU1xzVQ/QKsC9a7Bgo5Fud4bfQcYIw1aKzA o1hA== 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=B9QnQ0XtQrSdzTOeVKwnXHh07YEtxvCtA8FmQLvHzFQ=; b=sbwwxJjn+9xWIlMaCuPtkmvTGF2j5sRSAfFibAAL8hqsYe7ze1wuEcRCafAHRgjgkA Je6mHgqFyVWSCKGm4ZsjgOezjQUxG+i/1e8LwXZboF0TOK7BJr2qRYTYEmMHRlPNvD0G F9kNFFyX9x2T3diyxvEs19r8GC8buhw4CBZyYOmo8zlcrVunDXrk8mXLOCCgNPt1bYR3 7LlnQjJTxyQWjlGAZeR4fA8nMQm7iERIq3Ju3xPjrFDNEJ9XQeUSwvQIi0CxbUXzbtoN xnxrvrZLbHDUisSbWsnMUNIkxVT4aFTap8YsRbfdKzC//LVyvJ3TLGL6qIt/pnJIfitP IZMw== X-Gm-Message-State: AJaThX5xSnw/x+veQ13hXydpvVrL3gg/ozBnHTPUpLxDcQ3W/iEBUbKA B+UpeAHIE1D0Xz0tOuV+ZfgfHg== X-Google-Smtp-Source: AGs4zMZe6Ahk+DsMoKZEmrXLYB3Ylf7TxcTr24E88D4u50FhYO8vh+4y86EEpx8PWgysVnw3XArNNQ== X-Received: by 10.84.252.139 with SMTP id y11mr260286pll.262.1511999096441; Wed, 29 Nov 2017 15:44:56 -0800 (PST) Received: from samitolvanen.mtv.corp.google.com ([100.98.112.14]) by smtp.gmail.com with ESMTPSA id s14sm5326948pfe.36.2017.11.29.15.44.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Nov 2017 15:44:55 -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 3/7] kbuild: fix LD_DEAD_CODE_DATA_ELIMINATION with GNU gold Date: Wed, 29 Nov 2017 15:44:38 -0800 Message-Id: <20171129234442.655-4-samitolvanen@google.com> X-Mailer: git-send-email 2.15.0.531.g2ccb3012c9-goog In-Reply-To: <20171129234442.655-1-samitolvanen@google.com> References: <20171129234442.655-1-samitolvanen@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171129_154517_774572_EE8AF007 X-CRM114-Status: UNSURE ( 9.57 ) 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