From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1062) id 4550C3858403; Mon, 11 Apr 2022 01:30:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4550C3858403 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alan Modra To: glibc-cvs@sourceware.org Subject: [glibc] linux: Constify rfv variable in dl_vdso_vsym X-Act-Checkin: glibc X-Git-Author: Alan Modra X-Git-Refname: refs/heads/master X-Git-Oldrev: c0efbf8920844b940b85ea340ea2eaee70da2fc0 X-Git-Newrev: 30afd8c44d6a0a8b0eddbadecb02c9b9dad3facf Message-Id: <20220411013025.4550C3858403@sourceware.org> Date: Mon, 11 Apr 2022 01:30:25 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2022 01:30:25 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=30afd8c44d6a0a8b0eddbadecb02c9b9dad3facf commit 30afd8c44d6a0a8b0eddbadecb02c9b9dad3facf Author: Alan Modra Date: Sat Jan 22 13:32:39 2022 +1030 linux: Constify rfv variable in dl_vdso_vsym Compilers may decide to put the rfv variable in .data rather than on the stack. It's slightly better to put it in .data.rel.ro.local instead. Regardles of that, making it const may enable further optimisations. Found when examining relative relocations (GOT ones in particular) as part of enabling static-pie for PowerPC64. Diff: --- sysdeps/unix/sysv/linux/dl-vdso.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/unix/sysv/linux/dl-vdso.h b/sysdeps/unix/sysv/linux/dl-vdso.h index bfefce8f35..8611488acc 100644 --- a/sysdeps/unix/sysv/linux/dl-vdso.h +++ b/sysdeps/unix/sysv/linux/dl-vdso.h @@ -45,7 +45,7 @@ dl_vdso_vsym (const char *name) ElfW (Sym) wsym = { 0 }; wsym.st_info = (unsigned char) ELFW (ST_INFO (STB_WEAK, STT_NOTYPE)); - struct r_found_version rfv = { VDSO_NAME, VDSO_HASH, 1, NULL }; + const struct r_found_version rfv = { VDSO_NAME, VDSO_HASH, 1, NULL }; /* Search the scope of the vdso map. */ const ElfW (Sym) *ref = &wsym;