FW: Re: Why is my executabel in DOS file format?

Meg Abyte fitter20@hotmail.com
Wed Mar 3 01:38:00 GMT 2004




>From: Ian Lance Taylor <ian@wasabisystems.com>
>In this case I assume that you are invoking the
>linker with --oformat srec.


Yes s19... srec format.


>If that is indeed what you are doing, then note that S-record files
>are not text files.

No, right out of the spec "... encoding printable programs or data in a 
printable (ASCII) format..."


>They follow a specific binary format which
>happens to be more or less human-readable.  That format calls for each
>line to end with \r\n, which is indeed DOS file format for a text
>file.

Not "more are less"... printable ASCII is very readable.

I don't see anything in the spec that says \n. It only says " the file may 
be terminated with CR/LF/NULL".

\n  is interpreted by different OS's differently - for example look at an 
ascii chart and you willl find \n is often written as line feed OR new line.


However, Unix/ linux can treat  "newline" as 0x12 and DOS uses 0x15 / 0x12 
as a new line.

E.g. write a C program in dos with \n; it will do a carriage return and line 
feed. Do the same thing in Linux/Unix and you will also get the same 
result....  HOWEVER, both DOS and UNIX interpret /n differently and produce 
the same code.


>There is no option to generate S-record files which use only \n.

I didn't ask about \n.

I said carriage return and line feed - \n is up for your OS's 
interpretation. However, if you create the file (s19), using Linux, you will 
find that it is in DOS format - for example open it with VI and it will say 
{DOS} at the bottom.

Then I have to run DOS2UNIX on the file then I can use the S record to 
program flash or download to my microprocessor.

(and note, if looked at in VI, it now no longer says it is a "DOS" file  a 
la dos2unix...).

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail  
http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca



More information about the Binutils mailing list