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: 1169332 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-105471-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="GOjNkqn0"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46hhwy0N6Mz9sP7 for ; Mon, 30 Sep 2019 22:46:41 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; q=dns; s=default; b=m7gs+PGs0x2JZjRzywNB7kWrY1VwL wvWTAj6CI7K6e7ATogkEk9b4PPX5HR3wvZrK5tOUNV/U93MscziNYIX+8mYdCwkJ eRosac+rJb9JBtZzAS/Zl+Q4Adm/+ujxcvZjNNd/YVVteBDd1kLAmK5JJlVlI0tV XmAnZaxXsNsPDY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; s=default; bh=c4eg3UDiQMML1wC5n7sAv9qf4lQ=; b=GOj Nkqn02BkRIjHc4cw6TjudU1+FqQZoNShOhM56iX1w5NCRVm6opkyvIMlm+zCYOs0 DVtkEYKF5HFmKwpDQfKutGFlG0G1yfwcvEpE8PZNYdno+ELKEVDiHFSHzETs6Urv qsmr2Njltz/UtuelqSMe1g/28Z0H48Pd1TEz7Bis= 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[]) {