This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ld-related bug in LTTng
- From: Alan Modra <amodra at gmail dot com>
- To: Martin Ünsal <martinunsal at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Sat, 3 May 2014 23:04:47 +0930
- Subject: Re: ld-related bug in LTTng
- Authentication-results: sourceware.org; auth=none
- References: <CACsXv7DMNwLfR521KXEw7SkN7Y8Tm13m+=x_T9yuWMcT-SiRpQ at mail dot gmail dot com> <20140501073529 dot GI16139 at bubble dot grove dot modra dot org> <CACsXv7BvXJR7+R_tTLk623Oez1ihhe1mL5HjowYqTunxsV_zqQ at mail dot gmail dot com> <20140501232327 dot GJ16139 at bubble dot grove dot modra dot org> <CACsXv7B5EhRH5w+O3Fvwbe7f3jFEfzDNpwEru=r+Vtk1Ut1QdA at mail dot gmail dot com>
On Fri, May 02, 2014 at 03:40:10PM -0700, Martin Ünsal wrote:
> On Thu, May 1, 2014 at 4:23 PM, Alan Modra <amodra@gmail.com> wrote:
> > Is gcc emitting the reference to __start___tracepoints_ptrs as hidden?
> > (Look at an object with readelf -s to see)
>
> Aha! No, it isn't.
>
> 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
>
> Here is the declaration:
>
> extern struct tracepoint * const __start___tracepoints_ptrs[]
> __attribute__((weak, visibility("hidden")));
>
> This looks like it is clearly a compiler issue. I will take this back
> to gcc-help mailing list.
It might be worth checking the assembly output, to rule out as
assembler issue. gcc -S with
extern void *const x __attribute__ ((weak, visibility ("hidden")));
void *const foo (void) { return x; }
on my powerpc 4.7.2 compiler emits
...
.weak x
.hidden x
--
Alan Modra
Australia Development Lab, IBM