public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Alan Modra <amodra@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc] linux: Constify rfv variable in dl_vdso_vsym Date: Mon, 11 Apr 2022 01:30:25 +0000 (GMT) [thread overview] Message-ID: <20220411013025.4550C3858403@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=30afd8c44d6a0a8b0eddbadecb02c9b9dad3facf commit 30afd8c44d6a0a8b0eddbadecb02c9b9dad3facf Author: Alan Modra <amodra@gmail.com> 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;
reply other threads:[~2022-04-11 1:30 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220411013025.4550C3858403@sourceware.org \ --to=amodra@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).