This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Copy relocation and protected symbol don't work together
- From: Roland McGrath <roland at redhat dot com>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: GNU C Library <libc-alpha at sources dot redhat dot com>,binutils at sources dot redhat dot com
- Date: Fri, 28 Mar 2003 18:32:23 -0800
- Subject: Re: Copy relocation and protected symbol don't work together
I think either prohibiting such references or producing text relocs is the
only workable answer. If a variable is marked protected, the compiler may
produce GOT-relative or PC-relative references that won't have any external
reference when linked into a DSO. So even if the copy relocs are treated
specially, there may be no relocation in the DSO to be pointed at the
executable's copy.
I think it's also arguable that the spec says it must behave as it does
now. The gABI doesn't say anything about copy relocs in the specification
of the STV_PROTECTED behavior. I have not seen a version of a psABI that
is as recent as the gABI that I can read; I think the old i386 one I've
found predates the visibility additions and so obviously doesn't mention
the issue in the specification of copy relocs. The specification is in
terms of the symbol table, and doesn't allow any special case in which a
DSO's protected symbols are searched for elsewhere.