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: PATCH: Add STO_COPY


On Thu, Apr 03, 2003 at 10:15:53PM -0500, Daniel Jacobowitz wrote:
> On Thu, Apr 03, 2003 at 05:15:46PM -0800, H. J. Lu wrote:
> > The copy relocation doesn't work with protected symbols:
> > 
> > http://sources.redhat.com/ml/binutils/2003-03/msg00413.html
> > 
> > I'd like to take the STO_COPY approach. Its advantage is it is binary
> > compatible with the existing ld.so. The only drawback is the st_other
> > field is very limited. I chose 0x80 which has been used in binutils
> > by alpha and m68hc11. It is not the case we take one away from the
> > future gABI change. I will check it in if I haven't heard any strong
> > objections by next Monday.
> 
> At least Alpha has a copy relocation.  Stealing a bit already used by

Alpha may have R_ALPHA_COPY. But it is never generated. Glibc's ld.so
doesn't check/use R_ALPHA_COPY either. Besides, STO_ALPHA_NOPV looks
like an optimization for ld only. Even if someday alpha decides to use
R_ALPHA_COPY, which I seriously doubt, we can still use 0x80 for
STO_COPY on alpha.

> Alpha sounds like an unwise choice.  There is no reason that this fix
> should be i386 specific!
> 

All arches with copy relocation should use STO_COPY. That is why I put
it in common.h, instead of i386.h. Each maintainer should check STO_COPY
for his/her arches. You can do

# find sysdeps -name dl-machine.h| xargs grep ELF_RTYPE_CLASS_COPY

under glibc to see what they are. So far, I see arm, cris, hppa, i386,
m68k, powerpc, s390, sh, sparc and x86_64.


H.J.


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