This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] aarch64: Check PIC instead of SHARED in start.S
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Cc: nd at arm dot com
- Date: Mon, 02 Oct 2017 11:08:42 +0100
- Subject: Re: [PATCH] aarch64: Check PIC instead of SHARED in start.S
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs dot Nagy at arm dot com;
- Nodisclaimer: True
- References: <20170929213203.GG2482@gmail.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On 29/09/17 22:32, H.J. Lu wrote:
> Since start.o may be compiled as PIC, we should check PIC instead of
> SHARED.
>
> OK for master?
>
i believe that the compile/link tests worked..
..but i still don't understand how the GOT entries
of the startup code get initialized in PIE executable
at runtime.
>
> * sysdeps/aarch64/start.S (_start): Check PIC instead of SHARED.
> ---
> sysdeps/aarch64/start.S | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sysdeps/aarch64/start.S b/sysdeps/aarch64/start.S
> index c20433ad73..7a946506f2 100644
> --- a/sysdeps/aarch64/start.S
> +++ b/sysdeps/aarch64/start.S
> @@ -60,7 +60,7 @@ _start:
> /* Setup stack limit in argument register */
> mov x6, sp
>
> -#ifdef SHARED
> +#ifdef PIC
> adrp x0, :got:main
> ldr PTR_REG (0), [x0, #:got_lo12:main]
>
>