From: Alan Modra <amodra@bigpond.net.au>
To: binutils@sources.redhat.com
Subject: Re: compiling binutils with -DDEBUG
Date: Tue, 01 Mar 2005 22:02:00 -0000 [thread overview]
Message-ID: <20050301220245.GS5299@bubble.modra.org> (raw)
In-Reply-To: <m3wtsr5tqh.fsf@gossamer.airs.com>
On Tue, Mar 01, 2005 at 09:24:54AM -0500, Ian Lance Taylor wrote:
> Alan Modra <amodra@bigpond.net.au> writes:
>
> > On Mon, Feb 28, 2005 at 09:36:00PM -0500, Ian Lance Taylor wrote:
> > > Alan Modra <amodra@bigpond.net.au> writes:
> > >
> > > > (fixup_segment): Remove assertion.
> > > > Didn't seem worth including struct-symbol.h just for this. I suspect
> > > > the assertion isn't true too, since a similar assertion in obj-coff.c
> > > > fails with X_op an O_constant. Maybe this is a real bug. Ian, you're
> > > > probably the only one who can answer mri mode queries off the top of
> > > > your head. Care to comment?
> > >
> > > > @@ -2583,7 +2585,6 @@ fixup_segment (fixS *fixP, segT this_seg
> > > > if (fixP->fx_addsy != NULL
> > > > && symbol_mri_common_p (fixP->fx_addsy))
> > > > {
> > > > - know (fixP->fx_addsy->sy_value.X_op == O_symbol);
> > > > add_number += S_GET_VALUE (fixP->fx_addsy);
> > > > fixP->fx_offset = add_number;
> > > > fixP->fx_addsy
> > >
> > > The assertion should be true. This is a symbol defined in an MRI
> > > common section. Since we don't generate IEEE object files, we treat
> > > an MRI common section as a single large common symbol. Then we handle
> > > a reloc against a symbol defined within an MRI common section as an
> > > offset to that symbol. The assertion is just checking that we really
> > > do point to the magic symbol we are using for the MRI common section.
> >
> > I did a little analysis. Nowadays, the assertion is always false for
> > BFD_ASSEMBLER because symbols have been resolved (write.c:1857) by the
> > time this code is reached. The following would probably fix the
> > assertion, but I don't think it's worth worrying about.
>
> There is code in resolve_symbol_value() to handle this case. I wonder
> why it isn't working?
The reason the assert fails is that finalize_syms is set by the time we
reach write.c:1857, so S_SET_VALUE is called for these symbols. That
turns them into O_constant values.
> If the assert in fixup_segment() fails, then
> MRI common symbols will not be handled correctly.
Are you sure? I couldn't see why it mattered that the sym was resolved
at write.c:1857 versus being resolved at write.c:2588. The mri common
testcase looks to produce good results.
--
Alan Modra
IBM OzLabs - Linux Technology Centre
next prev parent reply other threads:[~2005-03-01 22:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-01 2:01 Alan Modra
2005-03-01 2:36 ` Ian Lance Taylor
2005-03-01 10:50 ` Alan Modra
2005-03-01 11:04 ` Alan Modra
2005-03-01 14:25 ` Ian Lance Taylor
2005-03-01 22:02 ` Alan Modra [this message]
2005-03-02 1:40 ` Ian Lance Taylor
2005-03-02 2:40 ` Alan Modra
2005-03-02 3:35 ` Ian Lance Taylor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050301220245.GS5299@bubble.modra.org \
--to=amodra@bigpond.net.au \
--cc=binutils@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).