From patchwork Fri Jan 10 22:27:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tulio Magno Quites Machado Filho X-Patchwork-Id: 37298 X-Patchwork-Delegate: carlos@redhat.com Received: (qmail 76695 invoked by alias); 10 Jan 2020 22:30:49 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 76684 invoked by uid 89); 10 Jan 2020 22:30:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1250, HContent-Transfer-Encoding:8bit X-HELO: mx0a-001b2d01.pphosted.com From: Tulio Magno Quites Machado Filho To: Adhemerval Zanella , law@redhat.com, Florian Weimer , libc-alpha@sourceware.org Subject: [PATCH 1/2] powerpc: Initialize rtld_global_ro for static dlopen [BZ #20802] Date: Fri, 10 Jan 2020 19:27:42 -0300 Message-Id: <20200110222743.79551-1-tuliom@linux.ibm.com> In-Reply-To: <1c5c49e4-55b1-a525-44a4-e2929ff1001a@linaro.org> References: <1c5c49e4-55b1-a525-44a4-e2929ff1001a@linaro.org> MIME-Version: 1.0 Notice this patch is required in order to let the static dlopen test from the next patch to work. ----8<---- Initialize dl_auxv, dl_hwcap and dl_hwcap2 in rtld_global_ro for DSOs that have been statically dlopen'ed. Reviewed-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/powerpc/dl-static.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sysdeps/unix/sysv/linux/powerpc/dl-static.c b/sysdeps/unix/sysv/linux/powerpc/dl-static.c index 48fec16dca..59ce4e8972 100644 --- a/sysdeps/unix/sysv/linux/powerpc/dl-static.c +++ b/sysdeps/unix/sysv/linux/powerpc/dl-static.c @@ -26,17 +26,26 @@ _dl_var_init (void *array[]) /* It has to match "variables" below. */ enum { - DL_PAGESIZE = 0 + DL_PAGESIZE = 0, + DL_AUXV = 1, + DL_HWCAP = 2, + DL_HWCAP2 = 3, }; GLRO(dl_pagesize) = *((size_t *) array[DL_PAGESIZE]); + GLRO(dl_auxv) = (ElfW(auxv_t) *) *((size_t *) array[DL_AUXV]); + GLRO(dl_hwcap) = *((unsigned long int *) array[DL_HWCAP]); + GLRO(dl_hwcap2) = *((unsigned long int *) array[DL_HWCAP2]); } #else static void *variables[] = { - &GLRO(dl_pagesize) + &GLRO(dl_pagesize), + &GLRO(dl_auxv), + &GLRO(dl_hwcap), + &GLRO(dl_hwcap2), }; static void