https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91766
--- Comment #5 from martin krastev ---
For reference, here what -fvisibility=hidden -fpic -fcommon produces on amd64
(https://godbolt.org/z/0aIyhl):
foo:
movl$0, room(%rip)
leaqroom(%rip), %rax
ret
Notice the abs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91766
--- Comment #3 from martin krastev ---
So it appears to be a clash between -fcommon and -fvisibility=hidden during
-fpic -- passing either -fno-common or -fno-pic drops the GOT indirection. And
explicitly hiding the symbol obviously solves it. Bu
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: blu.dark at gmail dot com
Target Milestone: ---
Passing -fvisibility=hidden does not stop GOT round-trips for global symbols
during -fpic. Example:
#if DO_HIDE
#define HIDE