https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120002
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|FIXED |INVALID --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- .LC0: .xword hidden_symbol+65537 Is still valid for all shared libraries. The problem is you want a DSO with no dynamic relocations but that won't work here. If you want that you should do the similar thing as what the 32bit compat does for a similar reasons: ``` static __always_inline const struct vdso_time_data *__arch_get_vdso_u_time_data(void) { const struct vdso_time_data *ret; /* * This simply puts &_vdso_time_data into ret. The reason why we don't use * `ret = _vdso_time_data` is that the compiler tends to optimise this in a * very suboptimal way: instead of keeping &_vdso_time_data in a register, * it goes through a relocation almost every time _vdso_time_data must be * accessed (even in subfunctions). This is both time and space * consuming: each relocation uses a word in the code section, and it * has to be loaded at runtime. * * This trick hides the assignment from the compiler. Since it cannot * track where the pointer comes from, it will only use one relocation * where __aarch64_get_vdso_u_time_data() is called, and then keep the * result in a register. */ asm volatile("mov %0, %1" : "=r"(ret) : "r"(&vdso_u_time_data)); return ret; } ```