From patchwork Mon Sep 30 12:46:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 34727 Received: (qmail 35828 invoked by alias); 30 Sep 2019 12:46:36 -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 35820 invoked by uid 89); 30 Sep 2019 12:46:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.redhat.com From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH] elf: Document late page size initialization via _dl_var_init Date: Mon, 30 Sep 2019 14:46:30 +0200 Message-ID: <87muem2bq1.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 [For riscv, see the removal I just posted.] 2019-09-30 Florian Weimer * sysdeps/unix/sysv/linux/aarch64/dl-static.c (_dl_var_init): Add comment. * sysdeps/unix/sysv/linux/ia64/dl-static.c (_dl_var_init): Likewise. * sysdeps/unix/sysv/linux/m68k/dl-static.c (_dl_var_init): Likewise. * sysdeps/unix/sysv/linux/mips/dl-static.c (_dl_var_init): Likewise. * sysdeps/unix/sysv/linux/powerpc/dl-static.c (_dl_var_init): Likewise. diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-static.c b/sysdeps/unix/sysv/linux/aarch64/dl-static.c index b444723a6f..992440b504 100644 --- a/sysdeps/unix/sysv/linux/aarch64/dl-static.c +++ b/sysdeps/unix/sysv/linux/aarch64/dl-static.c @@ -20,6 +20,12 @@ #ifdef SHARED +/* Update GLRO(dl_pagesize) to the run-time page size. After static + dlopen, the constant initializer EXEC_PAGESIZE for + GLRO(dl_pagesize) in elf/rtld.c is not correct for implementations + which do not use EXEC_PAGESIZE as the page size. (In the static + dlopen case, the ld.so initialization code never runs because the + inner dynamic loader is not active.) */ void _dl_var_init (void *array[]) { diff --git a/sysdeps/unix/sysv/linux/ia64/dl-static.c b/sysdeps/unix/sysv/linux/ia64/dl-static.c index aaf09adc0c..3a5fb3a958 100644 --- a/sysdeps/unix/sysv/linux/ia64/dl-static.c +++ b/sysdeps/unix/sysv/linux/ia64/dl-static.c @@ -20,6 +20,14 @@ #ifdef SHARED +/* Update GLRO(dl_pagesize) and GLRO(dl_clktck). + + After static dlopen, the constant initializer EXEC_PAGESIZE for + GLRO(dl_pagesize) in elf/rtld.c is not correct for implementations + which do not use EXEC_PAGESIZE as the page size. (In the static + dlopen case, the ld.so initialization code never runs because the + inner dynamic loader is not active.) Likewise for + GLRO(dl_clktck). */ void _dl_var_init (void *array[]) { diff --git a/sysdeps/unix/sysv/linux/m68k/dl-static.c b/sysdeps/unix/sysv/linux/m68k/dl-static.c index 7ad0f0790f..8ab3abda68 100644 --- a/sysdeps/unix/sysv/linux/m68k/dl-static.c +++ b/sysdeps/unix/sysv/linux/m68k/dl-static.c @@ -20,6 +20,12 @@ #ifdef SHARED +/* Update GLRO(dl_pagesize) to the run-time page size. After static + dlopen, the constant initializer EXEC_PAGESIZE for + GLRO(dl_pagesize) in elf/rtld.c is not correct for implementations + which do not use EXEC_PAGESIZE as the page size. (In the static + dlopen case, the ld.so initialization code never runs because the + inner dynamic loader is not active.) */ void _dl_var_init (void *array[]) { diff --git a/sysdeps/unix/sysv/linux/mips/dl-static.c b/sysdeps/unix/sysv/linux/mips/dl-static.c index c71c18de71..4a606e42a2 100644 --- a/sysdeps/unix/sysv/linux/mips/dl-static.c +++ b/sysdeps/unix/sysv/linux/mips/dl-static.c @@ -20,6 +20,12 @@ #ifdef SHARED +/* Update GLRO(dl_pagesize) to the run-time page size. After static + dlopen, the constant initializer EXEC_PAGESIZE for + GLRO(dl_pagesize) in elf/rtld.c is not correct for implementations + which do not use EXEC_PAGESIZE as the page size. (In the static + dlopen case, the ld.so initialization code never runs because the + inner dynamic loader is not active.) */ void _dl_var_init (void *array[]) { diff --git a/sysdeps/unix/sysv/linux/powerpc/dl-static.c b/sysdeps/unix/sysv/linux/powerpc/dl-static.c index d176f96495..ff0cdf46fa 100644 --- a/sysdeps/unix/sysv/linux/powerpc/dl-static.c +++ b/sysdeps/unix/sysv/linux/powerpc/dl-static.c @@ -20,6 +20,12 @@ #ifdef SHARED +/* Update GLRO(dl_pagesize) to the run-time page size. After static + dlopen, the constant initializer EXEC_PAGESIZE for + GLRO(dl_pagesize) in elf/rtld.c is not correct for implementations + which do not use EXEC_PAGESIZE as the page size. (In the static + dlopen case, the ld.so initialization code never runs because the + inner dynamic loader is not active.) */ void _dl_var_init (void *array[]) {