This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Mar 09, 2004 at 03:47:41AM -0700, Meg Abyte wrote:
> >Disable -onlcr and hey presto, maybe problem solved.  Let us know how it
> >works out!
> >
> >(*) Before you do this command, maybe you want to say
> ># stty -F /dev/tts/0 -a
> >to see what the current settings are?  Maybe you'll see onlcr (without a
> >leading dash), which means the kernel will translate LF to CRLF on
> >output.
> >
> 
> One last thing to note !
> I just changed (using a hex editor) all the EOFs to CR  NOT LF, and that 
> works !!
> 
> I.e. Now Srec's with CR... or LF.... but not both work. (before I thought 
> it was just removing CR).
> 
> It appears as though Linux IS somehow changing CR into CR/LF, or at least 
> interpreting it as LF??
> I tried all permutations of the stty stuff you mentioned just to be sure 
> but no luck.

You don't make it clear ("all...you mentioned") what you tried; did you
play with all of icrnl, inlcr, onlcr, ocrnl, igncr, onocr, enabling and
disabling all of them?  That's a total of 64 combinations...

> I cat -v file.s19... and this shows NO LF, and prints the ^M's then. So 
> that is ok...

That just shows the *file's* contents, not what goes down the line.

> BUT here is something I noticed.  If you press CTRL-M  (^M) at a prompt. 
> Linux treats it as a CR/LF not as just a carriage return !!!!  Is this a 
> valid test?!  e.g. CTRL-G does what it should etc.

Yes, this is the tty handling code - *in the kernel*.  That's what stty
controls.  Have you looked at the man page?

What you describe with ^M producing LF (CR/LF, are you sure?) is the
icrnl setting.

^M is just what the kernel reads from the keyboard, after the scancode
to ASCII mapping.  It then translates that to whatever (LF in this case)
according to your stty settings.

Can you quote what stty gives you when you say
# stty -F /dev/tts/0 -a
please?

- -- 
http://voyager.abite.co.za/~berndj/ (up again for now - yay!)
"IBM has more patent litigation lawyers than SCO has employees." - unknown
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQFATakx/FmLrNfLpjMRAuDhAJ9ME0moa2hzTUk25tKb0l9avpCP+gCglx/m
CQGQ2YQocXO+RTFIuzDdJf8=
=Jpai
-----END PGP SIGNATURE-----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]