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

--- Comment #4 from Michael Matz <matz at suse dot de> ---
Created attachment 10353
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10353&action=edit
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to