This is the mail archive of the binutils@sources.redhat.com 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: RFC: Disallow protected data symbol with copy relocation?


On Fri, Jan 21, 2005 at 12:46:26AM -0500, Ian Lance Taylor wrote:
> "H. J. Lu" <hjl@lucon.org> writes:
> 
> > > Why would the linker ever generate a copy relocation for a protected
> > > symbol?  I don't see how that makes sense.
> > > 
> > 
> > For some psABIs, copy relocation is the normal way for main to access
> > data symbol on DSO.
> > ...
> 
> Yes, I know.  But clearly a copy relocation can not work.  We should
> treat this case as though -z nocopyreloc was used for that specific
> symbol.
> 
> Maybe that is what you meant by "reject protected data symbol with
> copy relocation."  I am saying that the answer is not to reject the
> symbol, it is to not generate the copy relocation.

Avoid copy relocation leads to writable text section on ia32. I am not
sure that generate writable text section without -z nocopyreloc is a
good idea.

> 
> There may be specific targets and/or cases where -z nocopyreloc does
> not work, for some hideous reason.  Those specific targets and/or
> cases should generate a specific error.  But this is not a general
> problem.

I don't think -z nocopyreloc works on x86_64.


H.J.


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