Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2963119ybv; Mon, 24 Feb 2020 15:22:10 -0800 (PST) X-Google-Smtp-Source: APXvYqwYXKGMDpasaJiTjkD6GuaaSTJ7/mSqRwqHjcUDhMj44HjHSv2Cq6do52HGK2qOKpDMlg/z X-Received: by 2002:a9d:6b91:: with SMTP id b17mr39896746otq.235.1582586530023; Mon, 24 Feb 2020 15:22:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582586530; cv=none; d=google.com; s=arc-20160816; b=G4cumpgU/4dtvCSlC5XHeBfIn1Y7E5DxT9lMGIwIwaj7gFXhncMUz1tFxD45mBKNSO ft8StwBUWkPXUxh9ZZqo5GerFgMy47lH/qRZGrtORqwEEWvHdnc6WZPIAFHg8Ac4kPLc y0cND4P8+3kx0yrYIZ5ZlPPN83l4ix0palgPsk7J8ev2G7P4msjXe/qoz+qu/lcHjh1n +Oprar7lUhPB/AL8yqkEu+q8SxVchJ9g5YxpdYHVvPY5uRNOOaJc0H7+URtv4SorGO74 4VvQDVDZ+R/w3oZQO1km/bxQBqbXzdQx+O+iASdHbiFamo4DG1FFMCU1ss3zbusBB14X m0Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=dV6KOm+5xGU5Fmvg1Yr6S6y1zc/vzXFOAFt08+WthgA=; b=IZs5GaHwUZJmhlIuE2+yOEmLkiB0rvIt9Xl1lKJ0IPZV6kAMH8U5kBzNvh8Zx2A+u8 D7YATXkNiPWt1AgRu/ohGPdjXo74DwKVtmPADRy6wcwgJqXNnYBC8U+LpPQ5tp97XMLd y4pjANzvlLWEicducLSJB0fX+BqSwFY6vdBdXmcty5SeODMZeOxW0/QXP/eqeFVihWbh +HhlXZ2J4Mg3tZEuGp2pqOI7RUJ3TMY+qwSHjt3eU55HBiNSbta2I3+N+Wkp1KtVXXZ1 4Xq0OWDGujuQhlggtIg/ulj0Q72Y+sn4wkrc8tCdEq8sKnieWYWfOj3o3+cauKq4kTjr spCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w26si6516310otl.213.2020.02.24.15.21.50; Mon, 24 Feb 2020 15:22:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728011AbgBXXVf (ORCPT + 99 others); Mon, 24 Feb 2020 18:21:35 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:44430 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728432AbgBXXVd (ORCPT ); Mon, 24 Feb 2020 18:21:33 -0500 Received: by mail-qt1-f196.google.com with SMTP id j23so7786716qtr.11 for ; Mon, 24 Feb 2020 15:21:33 -0800 (PST) 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:mime-version:content-transfer-encoding; bh=dV6KOm+5xGU5Fmvg1Yr6S6y1zc/vzXFOAFt08+WthgA=; b=m0bXc9iU3025kiRW/zZjI4AHtpGqnPDVrvT76l6lBRbXl611pzzso6MtT2rLsBKo3A yfMAPOQHSbyjrSnuB5wPnLOrtgxnHj6BmR2cNb2bOcA8jMjhLkrenCizh75wFuQVjjzv RxRmFpkXA8iPedJ8Rs1mFLYr5/6uplx4qkfwU/CV4gqooY8vjip0ufMx8ZpWJcYZsguw VgFgun9fIko2IvS9gfEBR+0657gCXh73rlFuwdQE6ODg5NuaHaTnvXYXdIVkfJcbNP0u 20ceS+QFzd3EDy+rW6E3YNZb/xoIWJSWUW5UTrw8YfpY5Y0J8puA/+09CAxAEOUi7PgM 0zCg== X-Gm-Message-State: APjAAAWEpI9CNupr53QLV0phrP2uQOxwSEiYEADDLzbMcKKFk6GZS+Dx uiy6kZoIbLVLMK30tkZqXFo= X-Received: by 2002:ac8:2784:: with SMTP id w4mr195974qtw.218.1582586492814; Mon, 24 Feb 2020 15:21:32 -0800 (PST) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id 202sm3757849qkg.132.2020.02.24.15.21.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 15:21:32 -0800 (PST) From: Arvind Sankar To: Nick Desaulniers Cc: Borislav Petkov , Nathan Chancellor , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, LKML , clang-built-linux , Michael Matz , Fangrui Song , Kees Cook , Andy Lutomirski Subject: [PATCH v2 2/2] arch/x86: Drop unneeded linker script discard of .eh_frame Date: Mon, 24 Feb 2020 18:21:29 -0500 Message-Id: <20200224232129.597160-3-nivedita@alum.mit.edu> X-Mailer: git-send-email 2.24.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that we don't generate .eh_frame sections for the files in setup.elf and realmode.elf, the linker scripts don't need the /DISCARD/ any more. Remove the one in the main kernel linker script as well, since there are no .eh_frame sections already, and fix up a comment referencing .eh_frame. Update the comment in asm/dwarf2.h referring to .eh_frame so it continues to make sense, as well as being more specific. Signed-off-by: Arvind Sankar --- arch/x86/boot/compressed/vmlinux.lds.S | 5 ----- arch/x86/boot/setup.ld | 1 - arch/x86/include/asm/dwarf2.h | 4 ++-- arch/x86/kernel/vmlinux.lds.S | 7 ++----- arch/x86/realmode/rm/realmode.lds.S | 1 - 5 files changed, 4 insertions(+), 14 deletions(-) diff --git a/arch/x86/boot/compressed/vmlinux.lds.S b/arch/x86/boot/compressed/vmlinux.lds.S index 469dcf800a2c..508cfa6828c5 100644 --- a/arch/x86/boot/compressed/vmlinux.lds.S +++ b/arch/x86/boot/compressed/vmlinux.lds.S @@ -73,9 +73,4 @@ SECTIONS #endif . = ALIGN(PAGE_SIZE); /* keep ZO size page aligned */ _end = .; - - /* Discard .eh_frame to save some space */ - /DISCARD/ : { - *(.eh_frame) - } } diff --git a/arch/x86/boot/setup.ld b/arch/x86/boot/setup.ld index 3da1c37c6dd5..24c95522f231 100644 --- a/arch/x86/boot/setup.ld +++ b/arch/x86/boot/setup.ld @@ -52,7 +52,6 @@ SECTIONS _end = .; /DISCARD/ : { - *(.eh_frame) *(.note*) } diff --git a/arch/x86/include/asm/dwarf2.h b/arch/x86/include/asm/dwarf2.h index ae391f609840..f71a0cce9373 100644 --- a/arch/x86/include/asm/dwarf2.h +++ b/arch/x86/include/asm/dwarf2.h @@ -42,8 +42,8 @@ * Emit CFI data in .debug_frame sections, not .eh_frame sections. * The latter we currently just discard since we don't do DWARF * unwinding at runtime. So only the offline DWARF information is - * useful to anyone. Note we should not use this directive if - * vmlinux.lds.S gets changed so it doesn't discard .eh_frame. + * useful to anyone. Note we should not use this directive if we + * ever decide to enable DWARF unwinding at runtime. */ .cfi_sections .debug_frame #else diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index e3296aa028fe..5cab3a29adcb 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -313,8 +313,8 @@ SECTIONS . = ALIGN(8); /* - * .exit.text is discard at runtime, not link time, to deal with - * references from .altinstructions and .eh_frame + * .exit.text is discarded at runtime, not link time, to deal with + * references from .altinstructions */ .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { EXIT_TEXT @@ -412,9 +412,6 @@ SECTIONS DWARF_DEBUG DISCARDS - /DISCARD/ : { - *(.eh_frame) - } } diff --git a/arch/x86/realmode/rm/realmode.lds.S b/arch/x86/realmode/rm/realmode.lds.S index 64d135d1ee63..63aa51875ba0 100644 --- a/arch/x86/realmode/rm/realmode.lds.S +++ b/arch/x86/realmode/rm/realmode.lds.S @@ -71,7 +71,6 @@ SECTIONS /DISCARD/ : { *(.note*) *(.debug*) - *(.eh_frame*) } #include "pasyms.h" -- 2.24.1