Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1816898pxa; Sun, 2 Aug 2020 22:50:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLd3xGq4dX4/O9tVUqQ0QRB731ZMBwtyfeuUXVjD14c5bSD09ccKSAG8kRAl/WMEMCTiSW X-Received: by 2002:a50:c449:: with SMTP id w9mr2888526edf.65.1596433853422; Sun, 02 Aug 2020 22:50:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596433853; cv=none; d=google.com; s=arc-20160816; b=Kv86ET07BbhpPidmNGeJ5WYI42KQOrGt5wrgUsNK7QLEsydyHlme0sh0q1+4vFw4WX iT2NMDzguBrRveMO8zzcyCllwMitcD3x6sa6u9Mnja2exaTQr6EYVYip5WxdzZpSEnBm ENqsYr7AbNKpYuz+khLLT3Fmunkp6J6FS1gO/8R2fZJjKO8hhLPILWP9HcHtSUm507DV Ih1vXb9jhE4/MHwvKXiDRHLzF2J2bpd8syhgxQrGgeETl7H9HOfBKBqRy6tdeWyNlEPv qvIgtMXCZhtlqm/OkJCL/C6cOD+dESwPXUiaPZu2TA7q5MTHN04rAzGTnn4UppKi0Vte hCSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=iVhQkFEgxDVVa1k/NmDMYKiPLDUD4ULVTRaA7/u4IlM=; b=psYrypI52oMxIdSdx8M4VHgSeRMFLz9q1boiPg8tTxifIVTf3Z4q9XuM3/wYlOzU5x x9QAKcRWKE7YLDmXXgn7OFBX24X5NZJA0Rt6YKcztTaBiVlXrlJviCL9mPi1SQ9U4Dao WiRtL4LWs4P3TvW50gyYnKPFkHWVitNtDdKIXYCIikHC5VgK69Q3hC2N/n5KHIF76drS MgIc0u2sU6ykz0MN7Y1CPF8Qn3R7Uch9/A4xfzwCx5/nky1p02YzpMTjKCwY18GtvT3b UnOHQuTow04fVsSoqnCDa9zM6d5hiiM0n778+WQ9lYvPdW77pWCojTxWHg+z+2l5kudd i7jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OaHenN3Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si10794758eja.174.2020.08.02.22.50.31; Sun, 02 Aug 2020 22:50:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OaHenN3Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728213AbgHCFuL (ORCPT + 99 others); Mon, 3 Aug 2020 01:50:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727015AbgHCFuL (ORCPT ); Mon, 3 Aug 2020 01:50:11 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34E24C06174A for ; Sun, 2 Aug 2020 22:50:11 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id bh1so7069237plb.12 for ; Sun, 02 Aug 2020 22:50:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=iVhQkFEgxDVVa1k/NmDMYKiPLDUD4ULVTRaA7/u4IlM=; b=OaHenN3YVA9KfZ2utjtSn+pK8YSMuWpxd1lwT6nfh+/qr4a2cdl9ninmyekQf7ix9H m63at5+JvoLK6yB7V1YE4wgc6bc4aqEMiG5cs/4i9WA5rbcdsxRJKDsK3Yms+1oTqjhZ 40l0GDIH6qleEuL4cKyW78crhy87f4PeKTpEqT+JTquYGLkun/8W9q0+fWbi+cCrccD3 T+ut6CYhiJ6Zxnx1jGAKzc4fHBZ2bRXZ/t9t553F5bkFH8F2HPryY2OrUkVlHjz4lKZR i4wZOeG+xaQNPoCeJjelaVz248B/MECUCCaCNMaYNisSYnGG+mpxV54CjbutGehYXxfH MH+g== 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; bh=iVhQkFEgxDVVa1k/NmDMYKiPLDUD4ULVTRaA7/u4IlM=; b=jWod+3cb6fYGx/RZ7VaxISqqYNfVlxxIBWO+Ghj9ldtHOoSdLOFUoR9uAEwLXm3WfI A5j+y4LX+Zr9uev64Ig1dCyLAWBZ4WeOeAk4nvABgTnwe56BY33whWE+JhG47MxgHOqk qAidC6U6wHcX11wTiSQdmUCwY2ufH2HU8ed0ssJ3ROC/6wFp4RBM5tmXLf5bHeaNhMF8 5Vjr9tbIf+/bxhizIw0iCNPivoqsWkpQ6JF/zESQwL8F0scLFWM5AnYEbhQ2xbBrwpUM bt1JCveTQucCbSr/o9ioNMbuOZRVNEFRcQgC/3TJ2Yv/pH0UZuI0EiRbTPzcbFvN/zV6 g5Fg== X-Gm-Message-State: AOAM532bhZ+sB1YpStkUOFn9Wl/dsCq0gqZO7QSXgnlrEUWjC+8hyt3c IAcL9mbls0Op9hMTyQ367Q== X-Received: by 2002:a17:90a:bf04:: with SMTP id c4mr14636664pjs.149.1596433810763; Sun, 02 Aug 2020 22:50:10 -0700 (PDT) Received: from mylaptop.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id s68sm17522651pfb.103.2020.08.02.22.50.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Aug 2020 22:50:10 -0700 (PDT) From: Pingfan Liu To: x86@kernel.org Cc: Pingfan Liu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Hans de Goede , Nick Desaulniers , Arvind Sankar , Steve Wahl , linux-kernel@vger.kernel.org, kexec@lists.infradead.org Subject: [PATCHv2] x86/purgatory: don't generate debug info for purgatory.ro Date: Mon, 3 Aug 2020 13:49:48 +0800 Message-Id: <1596433788-3784-1-git-send-email-kernelfans@gmail.com> X-Mailer: git-send-email 2.7.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Purgatory.ro is a standalone binary that is not linked against the rest of the kernel. Its image is copied into an array that is linked to the kernel, and from there kexec relocates it wherever it desires. Unlike the debug info for vmlinux, which can be used for analyzing crash such info is useless in purgatory.ro. And discarding them can save about 200K space. Original: 259080 kexec-purgatory.o Stripped debug info: 29152 kexec-purgatory.o Signed-off-by: Pingfan Liu Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Hans de Goede Cc: Nick Desaulniers Cc: Arvind Sankar Cc: Steve Wahl Cc: linux-kernel@vger.kernel.org Cc: kexec@lists.infradead.org To: x86@kernel.org --- arch/x86/purgatory/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/purgatory/Makefile b/arch/x86/purgatory/Makefile index 088bd76..d24b43a 100644 --- a/arch/x86/purgatory/Makefile +++ b/arch/x86/purgatory/Makefile @@ -32,7 +32,7 @@ KCOV_INSTRUMENT := n # make up the standalone purgatory.ro PURGATORY_CFLAGS_REMOVE := -mcmodel=kernel -PURGATORY_CFLAGS := -mcmodel=large -ffreestanding -fno-zero-initialized-in-bss +PURGATORY_CFLAGS := -mcmodel=large -ffreestanding -fno-zero-initialized-in-bss -g0 PURGATORY_CFLAGS += $(DISABLE_STACKLEAK_PLUGIN) -DDISABLE_BRANCH_PROFILING PURGATORY_CFLAGS += $(call cc-option,-fno-stack-protector) @@ -64,6 +64,9 @@ CFLAGS_sha256.o += $(PURGATORY_CFLAGS) CFLAGS_REMOVE_string.o += $(PURGATORY_CFLAGS_REMOVE) CFLAGS_string.o += $(PURGATORY_CFLAGS) +AFLAGS_REMOVE_setup-x86_$(BITS).o += -Wa,-gdwarf-2 +AFLAGS_REMOVE_entry64.o += -Wa,-gdwarf-2 + $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE $(call if_changed,ld) -- 2.7.5