linker script data statements

Alan Modra amodra@bigpond.net.au
Thu Feb 19 12:36:00 GMT 2004


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



More information about the Binutils mailing list