All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Kaehlcke <mka-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
To: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	mark.rutland-5wv7dgnIgG8@public.gmane.org,
	ghackmann-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org,
	Bernhard.Rosenkranzer-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	grundler-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
	md-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 3/3] efi/libstub: arm64: set -fpie when building the EFI stub
Date: Thu, 8 Jun 2017 12:08:04 -0700	[thread overview]
Message-ID: <20170608190804.GG141096@google.com> (raw)
In-Reply-To: <20170518090953.32628-4-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

El Thu, May 18, 2017 at 10:09:53AM +0100 Ard Biesheuvel ha dit:

> Clang may emit absolute symbol references when building in non-PIC mode,
> even when using the default 'small' code model, which is already mostly
> position independent to begin with, due to its use of adrp/add pairs
> that have a relative range of +/- 4 GB. The remedy is to pass the -fpie
> flag, which can be done safely now that the code has been updated to avoid
> GOT indirections (which may be emitted due to the compiler assuming that
> the PIC/PIE code may end up in a shared library that is subject to ELF
> symbol preemption)
> 
> Passing -fpie when building code that needs to execute at an a priori
> unknown offset is arguably an improvement in any case, and given that
> the recent visibility changes allow the PIC build to pass with GCC as
> well, let's add -fpie for all arm64 builds rather than only for Clang.
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

Tested-by: Matthias Kaehlcke <mka-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>

WARNING: multiple messages have this Message-ID (diff)
From: mka@chromium.org (Matthias Kaehlcke)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] efi/libstub: arm64: set -fpie when building the EFI stub
Date: Thu, 8 Jun 2017 12:08:04 -0700	[thread overview]
Message-ID: <20170608190804.GG141096@google.com> (raw)
In-Reply-To: <20170518090953.32628-4-ard.biesheuvel@linaro.org>

El Thu, May 18, 2017 at 10:09:53AM +0100 Ard Biesheuvel ha dit:

> Clang may emit absolute symbol references when building in non-PIC mode,
> even when using the default 'small' code model, which is already mostly
> position independent to begin with, due to its use of adrp/add pairs
> that have a relative range of +/- 4 GB. The remedy is to pass the -fpie
> flag, which can be done safely now that the code has been updated to avoid
> GOT indirections (which may be emitted due to the compiler assuming that
> the PIC/PIE code may end up in a shared library that is subject to ELF
> symbol preemption)
> 
> Passing -fpie when building code that needs to execute at an a priori
> unknown offset is arguably an improvement in any case, and given that
> the recent visibility changes allow the PIC build to pass with GCC as
> well, let's add -fpie for all arm64 builds rather than only for Clang.
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Tested-by: Matthias Kaehlcke <mka@chromium.org>

  parent reply	other threads:[~2017-06-08 19:08 UTC|newest]

Thread overview: 20+ 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 ` Ard Biesheuvel
     [not found] ` <20170518090953.32628-1-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-05-18  9:09   ` [PATCH 1/3] efi/libstub: arm64: use hidden attribute for struct screen_info reference Ard Biesheuvel
2017-05-18  9:09     ` Ard Biesheuvel
     [not found]     ` <20170518090953.32628-2-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-06-08 19:06       ` Matthias Kaehlcke
2017-06-08 19:06         ` Matthias Kaehlcke
2017-05-18  9:09   ` [PATCH 2/3] efi/libstub: arm64: force 'hidden' visibility for section markers Ard Biesheuvel
2017-05-18  9:09     ` Ard Biesheuvel
     [not found]     ` <20170518090953.32628-3-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-06-08 19:07       ` Matthias Kaehlcke
2017-06-08 19:07         ` Matthias Kaehlcke
2017-05-18  9:09   ` [PATCH 3/3] efi/libstub: arm64: set -fpie when building the EFI stub Ard Biesheuvel
2017-05-18  9:09     ` Ard Biesheuvel
     [not found]     ` <20170518090953.32628-4-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-06-08 19:08       ` Matthias Kaehlcke [this message]
2017-06-08 19:08         ` Matthias Kaehlcke
     [not found]         ` <20170608190804.GG141096-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2017-06-08 19:18           ` Ard Biesheuvel
2017-06-08 19:18             ` Ard Biesheuvel
     [not found]             ` <CAKv+Gu--WbvmS3EMPSD8sx6yVqgHQJO1r70+SYBRo_WZjUxioQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-08 19:44               ` Matthias Kaehlcke
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
2017-06-09  9:02     ` 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=20170608190804.GG141096@google.com \
    --to=mka-f7+t8e8rja9g9huczpvpmw@public.gmane.org \
    --cc=Bernhard.Rosenkranzer-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=ghackmann-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=grundler-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org \
    --cc=md-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.