public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Suppress "Start Linear Address Record" in ihex file
@ 2009-08-25 22:14 Gene Smith
  2009-08-26  7:21 ` Nick Clifton
  0 siblings, 1 reply; 3+ messages in thread
From: Gene Smith @ 2009-08-25 22:14 UTC (permalink / raw)
  To: binutils

Our legacy loader for an embedded system chokes on record type 5, Start 
Linear Address Record, in intel hex files. But by default objcopy emits 
one of these records (2nd line from the end based on the address of 
.text). I found two ways to not produce these records but my usage seems 
undocumented and I don't want to do something that might break with 
future bug fixes.  Here's the ways I have found to suppress the type 5 
hex record from the ihex file:

1. In objcopy, use "--set-start=" with it set to no value. (Possibly 
setting to zero would also work.)

2. In link control file set "start=0;" (An address outside the defines 
space.)

3. I have also used sed to remove the one-line record.

Is this the correct way to suppress the "Start Linear Address" record 
from the ihex file?

Thanks,

-gene

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Suppress "Start Linear Address Record" in ihex file
  2009-08-25 22:14 Suppress "Start Linear Address Record" in ihex file Gene Smith
@ 2009-08-26  7:21 ` Nick Clifton
  2009-08-27 13:15   ` Gene Smith
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Clifton @ 2009-08-26  7:21 UTC (permalink / raw)
  To: Gene Smith; +Cc: binutils

Hi Gene,

> Our legacy loader for an embedded system chokes on record type 5

Given that the real bug is your legacy loader...

> Here's the ways I have found to suppress the type 5 
> hex record from the ihex file:
> 
> 1. In objcopy, use "--set-start=" with it set to no value. (Possibly 
> setting to zero would also work.)
> 
> 2. In link control file set "start=0;" (An address outside the defines 
> space.)
> 
> 3. I have also used sed to remove the one-line record.
> 
> Is this the correct way to suppress the "Start Linear Address" record 
> from the ihex file?

There is no one correct way to suppress these records; it is a case of 
whatever works works.  But if you want an opinion then I would recommend 
option 1) with an explicit start value of 0.  (Assuming that that 
works).  This is the clearest option.  It might also be useful to add a 
comment to whatever makefile or build mechanism you are using where this 
command line option is added to objcopy explaining why it is needed.

Cheers
   Nick


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Suppress "Start Linear Address Record" in ihex file
  2009-08-26  7:21 ` Nick Clifton
@ 2009-08-27 13:15   ` Gene Smith
  0 siblings, 0 replies; 3+ messages in thread
From: Gene Smith @ 2009-08-27 13:15 UTC (permalink / raw)
  To: binutils

Nick Clifton wrote, On 08/26/2009 03:14 AM:
> Hi Gene,
>
>> Our legacy loader for an embedded system chokes on record type 5
>
> Given that the real bug is your legacy loader...

Agreed. But I have no way to fix it so looked for workaround.

>
>> Here's the ways I have found to suppress the type 5 hex record from
>> the ihex file:
>>
>> 1. In objcopy, use "--set-start=" with it set to no value. (Possibly
>> setting to zero would also work.)
>>
>> 2. In link control file set "start=0;" (An address outside the defines
>> space.)
>>
>> 3. I have also used sed to remove the one-line record.
>>
>> Is this the correct way to suppress the "Start Linear Address" record
>> from the ihex file?
>
> There is no one correct way to suppress these records; it is a case of
> whatever works works. But if you want an opinion then I would recommend
> option 1) with an explicit start value of 0. (Assuming that that works).
> This is the clearest option. It might also be useful to add a comment to
> whatever makefile or build mechanism you are using where this command
> line option is added to objcopy explaining why it is needed.

Ok, I have not tried --set-start=0 on objcopy but I suspect it will 
work. Hopefully this somewhat undocumented feature won't be "fixed" in a 
future release. Thanks for the advice.

>
> Cheers
> Nick
>
>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-08-27  3:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-25 22:14 Suppress "Start Linear Address Record" in ihex file Gene Smith
2009-08-26  7:21 ` Nick Clifton
2009-08-27 13:15   ` Gene Smith

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).