This is the mail archive of the
mailing list for the binutils project.
Re: 64-bit support for srec
On Feb 1, 2012, at 7:22 PM, Alan Modra wrote:
> On Wed, Feb 01, 2012 at 03:55:11PM -0800, Mike Stump wrote:
>> --- 897,907 ----
>> else if ((section->lma + offset + bytes_to_do - 1) <= 0xffffff
>> && tdata->type <= 2)
>> tdata->type = 2;
>> ! else if ((section->lma + offset + bytes_to_do - 1) <= 0xffffffff
>> ! && tdata->type <= 2)
> Probably ought to be <= 3 here. Presumably the idea of the existing
> code is that once you've used S3 records, don't drop back to S2.
--- bfd/srec.c (revision 2081)
+++ bfd/srec.c (working copy)
@@ -898,7 +898,7 @@ srec_set_section_contents (bfd *abfd,
&& tdata->type <= 2)
tdata->type = 2;
else if ((section->lma + offset + bytes_to_do - 1) <= 0xffffffff
- && tdata->type <= 2)
+ && tdata->type <= 3)
tdata->type = 3;
tdata->type = 4;
>> + case 4:
>> + TOHEX (dst, (address >> 56), check_sum);
>> + dst += 2;
> What if "address" is only a 32-bit type?
The optimizer removes the 64-bit code, since it can never be true.
> I think you need to conditionalize all your new code on BFD64.
I think it is safe to rely upon the optimizer to remove it. I don't see any advantages to peppering the code with #ifdef.
> And it would be sad if we can't read back our own output..
It would be even sadder if we silently dropped address bits and couldn't handle 64-bit addresses... oh, wait, we already do that. I'll see about doing up a reader, though, I can't say if or when I will get time to do it.