Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4506268ybl; Sat, 21 Dec 2019 07:59:28 -0800 (PST) X-Google-Smtp-Source: APXvYqxUJc11y5FiebIY8Q02p7XNJBg2LD9OcIYQdNjHOTpDlGj5LztYRy4ZwK5QfNojwBMDGuYF X-Received: by 2002:a05:6830:139a:: with SMTP id d26mr22093056otq.75.1576943968769; Sat, 21 Dec 2019 07:59:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576943968; cv=none; d=google.com; s=arc-20160816; b=Vd43z2gynvRuup2SHKw1jgRubLYFzAhvoki8XfOMjJ3OSv3du8xtNSa4x905t5vrY2 1WTP8W0PgegS0VvMCsTWq1i3U2EHHZq3KwRX/y860hmY+iQMCScJDB7b+uxzY68MhfL2 n5Z6qVNLwwP0X04McfwnXQOjIzLh0orATBoOjE/f9rF7v4Pma7oav2VyivijMbJQHaoO ejmHNc/Sk8xzUuZNLUAUueHMMqrWrzawgEVjNgPQrJbrPHIK/mO01VwBCeWKcbSyvaaK ebtHrL9KfhR2aWDCWOUXa0R6qyLh7sd1SD2lpJtIF1nUAADDkI3HTmLlFItHTEKgZkTI iZxA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=IalKy0cIDykcqIOovYMNggMAbyERadJBeyOCwn69dUI=; b=JVCvTzmspttGPKgVcq8J99a5qOi4pZyqt2X7R6ILTKkhqF2qufoJhgqiu2NQ5wWnjH zB85oMU6QPSA66ViZgpfBQfxXDUc6IacZflNga5LUdZblu3MwrZAAHEuVNzgeYyum5Zl 2aw6mCqeUyKLpLJqWRCuKNJ6xr0mC85iRVnSCInIh98nLQ3DO+Bmh4ZGngC7ssmu3hqT NEVS+C0V/ZK2pDglJ34l5nAdjcLgQ0SrqVfL3dc4jPVe6eSe1xkXAkob1e5xjQRqKCjp Dfu00My3j4lUCjV8A8KNMxlMDnImws2qBRUQldmgvjj4u9t2f+cDm3SVtB0cLz6WACbm ONBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="rI/yCLRW"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r15si4319705ota.264.2019.12.21.07.59.12; Sat, 21 Dec 2019 07:59:28 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="rI/yCLRW"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726949AbfLUPSx (ORCPT + 99 others); Sat, 21 Dec 2019 10:18:53 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:39591 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726716AbfLUPSx (ORCPT ); Sat, 21 Dec 2019 10:18:53 -0500 Received: by mail-pf1-f195.google.com with SMTP id q10so6875291pfs.6 for ; Sat, 21 Dec 2019 07:18:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=IalKy0cIDykcqIOovYMNggMAbyERadJBeyOCwn69dUI=; b=rI/yCLRW1ThOuyKlWa7kZYOiWbm1zu6K68+an8IKhVLuNvGgnWfpgFnH4UDCGl3fYg icPykowvK+rzcD5torv5jOkqTGxAvzA4IXkGKQcFBrP8RZ8VTPoxcBzZ7CmaVbOHF0hx eqP3eLTp8TXwnYRDu23M7ytsmL5TXh12UbNjrSQaIb/4Ok3UBNjtTgAn5LSn00MNM6e+ VITjl3Er4YJM2hzPi9jay6JF58oel4H7eUHbxvPnE/ZKTNA9g8jiSZjVJSl+mqYHjQXC 7l6i6Al18JcyPrEIDjGmWCgLyBkLAD6uO+Wehnm2dspIL4AKMDDGg0KlIPec8WjrUK6F n6Gw== 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:mime-version :content-transfer-encoding; bh=IalKy0cIDykcqIOovYMNggMAbyERadJBeyOCwn69dUI=; b=uASjPRi+NSg0a9bpBYGM2KzLaeKELZ/c/eK/8yxU6+7Mdmka3e4U3m1YEtMJlhBfRE mNvbAK+1zfiWYBay03aOJQMXJLA6ybLG4pHSpbhh26L7uVZ2awXmzzgZY+cw6K8aQ9os GMkCKi2DRWDcyRt/67WR8xCDuSAeR1sozYSLSIEtBwggknxjRCe7fPV3CKhNxoO7NmDb U9oPytNOmM71N8arf3ha4h88pjnOgIboJK/4D67WQV68dtlJFhCaMJ6qBVHSNqs72tb0 /QurqQFibISEinfCQ4K67PS/8nkxM0kSdiijXE9/CwaNUvC6KifLBeK6pCU7vFaXF/DE 4uyQ== X-Gm-Message-State: APjAAAXNlMb3L0upk1+VQIjKBDNxpnq3VqWd5zwFIY+P1Ijqh587YFsc o3fpU9Fqn/AHrEkElOu29ISRP4Kb7LU= X-Received: by 2002:a63:181:: with SMTP id 123mr20844550pgb.36.1576941532049; Sat, 21 Dec 2019 07:18:52 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9200:4e0::36e9]) by smtp.gmail.com with ESMTPSA id t187sm17233646pfd.21.2019.12.21.07.18.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2019 07:18:51 -0800 (PST) From: Khem Raj To: linux-kernel@vger.kernel.org Cc: Khem Raj , "Kirill A . Shutemov" , Kees Cook , "H. Peter Anvin" , Ingo Molnar , Thomas Gleixner , x86-ml , Arnd Bergmann Subject: [PATCH] x86/boot/compressed/64: Define __force_order only when CONFIG_RANDOMIZE_BASE is unset Date: Sat, 21 Dec 2019 07:18:13 -0800 Message-Id: <20191221151813.1573450-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.24.1 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 kaslr_64.c also defines the same variable, however when both files are included into final link, linker complains about multiple definition of `__force_order' which is coming from kaslr_64.o and pgtable_64.o, its possible that kaslr_64.o is disabled via CONFIG_RANDOMIZE_BASE config option, therefore define it conditionally only when CONFIG_RANDOMIZE_BASE is not set Since arch/x86/boot/compressed/Makefile overrides global CFLAGS it loses -fno-common option which would have caught this Signed-off-by: Khem Raj Cc: Kirill A. Shutemov Cc: Kees Cook Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Thomas Gleixner Cc: x86-ml Cc: Arnd Bergmann --- arch/x86/boot/compressed/pgtable_64.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/boot/compressed/pgtable_64.c b/arch/x86/boot/compressed/pgtable_64.c index c8862696a47b..077d19268b0b 100644 --- a/arch/x86/boot/compressed/pgtable_64.c +++ b/arch/x86/boot/compressed/pgtable_64.c @@ -12,7 +12,9 @@ * It is not referenced from the code, but GCC < 5 with -fPIE would fail * due to an undefined symbol. Define it to make these ancient GCCs work. */ +#ifndef CONFIG_RANDOMIZE_BASE unsigned long __force_order; +#endif #define BIOS_START_MIN 0x20000U /* 128K, less than this is insane */ #define BIOS_START_MAX 0x9f000U /* 640K, absolute maximum */ -- 2.24.1