[4/5] Constify a variable in dl_vdso_vsym

Message ID Ye4ifnYB30HVP6dB@squeak.grove.modra.org
State Superseded
Headers
Series [PowerPC64] Use medium model toc accesses throughout |

Commit Message

Alan Modra Jan. 24, 2022, 3:52 a.m. UTC
  Just a tidy.

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.  Also, making it const may enable further optimisations.
  

Patch

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;