about summary refs log tree commit diff
path: root/sysdeps/unix/sysv
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-01-22 13:32:39 +1030
committerAlan Modra <amodra@gmail.com>2022-04-10 08:33:02 +0930
commit30afd8c44d6a0a8b0eddbadecb02c9b9dad3facf (patch)
tree780351e4692d10d0c35d49b78bc00d1f231bc31d /sysdeps/unix/sysv
parentc0efbf8920844b940b85ea340ea2eaee70da2fc0 (diff)
downloadglibc-30afd8c44d6a0a8b0eddbadecb02c9b9dad3facf.tar.gz
glibc-30afd8c44d6a0a8b0eddbadecb02c9b9dad3facf.tar.xz
glibc-30afd8c44d6a0a8b0eddbadecb02c9b9dad3facf.zip
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.
Diffstat (limited to 'sysdeps/unix/sysv')
-rw-r--r--sysdeps/unix/sysv/linux/dl-vdso.h2
1 files changed, 1 insertions, 1 deletions
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;