From e9177fba13549a8e2a6232f46080e5c6d3e467b1 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date: Wed, 21 Jun 2017 13:47:07 +0100
Subject: [PATCH] [AArch64] Use hidden __GI__dl_argv in rtld startup code

We rely on the symbol being locally defined so using extern symbol
is not correct and the linker may complain about the relocations.
---
 ChangeLog                    | 5 +++++
 sysdeps/aarch64/dl-machine.h | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

Index: glibc/sysdeps/aarch64/dl-machine.h
===================================================================
--- glibc.orig/sysdeps/aarch64/dl-machine.h
+++ glibc/sysdeps/aarch64/dl-machine.h
@@ -172,8 +172,8 @@ _dl_start_user:							\n\
 	cmp	x0, #0						\n\
 	bne	1b						\n\
 	// Update _dl_argv					\n\
-	adrp	x3, _dl_argv					\n\
-	str	x2, [x3, #:lo12:_dl_argv]			\n\
+	adrp	x3, __GI__dl_argv				\n\
+	str	x2, [x3, #:lo12:__GI__dl_argv]			\n\
 .L_done_stack_adjust:						\n\
 	// compute envp						\n\
 	add	x3, x2, x1, lsl #3				\n\
-- 
2.43.2

