https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90779
--- Comment #14 from Andrew Stubbs <ams at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #7) > if I compile just the first TU without the foo () call in there, and > .global .align 4 .u32 var$lto_priv$1[1] = { 5 }; > .global .align 4 .u32 var$lto_priv$0[1] = { 5 }; > if I compile both, so there is some magic that makes these global and > uglified so that there can be multiple such vars. > No idea where that happens, whether it is NVPTX specific etc. That ".global" doesn't refer to the object linkage; it refers to the "global" memory region, as opposed to the "shared" or "local" memory. In fact the compiler still regards the variable as "not public".