Weak hidden undefined symbol loses hidden visiblity with GCC 4.7.2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

I am having a compilation problem that showed up between GCC 4.6.4 and
4.7.2. It appears to relate to the handling of a weak, hidden,
undefined symbol by GCC.

This is the line of code:
extern struct tracepoint * const __start___tracepoints_ptrs[]
__attribute__((weak, visibility("hidden")));
File:
http://git.lttng.org/?p=lttng-ust.git;a=blob;f=include/lttng/tracepoint.h;h=c5a09d815db1383e539c8c455e8477dda29a579a;hb=HEAD

With GCC 4.6.4 the symbol is correctly emitted as hidden visibility:

$ arm-linux-gnueabi-readelf -s pmtrace_bundle_provider.o | grep __start_
   153: 00000000     0 NOTYPE  WEAK   HIDDEN   UND __start___tracepoints_ptr

With GCC 4.7.2 the symbol is incorrectly emitted as default visibility:

$ arm-linux-gnueabi-readelf -s pmtrace_bundle_provider.o | grep __start_
   144: 00000000     0 NOTYPE  WEAK   DEFAULT  UND __start___tracepoints_ptr

I am using the same compilation options in both cases:
-march=armv7-a -marm -mthumb-interwork -mfloat-abi=softfp -mfpu=neon
-mtune=cortex-a9 -mcpu=cortex-a9 -funwind-tables
-mvectorize-with-neon-quad -rdynamic  -c -pipe -O2 -pipe -g
-feliminate-unused-debug-types -O2 -Wall -W -D_REENTRANT -fPIC

Any thoughts? Is this a known issue? Can you suggest a workaround?

Thanks,
Martin

References:
http://lists.lttng.org/pipermail/lttng-dev/2014-April/022950.html
http://gcc.gnu.org/ml/gcc-help/2014-04/msg00164.html
https://sourceware.org/ml/binutils/2014-05/msg00011.html
https://sourceware.org/ml/binutils/2014-05/msg00016.html




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux