Received: by 10.213.65.68 with SMTP id h4csp881404imn; Tue, 20 Mar 2018 18:48:27 -0700 (PDT) X-Google-Smtp-Source: AG47ELuvnoFlC+VdJ9PmUWEbBGOu0AUjnV7UVlPPKRSFuIx3OIdwbwJeVAvVvzs6sTPdb4Fzc230 X-Received: by 10.98.229.21 with SMTP id n21mr15343637pff.158.1521596907356; Tue, 20 Mar 2018 18:48:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521596907; cv=none; d=google.com; s=arc-20160816; b=bK3j8oyB1oSKRFxdX4vlTA1tvKR4EiKaRkRxY70uIYYkOR7VD5YbsRsMKDB+ZVk0FL FbYAtv1Apt/CWB+eQO61DQBTQN32v5asPXxUG0OA8r5mzpZFl4zRPjqSJgKQ14TV6niz gx3PqU16NoL8qMWmGY5ANyjQhw10q04nBauff+apLA56eRzrBiZrJLt6I/vl1AEOHLp0 J1cGQvtH2DlUZA6bnGNNQ/P4bWIxqSIp6J5HCZyv3f7BsITK+I7KVrlGzDHE3yQkJQKL /hqTOjtsVil29pIvP6UiDn/PgtbwwGDZxHNhD53UXP99RK+QnL4MQp8GNHOzqs94XSWi NgMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Mv9AHLmp69ypgrjiveFCQ9bfzhx1rPQ3Brxdoms7jjw=; b=ForfiHIMP5fyfVKzy8mvCzUQDZjwCwDyPWvKZzWYVdkthj9w7cLK9cL2r6O49RtLrP HZI1oEOV+Or5ZHMEfE+f+JHhkEAVQNkYcww6PPJwwA0PbV4jakK8ThCMsUih6IVoVqtW 36IrWnmpYg5fIy2x0ZKdXmpEp6c2SC0sKmvmYKs3AgI/B/cwHBckCgUY6kGVf4JhGCqv t4g+HI6lW+09391F8IiwavFS6fIfm4ATr21NQ8U9ksx/8QfXRmeAFi46ZvEFS+p2lUWB P/Xf+M4oc62QqUoV94oQF/E4qWj8nAHlgWe9j6IZwxvHGva+eozjESjMYYwb+VFET1cL VtTQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q10si2251224pfc.183.2018.03.20.18.48.13; Tue, 20 Mar 2018 18:48:27 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751788AbeCUBqz (ORCPT + 99 others); Tue, 20 Mar 2018 21:46:55 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:46867 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751557AbeCUBqo (ORCPT ); Tue, 20 Mar 2018 21:46:44 -0400 Received: by mail-pl0-f66.google.com with SMTP id f5-v6so2182709plj.13 for ; Tue, 20 Mar 2018 18:46:44 -0700 (PDT) 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=Mv9AHLmp69ypgrjiveFCQ9bfzhx1rPQ3Brxdoms7jjw=; b=tbKiVbEu7VqumSEITf/V+mnDIwbd5lhg5U/9QZa4VbMvkL6lSsqoXezf9DzazBA+Rm pssTxEuB+51b/ixnQyAAEMfZCkyF9iz3txNj/FGSgCZWo7aKw9AGwIwoQCz7xsFLPF99 CW4XHvFDgt18C5imKJ//inu+F3U8QO7d8IysOlqmpC7PyqTy3VipOzJgH3fCrqN7i8ZL U+8rMChMkJ7D2NB5BE1dXPcTrOe0U6elo5u+a2XeqhkNwpxBrNckepS0jg+HYLI9xzOl j8J+xBf2XzpQvGveYQLDkM6qyioXt8jpVJ5096etCcoal7A1x12y5z0oMYamWrdEo5r0 WpEw== X-Gm-Message-State: AElRT7HdY53tq4L7mZJIYNshf6JdLf9g8W0xW7xAvgwsr+2+izmGIDnA 1FRAg6LmsLKT0d+ut17JaYyAOQ== X-Received: by 2002:a17:902:9a0c:: with SMTP id v12-v6mr11752926plp.142.1521596804351; Tue, 20 Mar 2018 18:46:44 -0700 (PDT) Received: from localhost.net ([2601:602:9802:a8dc::6a4d]) by smtp.gmail.com with ESMTPSA id x4sm6025787pfb.46.2018.03.20.18.46.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Mar 2018 18:46:43 -0700 (PDT) From: Laura Abbott To: Andy Lutomirski , mjw@fedoraproject.org, "H . J . Lu" , Masahiro Yamada Cc: Laura Abbott , Linus Torvalds , X86 ML , linux-kernel@vger.kernel.org, Nick Clifton , Cary Coutant Subject: [RFC PATCH 2/3] kbuild: Link with generated build-salt header Date: Tue, 20 Mar 2018 18:46:34 -0700 Message-Id: <20180321014635.29113-3-labbott@redhat.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180321014635.29113-1-labbott@redhat.com> References: <20180321014635.29113-1-labbott@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that we have a header with appropriate data, link it into the kernel and modules. If BUILD_TAG isn't set, the script should be empty. Signed-off-by: Laura Abbott --- Makefile | 4 +++- scripts/.gitignore | 1 + scripts/Makefile | 2 +- scripts/build-id.lds.S | 5 +++++ scripts/link-vmlinux.sh | 3 ++- 5 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 scripts/build-id.lds.S diff --git a/Makefile b/Makefile index de360625aec5..8bef8bfe7a82 100644 --- a/Makefile +++ b/Makefile @@ -425,7 +425,8 @@ KBUILD_AFLAGS_KERNEL := KBUILD_CFLAGS_KERNEL := KBUILD_AFLAGS_MODULE := -DMODULE KBUILD_CFLAGS_MODULE := -DMODULE -KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds +KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds \ + -T $(srctree)/scripts/build-id.lds GCC_PLUGINS_CFLAGS := export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC @@ -995,6 +996,7 @@ export KBUILD_VMLINUX_INIT := $(head-y) $(init-y) export KBUILD_VMLINUX_MAIN := $(core-y) $(libs-y2) $(drivers-y) $(net-y) $(virt-y) export KBUILD_VMLINUX_LIBS := $(libs-y1) export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds +export EXTRA_LDS := scripts/build-id.lds export LDFLAGS_vmlinux # used by scripts/package/Makefile export KBUILD_ALLDIRS := $(sort $(filter-out arch/%,$(vmlinux-alldirs)) arch Documentation include samples scripts tools) diff --git a/scripts/.gitignore b/scripts/.gitignore index 0442c06eefcb..6211a33c6f59 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore @@ -13,3 +13,4 @@ asn1_compiler extract-cert sign-file insert-sys-cert +build-id.lds diff --git a/scripts/Makefile b/scripts/Makefile index 25ab143cbe14..d343dab5d934 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -25,7 +25,7 @@ HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include HOSTLOADLIBES_sign-file = -lcrypto HOSTLOADLIBES_extract-cert = -lcrypto -always := $(hostprogs-y) $(hostprogs-m) +always := $(hostprogs-y) $(hostprogs-m) build-id.lds # The following hostprogs-y programs are only build on demand hostprogs-y += unifdef diff --git a/scripts/build-id.lds.S b/scripts/build-id.lds.S new file mode 100644 index 000000000000..bbc3a8e260c1 --- /dev/null +++ b/scripts/build-id.lds.S @@ -0,0 +1,5 @@ +#include + +SECTIONS { + ID_TAG +} diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index be56a1153014..2b57e0139acb 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -93,6 +93,7 @@ modpost_link() vmlinux_link() { local lds="${objtree}/${KBUILD_LDS}" + local extra_lds="${objtree}/${EXTRA_LDS}" local objects if [ "${SRCARCH}" != "um" ]; then @@ -114,7 +115,7 @@ vmlinux_link() fi ${LD} ${LDFLAGS} ${LDFLAGS_vmlinux} -o ${2} \ - -T ${lds} ${objects} + -T ${lds} -T ${extra_lds} ${objects} else if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then objects="-Wl,--whole-archive \ -- 2.16.2