This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: linker script data statements
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: binutils at sources dot redhat dot com, Nick Clifton <nickc at redhat dot com>
- Date: Thu, 19 Feb 2004 23:06:41 +1030
- Subject: Re: linker script data statements
- References: <4034A324.6050107@codesourcery.com>
On Thu, Feb 19, 2004 at 11:51:00AM +0000, Nathan Sidwell wrote:
> value = exp_fold_tree (s->data_statement.exp,
> abs_output_section,
> lang_final_phase_enum, dot, &dot);
> ! s->data_statement.value
> ! = value.value + value.section->bfd_section->vma;
> if (!value.valid_p)
> einfo (_("%F%P: invalid data statement\n"));
> }
When !value.valid_p, it's not safe to dereference value.section. Your
patch is OK if you change the above to
if (!value.valid_p)
einfo (_("%F%P: invalid data statement\n"));
s->data_statement.value
= value.value + value.section->bfd_section->vma;
--
Alan Modra
IBM OzLabs - Linux Technology Centre