This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Copy relocations against protected symbols


On Sat, Dec 13, 2014 at 01:08:34PM -0500, John D. Hendrickson wrote:
> Alan Modra wrote:
> >Copy relocs are used in a scheme to avoid dynamic text relocations in
> >non-PIC executables that refer to variables defined in shared
> >libraries.  The idea is to have the linker define any such variable in
> >the executable, with a copy reloc copying the initial value, then have
> >both the executable and shared library refer to the executable copy.
> >If the shared library defines the variable as protected then we have
> 
> i find the statements a cross-testimony, contradictory
> 
> if the library has posted a symbol as protected there is a reason
> 
> if a program contains a reference to the symbol and writes to it (i'm unsure
> that's possible) then obviously the program is faulty, as it broke a rule,
> and i'd expect a segfault of the largess of the shared lib was in protected
> memory
> 
> the program could easily copy the value, or, open the library itself
> (meaning the program could load a private copy of lib if it needed to do so,
> rather than force all other programs to run code that is usually the wrong
> thing to do)

When I said "protected" above, I wasn't meaning anything to do with
memory protection but rather symbol visibility STV_PROTECTED.  See
http://www.sco.com/developers/gabi/latest/ch4.symtab.html#symbol_value

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]