https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125418
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |WAITING
--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
How can a hidden symbol be undefined?
[hjl@gnu-tgl-3 tmp]$ cat x.c
__attribute__((visibility("hidden")))
__attribute__((tls_model("initial-exec")))
extern __thread int x;
int
main (void)
{
x++;
return x > 30;
}
[hjl@gnu-tgl-3 tmp]$
/export/build/gnu/tools-build/glibc-many/install/compilers/alpha-linux-gnu/bin/alpha-glibc-linux-gnu-gcc-16.1.1
-O2 x.c
/export/build/gnu/tools-build/glibc-many/install/compilers/alpha-linux-gnu/alpha-glibc-linux-gnu/bin/ld:
/tmp/ccCI2ioX.o: in function `main':
(.text.startup+0x4): undefined reference to `x'
/export/build/gnu/tools-build/glibc-many/install/compilers/alpha-linux-gnu/alpha-glibc-linux-gnu/bin/ld:
(.text.startup+0x8): undefined reference to `x'
/export/build/gnu/tools-build/glibc-many/install/compilers/alpha-linux-gnu/alpha-glibc-linux-gnu/bin/ld:
(.text.startup+0x14): undefined reference to `x'
/export/build/gnu/tools-build/glibc-many/install/compilers/alpha-linux-gnu/alpha-glibc-linux-gnu/bin/ld:
a.out: hidden symbol `x' isn't defined
/export/build/gnu/tools-build/glibc-many/install/compilers/alpha-linux-gnu/alpha-glibc-linux-gnu/bin/ld:
final link failed: bad value
collect2: error: ld returned 1 exit status
[hjl@gnu-tgl-3 tmp]$