Copy relocation and protected symbol don't work together
Roland McGrath
roland@redhat.com
Sat Mar 29 02:32:00 GMT 2003
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.
More information about the Libc-alpha
mailing list