From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] efi/libstub: arm64: force 'hidden' visibility for section markers
Date: Thu, 18 May 2017 10:09:52 +0100 [thread overview]
Message-ID: <20170518090953.32628-3-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <20170518090953.32628-1-ard.biesheuvel@linaro.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 <ard.biesheuvel@linaro.org>
---
drivers/firmware/efi/libstub/arm64-stub.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
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 <asm/sections.h>
+#pragma GCC visibility pop
+
#include <linux/efi.h>
#include <asm/efi.h>
-#include <asm/sections.h>
#include <asm/sysreg.h>
#include "efistub.h"
--
2.9.3
next prev parent reply other threads:[~2017-05-18 9:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-18 9:09 [PATCH 0/3] efi: arm64: use -fpie for building the stub Ard Biesheuvel
2017-05-18 9:09 ` [PATCH 1/3] efi/libstub: arm64: use hidden attribute for struct screen_info reference Ard Biesheuvel
2017-06-08 19:06 ` Matthias Kaehlcke
2017-05-18 9:09 ` Ard Biesheuvel [this message]
2017-06-08 19:07 ` [PATCH 2/3] efi/libstub: arm64: force 'hidden' visibility for section markers Matthias Kaehlcke
2017-05-18 9:09 ` [PATCH 3/3] efi/libstub: arm64: set -fpie when building the EFI stub Ard Biesheuvel
2017-06-08 19:08 ` Matthias Kaehlcke
2017-06-08 19:18 ` Ard Biesheuvel
2017-06-08 19:44 ` Matthias Kaehlcke
2017-06-09 9:02 ` [PATCH 0/3] efi: arm64: use -fpie for building the stub Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170518090953.32628-3-ard.biesheuvel@linaro.org \
--to=ard.biesheuvel@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).