Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp1384757ybs; Mon, 25 May 2020 14:51:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWBNjSb9pPO5slsyisAniMW94zN/4lScwx7VMTto+a2cyMhKlKLYV0f5YfQdwSsl/F4JUc X-Received: by 2002:aa7:d44a:: with SMTP id q10mr17571167edr.386.1590443476471; Mon, 25 May 2020 14:51:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590443476; cv=none; d=google.com; s=arc-20160816; b=CAEXYHf1kUdQaiM75PY7YuaeBCvDsMVz/o077tpldGgpU/8lFqEPQdnEzhq22QiReF OJWdc/NjNYEHjZsw6IbgWG91hBn+L1R5lBkV4JQP2qTW/0V1wc7G027G4Ruv9l88My7C 4Xqnzwf9r1cdehgk49OjX13BeD2cHWkBXZCNM3NeQMJq3iR5ANFVoWzlsz/FhPBmzjoy nvszuWyJX7odeGW5X7zDJZUXNoTlMOV8A5svIrpi+3jIa+lWpJutu/XyxF6DMqB/s1MY ZbqOFwyRhoN1IJ9rLJgiv+/gRdn2IQgKXnnSqs1r42neccCVzxyioMRfhWfJ5qvw0GmK /J3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=sfZXJ75xgK8Z7AdSn/t8ZW/rrd23X9AtbdmWzY3vzbE=; b=tEBuxwM0L1wRcqVcAytSz02F6Dlho9iCmUfwYAPJx7P+3lvNpUOB772Lw8OemZOaxW cDumOKNDpw11Ypu+Ib/T4ZH35KPjsg7u5XriFgTGZPrvaX7kT5eZHWam3KQgDZTfxtCm vffUcxlKRfQM3p3G9KZiQYKtbzPi4rAAkeXOojBS2BShfoW252442K5V44rjezdJb4gj WUjKEngaQfK7HXpFknO01DTmU+biu2XMksRk/QGX58dKj+PdoHQzEDXpOvdc+VzGH8XA RnKXGZYEJ5pLBzGG++UZKnGNOTpZng+iulhxf1wiXssE/gwm7wU88dknKEoNNZ4HS0Gh SsVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=j26s40At; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm8si12077045ejc.453.2020.05.25.14.50.53; Mon, 25 May 2020 14:51:16 -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=fail header.i=@gmail.com header.s=20161025 header.b=j26s40At; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390056AbgEYTW0 (ORCPT + 99 others); Mon, 25 May 2020 15:22:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389460AbgEYTW0 (ORCPT ); Mon, 25 May 2020 15:22:26 -0400 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1D53C061A0E for ; Mon, 25 May 2020 12:22:24 -0700 (PDT) Received: by mail-qk1-x742.google.com with SMTP id f83so18272330qke.13 for ; Mon, 25 May 2020 12:22:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=sfZXJ75xgK8Z7AdSn/t8ZW/rrd23X9AtbdmWzY3vzbE=; b=j26s40AtNNsoX0+X7BVHLHJLQ9a1t37sJQvuguTFhmcEVG2aswsv55KAKR5yVI5JZr vgpzqfLg10M8U9OQ3EY5JEuc+YJpZg+YOQb0xHiwgDsg0TQ7QUTzvssmOiaOv1MBj959 t2MralzwcxqjvU4WTiCORxczkq5hS8/fzCuX805DBQRQnZdrwvDTR/3NkUqDSHDfWM5C QycNe5ao1n4yaKD17U1stTFqcqNxukwllamUru574AuorHkPWo+wF0RTpMCOflmt95Ox 9Xa3i+lO9MSAlAWpfGKEn13uNWVeRG3PAT3VYW8xB1TsI1tmQZT1UNxzsI+uJ7OVaEY4 nuCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=sfZXJ75xgK8Z7AdSn/t8ZW/rrd23X9AtbdmWzY3vzbE=; b=ovwJdK+YLH9IO2vjn4R6uXG4GIABQ3wdILgHFvhkEBFtaTrQ3EY++iblaHGwmSIgJj dY4N9qyhPMBD7eN83VHZwyHtsi97nUf6LDCPti+YIUFYR6Bl+KTad08S0jGGLFsxdtKu m+lyBa60pAQ6Lr6TshVIjzqJPa3tPyFVOtak09Q3rzEQSyCq5jpfQwZsUPNrQD/vc5pD OVyxU3D1U+ZBaRzu6Byco9+eHCPZirdp2oLw66iKjDMVgMGCnpfecsoJq+5hUo5iPYKF fpEjirzTRJAlt3GzZ/4GAXf8GpheEnsr3oMs24PiPSHMi18tMZuaLtlKezYA92OPTmZn 9CZg== X-Gm-Message-State: AOAM533PeHfjP1GAHc+e6znp90WelmWL5mhtDDqROSFi2AYa0x7DTlqX DOLimRsP0n+lMyXbmUbOqM8= X-Received: by 2002:a37:b4c7:: with SMTP id d190mr26969826qkf.432.1590434543882; Mon, 25 May 2020 12:22:23 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id 99sm15323275qte.93.2020.05.25.12.22.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 12:22:23 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Mon, 25 May 2020 15:22:21 -0400 To: Fangrui Song Cc: Ard Biesheuvel , Arvind Sankar , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , X86 ML , Nick Desaulniers , Dmitry Golovin , clang-built-linux , Masahiro Yamada , Daniel Kiper , Linux Kernel Mailing List Subject: Re: [PATCH 4/4] x86/boot: Check that there are no runtime relocations Message-ID: <20200525192221.GA920865@rani.riverdale.lan> References: <20200524212816.243139-5-nivedita@alum.mit.edu> <20200525162626.4covxuycii6bvmjg@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200525162626.4covxuycii6bvmjg@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 25, 2020 at 09:26:26AM -0700, Fangrui Song wrote: > On 2020-05-25, Ard Biesheuvel wrote: > > > >Do we really need the macro here? Could we just do > > The output section name does not matter: it will be discarded by the linker. > > >.rel.dyn : { *(.rel.* .rela.*) } > > If for some reasons there is at least one SHT_REL and at least one > SHT_RELA, LLD will error "section type mismatch for .rel.dyn", while the > intended diagnostic is the assert below. > > >(or even > > > >.rel.dyn : { *(.rel.* } > >.rela.dyn : { *(.rela.*) } > > > >if the output section name matters, and always assert that both are empty)? > > .rel.dyn : { *(.rel.* } > .rela.dyn : { *(.rela.*) } > > looks good to me. > > > FWIW I intend to add -z rel and -z rela to LLD: https://reviews.llvm.org/D80496#inline-738804 > (binutils thread https://sourceware.org/pipermail/binutils/2020-May/111244.html) > > In case someone builds the x86-64 kernel with -z rel, your suggested > input section description will work out of the box... > Ok with me.