From patchwork Thu May 18 09:09:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 100064 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp622868qge; Thu, 18 May 2017 02:10:10 -0700 (PDT) X-Received: by 10.99.52.70 with SMTP id b67mr3410472pga.44.1495098609928; Thu, 18 May 2017 02:10:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495098609; cv=none; d=google.com; s=arc-20160816; b=h6frX1H9JCEXq0ice9Y9pCVrKrKxlnR/7VvpBeqBVhcvSyCW9tLq/7DvY+O/xx10y4 RspI98lBZf/qA82o5uNNErPPZL5YVDA9yIbnEuOLLRk8Cr2ZvcPSiafBEawzkmW1jz+2 zCm9K/oUM1dnmzuZww9RdPtkUjhH8nTKVF75DPNFV/rrbsA9cB8rCs95kPLOt2ReBFPU tshze4HYxIROmjGtU1j2XaTCwYrfaugENAOpSn8cCyrqH/6tc8lgm7GcYUpHvjc8IzwB lXFuv62/CimYN4FlIW0gukXQSZJ5EUwpdKReIEZwtUd5b4SunayaGlwlzWG27bV9hDqF zh3A== 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:dkim-signature:arc-authentication-results; bh=JACxjbgKr16TJfRRPcWELM7Ka6lAjlO2qbD0N5MwRcY=; b=DpVGhURuiXQxN2v5yFrwXbgrpmBbnPJd3aIN//+FGCYzxPkJOAA3J8950jg5fqLuQJ pPyJk1Y9ulC4AlOodeHBbhwpAHq/d/OqI9gd+arAMA/MGv9LCIOf5nXYyddM5vrH2/iV wmnpRGC4RH6NUW3O0rad0dtM5HagkVlJ7G/bwLudaRwz0aBHEI/023WdPZuoCrtgf5gZ wtYEjjPa8y3LI8qAMOIrWFnOUoKTeLtgHTOdsI1gpNaMPkbOBz7WTpCCpAzwZMimvX5U 7YuKrOt/xWdwnvKOiY4sDpQBEkhTcdGThZ70jkB2Il+vcB+dP1ASkhCiXoC94l8gMw07 u/dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1si4627265pge.155.2017.05.18.02.10.09; Thu, 18 May 2017 02:10:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755317AbdERJKJ (ORCPT + 2 others); Thu, 18 May 2017 05:10:09 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:35088 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755130AbdERJKI (ORCPT ); Thu, 18 May 2017 05:10:08 -0400 Received: by mail-wm0-f46.google.com with SMTP id b84so193967719wmh.0 for ; Thu, 18 May 2017 02:10:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DNp3qkMnZfs77pPQiwGCELEqJ66JV1rv0BkiVbJyxLQ=; b=cW7BqYUwaTzcFAf2q7VZqVNmiinWuWKhRZa3JVSIs1LK8Mbi7BrD+s9ws7r3RLCOZg bsFoMUJbJmuT4WpoeaIyuVizUVBrCf3jRYK1stflTz53WenhvDghrRKoqDdfLCAfpuk8 p4BB/G1MYZAoAiMNAu0Zw+NbSzAys6R68TcTU= 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=DNp3qkMnZfs77pPQiwGCELEqJ66JV1rv0BkiVbJyxLQ=; b=HBRiZqJKaHu101aTAf4FIr+qWzUeL1Aoo96elOUu/11n/KbaDKZoOrjx9UXGAKOD3A ySNPNhtDSw2z8N3UFlclo4SOvhGqA6eh7A792feY1vOwQ/iNdiPhD/ogVeDsr9dx8xAT RB4FNqVvW3CmreUiXuKwwBVoeSYkqRJAKcSq/mx5fnBPuAzeyKi4lubH98KQwvrh7gRK gR9hzk6v4Te8AZTjpGN4sNONYJ9B6jFIK5oOUr157eWkBDHFegul3tRHUfDjTU3OmC1m ngcq5mu/lNORG1UvFJvuUbh4X7ZN2eQDHx9LHyU/TVXZhodA41eLwoE2Q8wSXhgPsHu5 fbzQ== X-Gm-Message-State: AODbwcC1P2hp6J+RZ/c7EhIaMOW05bKxSaw9VRnzHb2E01vHVq68W4dJ UbR+0j3Akl5+RVSw X-Received: by 10.80.165.105 with SMTP id z38mr2457791edb.60.1495098606864; Thu, 18 May 2017 02:10:06 -0700 (PDT) Received: from localhost.localdomain ([105.129.238.81]) by smtp.gmail.com with ESMTPSA id t17sm1406355edh.1.2017.05.18.02.10.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 May 2017 02:10:06 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: mark.rutland@arm.com, ghackmann@google.com, matt@codeblueprint.co.uk, mka@chromium.org, Bernhard.Rosenkranzer@linaro.org, grundler@chromium.org, md@google.com, linux-arm-kernel@lists.infradead.org, Ard Biesheuvel Subject: [PATCH 2/3] efi/libstub: arm64: force 'hidden' visibility for section markers Date: Thu, 18 May 2017 10:09:52 +0100 Message-Id: <20170518090953.32628-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170518090953.32628-1-ard.biesheuvel@linaro.org> References: <20170518090953.32628-1-ard.biesheuvel@linaro.org> Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org To prevent the compiler from emitting absolute references to the section markers when running in PIC mode, override the visibility to 'hidden' for all contents of asm/sections.h Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/libstub/arm64-stub.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Tested-by: Matthias Kaehlcke diff --git a/drivers/firmware/efi/libstub/arm64-stub.c b/drivers/firmware/efi/libstub/arm64-stub.c index b4c2589d7c91..f7a6970e9abc 100644 --- a/drivers/firmware/efi/libstub/arm64-stub.c +++ b/drivers/firmware/efi/libstub/arm64-stub.c @@ -9,9 +9,17 @@ * published by the Free Software Foundation. * */ + +/* + * To prevent the compiler from emitting GOT-indirected (and thus absolute) + * references to the section markers, override their visibility as 'hidden' + */ +#pragma GCC visibility push(hidden) +#include +#pragma GCC visibility pop + #include #include -#include #include #include "efistub.h"