* [patch] coff-i386, guard against null
@ 2007-07-26 0:54 msnyder
2007-07-26 2:20 ` H.J. Lu
2007-07-26 13:08 ` Alan Modra
0 siblings, 2 replies; 10+ messages in thread
From: msnyder @ 2007-07-26 0:54 UTC (permalink / raw)
To: binutils
[-- Attachment #1: Type: text/plain, Size: 90 bytes --]
Other code in this function checks to see if sym is null.
If it's null here, it'll fail.
[-- Attachment #2: howto.txt --]
[-- Type: text/plain, Size: 821 bytes --]
2007-07-25 Michael Snyder <msnyder@access-company.com>
* coff-i386.c (coff_i386_rtype_to_howto): Guard against null.
Index: coff-i386.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-i386.c,v
retrieving revision 1.26
diff -p -r1.26 coff-i386.c
*** coff-i386.c 3 Jul 2007 14:26:39 -0000 1.26
--- coff-i386.c 26 Jul 2007 00:18:04 -0000
*************** coff_i386_rtype_to_howto (abfd, sec, rel
*** 518,524 ****
*addendp -= pe_data(sec->output_section->owner)->pe_opthdr.ImageBase;
}
! if (rel->r_type == R_SECREL32)
{
bfd_vma osect_vma;
--- 518,524 ----
*addendp -= pe_data(sec->output_section->owner)->pe_opthdr.ImageBase;
}
! if (rel->r_type == R_SECREL32 && sym != NULL)
{
bfd_vma osect_vma;
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch] coff-i386, guard against null
2007-07-26 0:54 [patch] coff-i386, guard against null msnyder
@ 2007-07-26 2:20 ` H.J. Lu
2007-07-26 12:34 ` Daniel Jacobowitz
2007-07-26 13:08 ` Alan Modra
1 sibling, 1 reply; 10+ messages in thread
From: H.J. Lu @ 2007-07-26 2:20 UTC (permalink / raw)
To: msnyder; +Cc: binutils
On Wed, Jul 25, 2007 at 05:21:13PM -0700, msnyder@sonic.net wrote:
> Other code in this function checks to see if sym is null.
> If it's null here, it'll fail.
>
> 2007-07-25 Michael Snyder <msnyder@access-company.com>
>
> * coff-i386.c (coff_i386_rtype_to_howto): Guard against null.
>
I prefer BFD_ASSERT (sym != NULL).
H.J.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch] coff-i386, guard against null
2007-07-26 2:20 ` H.J. Lu
@ 2007-07-26 12:34 ` Daniel Jacobowitz
2007-07-26 13:46 ` H.J. Lu
0 siblings, 1 reply; 10+ messages in thread
From: Daniel Jacobowitz @ 2007-07-26 12:34 UTC (permalink / raw)
To: H.J. Lu; +Cc: msnyder, binutils
On Wed, Jul 25, 2007 at 07:18:55PM -0700, H.J. Lu wrote:
> On Wed, Jul 25, 2007 at 05:21:13PM -0700, msnyder@sonic.net wrote:
> > Other code in this function checks to see if sym is null.
> > If it's null here, it'll fail.
> >
>
> > 2007-07-25 Michael Snyder <msnyder@access-company.com>
> >
> > * coff-i386.c (coff_i386_rtype_to_howto): Guard against null.
> >
>
> I prefer BFD_ASSERT (sym != NULL).
BFD_ASSERT returns, though.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch] coff-i386, guard against null
2007-07-26 0:54 [patch] coff-i386, guard against null msnyder
2007-07-26 2:20 ` H.J. Lu
@ 2007-07-26 13:08 ` Alan Modra
1 sibling, 0 replies; 10+ messages in thread
From: Alan Modra @ 2007-07-26 13:08 UTC (permalink / raw)
To: msnyder; +Cc: binutils
On Wed, Jul 25, 2007 at 05:21:13PM -0700, msnyder@sonic.net wrote:
> * coff-i386.c (coff_i386_rtype_to_howto): Guard against null.
OK.
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch] coff-i386, guard against null
2007-07-26 12:34 ` Daniel Jacobowitz
@ 2007-07-26 13:46 ` H.J. Lu
2007-07-26 18:54 ` msnyder
0 siblings, 1 reply; 10+ messages in thread
From: H.J. Lu @ 2007-07-26 13:46 UTC (permalink / raw)
To: msnyder, binutils
On Thu, Jul 26, 2007 at 07:41:39AM -0400, Daniel Jacobowitz wrote:
> On Wed, Jul 25, 2007 at 07:18:55PM -0700, H.J. Lu wrote:
> > On Wed, Jul 25, 2007 at 05:21:13PM -0700, msnyder@sonic.net wrote:
> > > Other code in this function checks to see if sym is null.
> > > If it's null here, it'll fail.
> > >
> >
> > > 2007-07-25 Michael Snyder <msnyder@access-company.com>
> > >
> > > * coff-i386.c (coff_i386_rtype_to_howto): Guard against null.
> > >
> >
> > I prefer BFD_ASSERT (sym != NULL).
>
> BFD_ASSERT returns, though.
I'd like to know when this condition happens. Crash is better than
silent return. That is how BFD_ASSERT is used other places.
H.J.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch] coff-i386, guard against null
2007-07-26 13:46 ` H.J. Lu
@ 2007-07-26 18:54 ` msnyder
2007-07-26 20:01 ` H.J. Lu
0 siblings, 1 reply; 10+ messages in thread
From: msnyder @ 2007-07-26 18:54 UTC (permalink / raw)
To: H.J. Lu; +Cc: msnyder, binutils
> On Thu, Jul 26, 2007 at 07:41:39AM -0400, Daniel Jacobowitz wrote:
>> On Wed, Jul 25, 2007 at 07:18:55PM -0700, H.J. Lu wrote:
>> > On Wed, Jul 25, 2007 at 05:21:13PM -0700, msnyder@sonic.net wrote:
>> > > Other code in this function checks to see if sym is null.
>> > > If it's null here, it'll fail.
>> > >
>> >
>> > > 2007-07-25 Michael Snyder <msnyder@access-company.com>
>> > >
>> > > * coff-i386.c (coff_i386_rtype_to_howto): Guard against null.
>> > >
>> >
>> > I prefer BFD_ASSERT (sym != NULL).
>>
>> BFD_ASSERT returns, though.
>
> I'd like to know when this condition happens. Crash is better than
> silent return. That is how BFD_ASSERT is used other places.
But it doesn't fix the problem that I set out to fix.
If it returns, we'll still crash.
H.J., the change I submitted is consistant with existing code
in this module. There are six local uses of "if (x != NULL)",
and only one local use of BFD_ASSERT. I don't mind if you want
to add a BFD_ASSERT in addition, but why not let my change go in?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch] coff-i386, guard against null
2007-07-26 18:54 ` msnyder
@ 2007-07-26 20:01 ` H.J. Lu
2007-07-26 23:52 ` msnyder
0 siblings, 1 reply; 10+ messages in thread
From: H.J. Lu @ 2007-07-26 20:01 UTC (permalink / raw)
To: msnyder; +Cc: binutils
On Thu, Jul 26, 2007 at 11:52:07AM -0700, msnyder@sonic.net wrote:
> > On Thu, Jul 26, 2007 at 07:41:39AM -0400, Daniel Jacobowitz wrote:
> >> On Wed, Jul 25, 2007 at 07:18:55PM -0700, H.J. Lu wrote:
> >> > On Wed, Jul 25, 2007 at 05:21:13PM -0700, msnyder@sonic.net wrote:
> >> > > Other code in this function checks to see if sym is null.
> >> > > If it's null here, it'll fail.
> >> > >
> >> >
> >> > > 2007-07-25 Michael Snyder <msnyder@access-company.com>
> >> > >
> >> > > * coff-i386.c (coff_i386_rtype_to_howto): Guard against null.
> >> > >
> >> >
> >> > I prefer BFD_ASSERT (sym != NULL).
> >>
> >> BFD_ASSERT returns, though.
> >
> > I'd like to know when this condition happens. Crash is better than
> > silent return. That is how BFD_ASSERT is used other places.
>
> But it doesn't fix the problem that I set out to fix.
> If it returns, we'll still crash.
>
> H.J., the change I submitted is consistant with existing code
> in this module. There are six local uses of "if (x != NULL)",
> and only one local use of BFD_ASSERT. I don't mind if you want
> to add a BFD_ASSERT in addition, but why not let my change go in?
OK with BFD_ASSERT.
H.J.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch] coff-i386, guard against null
2007-07-26 20:01 ` H.J. Lu
@ 2007-07-26 23:52 ` msnyder
2007-07-27 1:04 ` H.J. Lu
0 siblings, 1 reply; 10+ messages in thread
From: msnyder @ 2007-07-26 23:52 UTC (permalink / raw)
To: H.J. Lu; +Cc: msnyder, binutils
> On Thu, Jul 26, 2007 at 11:52:07AM -0700, msnyder@sonic.net wrote:
>> > On Thu, Jul 26, 2007 at 07:41:39AM -0400, Daniel Jacobowitz wrote:
>> >> On Wed, Jul 25, 2007 at 07:18:55PM -0700, H.J. Lu wrote:
>> >> > On Wed, Jul 25, 2007 at 05:21:13PM -0700, msnyder@sonic.net wrote:
>> >> > > Other code in this function checks to see if sym is null.
>> >> > > If it's null here, it'll fail.
>> >> > >
>> >> >
>> >> > > 2007-07-25 Michael Snyder <msnyder@access-company.com>
>> >> > >
>> >> > > * coff-i386.c (coff_i386_rtype_to_howto): Guard against null.
>> >> > >
>> >> >
>> >> > I prefer BFD_ASSERT (sym != NULL).
>> >>
>> >> BFD_ASSERT returns, though.
>> >
>> > I'd like to know when this condition happens. Crash is better than
>> > silent return. That is how BFD_ASSERT is used other places.
>>
>> But it doesn't fix the problem that I set out to fix.
>> If it returns, we'll still crash.
>>
>> H.J., the change I submitted is consistant with existing code
>> in this module. There are six local uses of "if (x != NULL)",
>> and only one local use of BFD_ASSERT. I don't mind if you want
>> to add a BFD_ASSERT in addition, but why not let my change go in?
>
> OK with BFD_ASSERT.
Sorry, I don't understand your reply.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch] coff-i386, guard against null
2007-07-26 23:52 ` msnyder
@ 2007-07-27 1:04 ` H.J. Lu
2007-07-27 1:42 ` msnyder
0 siblings, 1 reply; 10+ messages in thread
From: H.J. Lu @ 2007-07-27 1:04 UTC (permalink / raw)
To: msnyder; +Cc: binutils
On Thu, Jul 26, 2007 at 04:24:22PM -0700, msnyder@sonic.net wrote:
> > On Thu, Jul 26, 2007 at 11:52:07AM -0700, msnyder@sonic.net wrote:
> >> > On Thu, Jul 26, 2007 at 07:41:39AM -0400, Daniel Jacobowitz wrote:
> >> >> On Wed, Jul 25, 2007 at 07:18:55PM -0700, H.J. Lu wrote:
> >> >> > On Wed, Jul 25, 2007 at 05:21:13PM -0700, msnyder@sonic.net wrote:
> >> >> > > Other code in this function checks to see if sym is null.
> >> >> > > If it's null here, it'll fail.
> >> >> > >
> >> >> >
> >> >> > > 2007-07-25 Michael Snyder <msnyder@access-company.com>
> >> >> > >
> >> >> > > * coff-i386.c (coff_i386_rtype_to_howto): Guard against null.
> >> >> > >
> >> >> >
> >> >> > I prefer BFD_ASSERT (sym != NULL).
> >> >>
> >> >> BFD_ASSERT returns, though.
> >> >
> >> > I'd like to know when this condition happens. Crash is better than
> >> > silent return. That is how BFD_ASSERT is used other places.
> >>
> >> But it doesn't fix the problem that I set out to fix.
> >> If it returns, we'll still crash.
> >>
> >> H.J., the change I submitted is consistant with existing code
> >> in this module. There are six local uses of "if (x != NULL)",
> >> and only one local use of BFD_ASSERT. I don't mind if you want
> >> to add a BFD_ASSERT in addition, but why not let my change go in?
> >
> > OK with BFD_ASSERT.
>
> Sorry, I don't understand your reply.
Your change is OK if you also add a BFD_ASSERT so that we will
know something is wrong.
Thanks.
H.J.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch] coff-i386, guard against null
2007-07-27 1:04 ` H.J. Lu
@ 2007-07-27 1:42 ` msnyder
0 siblings, 0 replies; 10+ messages in thread
From: msnyder @ 2007-07-27 1:42 UTC (permalink / raw)
To: H.J. Lu; +Cc: msnyder, binutils
> On Thu, Jul 26, 2007 at 04:24:22PM -0700, msnyder@sonic.net wrote:
>> > On Thu, Jul 26, 2007 at 11:52:07AM -0700, msnyder@sonic.net wrote:
>> >> > On Thu, Jul 26, 2007 at 07:41:39AM -0400, Daniel Jacobowitz wrote:
>> >> >> On Wed, Jul 25, 2007 at 07:18:55PM -0700, H.J. Lu wrote:
>> >> >> > On Wed, Jul 25, 2007 at 05:21:13PM -0700, msnyder@sonic.net
>> wrote:
>> >> >> > > Other code in this function checks to see if sym is null.
>> >> >> > > If it's null here, it'll fail.
>> >> >> > >
>> >> >> >
>> >> >> > > 2007-07-25 Michael Snyder <msnyder@access-company.com>
>> >> >> > >
>> >> >> > > * coff-i386.c (coff_i386_rtype_to_howto): Guard against null.
>> >> >> > >
>> >> >> >
>> >> >> > I prefer BFD_ASSERT (sym != NULL).
>> >> >>
>> >> >> BFD_ASSERT returns, though.
>> >> >
>> >> > I'd like to know when this condition happens. Crash is better than
>> >> > silent return. That is how BFD_ASSERT is used other places.
>> >>
>> >> But it doesn't fix the problem that I set out to fix.
>> >> If it returns, we'll still crash.
>> >>
>> >> H.J., the change I submitted is consistant with existing code
>> >> in this module. There are six local uses of "if (x != NULL)",
>> >> and only one local use of BFD_ASSERT. I don't mind if you want
>> >> to add a BFD_ASSERT in addition, but why not let my change go in?
>> >
>> > OK with BFD_ASSERT.
>>
>> Sorry, I don't understand your reply.
>
> Your change is OK if you also add a BFD_ASSERT so that we will
> know something is wrong.
OK, committed.
Thanks.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2007-07-27 1:16 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-26 0:54 [patch] coff-i386, guard against null msnyder
2007-07-26 2:20 ` H.J. Lu
2007-07-26 12:34 ` Daniel Jacobowitz
2007-07-26 13:46 ` H.J. Lu
2007-07-26 18:54 ` msnyder
2007-07-26 20:01 ` H.J. Lu
2007-07-26 23:52 ` msnyder
2007-07-27 1:04 ` H.J. Lu
2007-07-27 1:42 ` msnyder
2007-07-26 13:08 ` Alan Modra
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).