This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Question about MIPS elf-rel7
On Sun, May 04, 2003 at 07:59:16PM -0400, Daniel Jacobowitz wrote:
> On Mon, May 05, 2003 at 08:57:35AM +0930, Alan Modra wrote:
> > On Sun, May 04, 2003 at 05:20:17PM -0400, Daniel Jacobowitz wrote:
> > > .section .barsec,"aM",@progbits,8
> > [snip]
> > > Why should the first relocation be section-relative instead of
> > > symbol-relative?
> >
> > How is escaping this check in gas/write.c:adjust_reloc_syms?
> >
> > /* Never adjust a reloc against local symbol in a merge section
> > with non-zero addend. */
> > if ((symsec->flags & SEC_MERGE) != 0
> > && (fixp->fx_offset != 0 || fixp->fx_subsy != NULL))
> > continue;
>
> At a guess, fixp->fx_offset == 0 and fixp->fx_subsy == NULL? Yes,
> that's right, and it matches the comment - the symbol is local, but we
> have a zero addend.
Duh, never mind. The test I quoted above is about stopping a
reference like "a+4" from being reduced to the section symbol, and
has nothing to do with stopping plain "a" being reduced to a
section sym. (We can't reduce "a+4" because that might match some
other sym, "b" say, and "b" might move relative to "a" after merging.)
> I guess my question is why that test isn't just symsec->flags &
> SEC_MERGE.
I guess because the merge code quite happily works with section sym
references.
--
Alan Modra
IBM OzLabs - Linux Technology Centre