bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/21964] __start_SCN symbols aren't exported anymore


From: hjl.tools at gmail dot com
Subject: [Bug ld/21964] __start_SCN symbols aren't exported anymore
Date: Mon, 14 Aug 2017 16:59:47 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=21964

--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Michael Matz from comment #4)
> Created attachment 10353 [details]
> Tentative patch
> 
> Well, the problem is quite obvious.  Just compile this:
> 
> % cat t.c
> #include <assert.h>
> extern void * __start___verbose, * __stop___verbose;
> int foo(void)
> {
>   static int my_var __attribute__((section("__verbose"))) = 5;
>   if (__start___verbose == __stop___verbose) assert(0);
>   if (my_var == 5) return 0;
>   else return -1;
> }
> % gcc -c -fPIC t.c
> % ./ld/ld-new -shared t.o
> % readelf -rsW a.out
> ...
> 
> It should have __start___verbose in the dynamic symbols but hasn't.
> FWIW, I've come up with this patch.  The idea is to make the symbols
> protected
> and always resolve them locally even if the (completely broken IMHO, but
> that's an old story) extern_protected_data flag says otherwise.

Please provide a run-time testcase with dlsym.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]