From patchwork Fri Nov 3 17:11:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 10040863 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 47C88602D8 for ; Fri, 3 Nov 2017 17:20:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E3B529099 for ; Fri, 3 Nov 2017 17:20:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22F3729743; Fri, 3 Nov 2017 17:20:51 +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 AAD8729099 for ; Fri, 3 Nov 2017 17:20:50 +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=2/UZ2fFrR5YHc+71ytSr+v7BnT+zDe1ydQeySZ8tug0=; b=iGuA5TJfcIkUjK6vwHs+tXbff8 wpZSgq22J8a7PW9CL4BEWoU6syocKMchDXqi6ypasmk/czk9eo1OWc/r14MVGPeEOsrfXG0yyTVUp uIDYoiP8BvI9qxFF2YsjofbkOybNO8Jq2YHNF9H32jJJD88hSt3f2UWkC0GGQFgZY595TmD2GQBqh anoyZXqBq+2ARJK2MFXhuC0eWfYKvPKii5fEObDsSoYwBr2DS9YW8r9mXiuFtETsJ5RixuHhVIq4x FXbfX5xXdVgZpB+lSCgbg68C86l5dzEL6X8f5upsQhscI/0uBTQcPoKzJx/tCUK51OXL9ei1yLBNi tHWPTvuQ==; 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 1eAfe9-0007Bk-6y; Fri, 03 Nov 2017 17:20:45 +0000 Received: from mail-io0-x243.google.com ([2607:f8b0:4001:c06::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eAfWf-0008Kx-3k for linux-arm-kernel@lists.infradead.org; Fri, 03 Nov 2017 17:13:07 +0000 Received: by mail-io0-x243.google.com with SMTP id i38so7761326iod.2 for ; Fri, 03 Nov 2017 10:12:39 -0700 (PDT) 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=5wWW/bd95ITJOlAY9Rez9KK8Wbr1ItksFIw0Qs2hGIA=; b=ZQO3kRX1elcAMecCuy99H7ttpsfjacbXvg1HY/HSIphL8UAWvR5ONSXE8/XMEo3t6F z3vpuYI7ayd1HABi5AF/qsYfNXzHZFxn+rygtwmyr5YTEth2FYIHQ/OCHrOYloD/L2ml aS579CUj/0CEAe6+s1iVb2ARnkomG3syuKhzlNa3tdi8Sq/lHaENKWmZ+PevipRGOGfK sXyRey7C1y+myDEqbXitiVg2PFjsCKfBZwg23LTYzzsMOfgM/aSwJuFCBlEFCLqkcYSG eeRzxwX8SNnf0zNgB6IIjQmLqRfOZKyBW2jPfKpOEKu4llE5avyCeDb8un7NfvEMxGdq 0FLg== 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=5wWW/bd95ITJOlAY9Rez9KK8Wbr1ItksFIw0Qs2hGIA=; b=MrlXXaUZHKAff75KUrOxttgzNbunh3ccMKgzna8LmlrAE9RtRmzla6JemeDVO4E5GA /Sp5INAJiWkSncgvmDBmSowz9TNHT9e4CEzmqjDvojqiysfJwOfcgf9zRNDxlxZ4b16A M9VPC2GXdy4y53z5/13eH+NzBgfzjMZtFih02uff6/OuzFKygPZRuBNcCgoqhXIK5o+3 84mhYHhDegHxyV7qZdHa3w1+/8q7+dVbfpWv5cv25jmL2ZAxP0NnsxuEDlI4ofylJPfO IkXr/1ZYiFz5DlYUznE5Lblw5utTYTRQcg3ZJCzKN2dbuxSAP/7k8lYdKK84gxK314d0 0Seg== X-Gm-Message-State: AJaThX5Dzpl/iJmUd0C6UAgnnXcP3mtpN3VomArfUK0AwoPn+q6juQV0 qCnswuuWzLTVs5KrANfokOUNuB96unw= X-Google-Smtp-Source: ABhQp+TCaM8TZdrtN7X0PBgNkWBqY/h0TIcEaa9ddQJxZlpKRM/gVjAP5pAqf8vrSBR6uP6ziYAF9Q== X-Received: by 10.107.222.9 with SMTP id v9mr9757131iog.20.1509729159059; Fri, 03 Nov 2017 10:12:39 -0700 (PDT) Received: from samitolvanen.mtv.corp.google.com ([100.98.112.14]) by smtp.gmail.com with ESMTPSA id d186sm1370787itd.38.2017.11.03.10.12.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Nov 2017 10:12:37 -0700 (PDT) From: Sami Tolvanen To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 02/15] kbuild: fix LD_DEAD_CODE_DATA_ELIMINATION with GNU gold Date: Fri, 3 Nov 2017 10:11:46 -0700 Message-Id: <20171103171203.107569-3-samitolvanen@google.com> X-Mailer: git-send-email 2.15.0.403.gc27cc4dac6-goog In-Reply-To: <20171103171203.107569-1-samitolvanen@google.com> References: <20171103171203.107569-1-samitolvanen@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171103_101301_425335_9DD838BB X-CRM114-Status: UNSURE ( 9.88 ) 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 , Matthias Kaehlcke , Nick Desaulniers , Kees Cook , Greg Hackmann 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 8acfc1e099e1..d0070985c191 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -511,7 +511,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) { \ @@ -556,7 +556,7 @@ MEM_DISCARD(init.data) \ KERNEL_CTORS() \ MCOUNT_REC() \ - *(.init.rodata) \ + *(.init.rodata .init.rodata.*) \ FTRACE_EVENTS() \ TRACE_SYSCALLS() \ KPROBE_BLACKLIST() \ @@ -575,7 +575,7 @@ EARLYCON_TABLE() #define INIT_TEXT \ - *(.init.text) \ + *(.init.text .init.text.*) \ *(.text.startup) \ MEM_DISCARD(init.text) @@ -592,7 +592,7 @@ MEM_DISCARD(exit.text) #define EXIT_CALL \ - *(.exitcall.exit) + KEEP(*(.exitcall.exit)) /* * bss (Block Started by Symbol) - uninitialized data