This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Fix linking of .gpdword on MIPS
Daniel Jacobowitz <drow@false.org> writes:
> On Tue, Feb 27, 2007 at 09:32:23AM +0000, Richard Sandiford wrote:
> > By "true relocation against symbol zero", I meant one that was in
> > an input file. That's technically possible, isn't it? (If ELF lets
> > you do something, it seems something somewhere will.)
>
> True. I have no conception of what such a relocation would mean,
> however. There would never be a definition of such a symbol. I guess
> you could use it for ARM placeholder R_ARM_NONE's (and in fact I think
> we handle that case).
There is always a definition of the symbol with index 0: it's an
SHN_ABS symbol with value zero. It's used for, e.g., R_*_RELATIVE
relocations (which of course do not appear in .o files). The ELF spec
defines precisely what a relocation against symbol 0 should mean, so I
don't see any reason that such a relocation could not appear in a .o
file. For a specific example, on the SH the R_SH_CODE, R_SH_DATA, and
R_SH_COUNT relocs will normally use symbol index 0.
Ian