If this isn't exactly what you wanted, please try our Search (there's a LOT of techy and non-techy stuff here about Linux, Unix, Mac OS X and just computers in general!):
From - Sun Dec 19 08:16:44 1999 Xref: world comp.unix.sco.misc:112235 Path: world!newsfeed.mathworks.com!arclight.uoregon.edu!logbridge.uoregon.edu!remarQ73!rQdQ!supernews.com!remarQ.com!corp.supernews.com!not-for-mail From: Robert Lipe <robertlipe@usa.net> Newsgroups: comp.unix.sco.misc Subject: Re: SCO and SSH(d) Date: Sun, 19 Dec 1999 06:15:21 GMT Organization: Posted via Supernews, http://www.supernews.com Lines: 97 Message-ID: <s5otvpk5ee6159@corp.supernews.com> References: <rpfa38.ut5.ln@jeeves.itte.net> <3859d0a4.0@198.161.96.27> Reply-To: robertlipe@usa.net X-Complaints-To: newsabuse@supernews.com X-Newsreader: NN version 6.5.0 CURRENT #118 X-Mozilla-Status: 8010 X-Mozilla-Status2: 00000000 "Buddy Z" <diespammersdie-zed@wcs.ab.ca> writes: >Anders Gulden Olstad <andersgo@alge.anart.no> wrote in message >news:rpfa38.ut5.ln@jeeves.itte.net... >> This has maybe been discussed before - but looking at the portability list >> for SSH1, SCO Unix is listed as "client only".
sshd and ssh both work fine for me. I use it daily. >/usr/tmp/cca006wL.s:1594:invalid register for instruction: %edx in rolw >/usr/tmp/cca006wL.s:1594:invalid register for instruction: %edx in rolw The ssh source is broken when compiling with GCC and a strict assembler such as OpenServer's native one or newer versions of GAS. See attached patch. >From robertl@caldera.com Sat Oct 2 04:21:25 1999 Date: Sat, 2 Oct 1999 04:21:25 -0500 From: Robert Lipe <robertl@caldera.com> To: ssh-bugs@ssh.fi Subject: Re: ssh 2.0.13 & illegal asms Message-ID: <19991002042125.N25838@rjlhome.caldera.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre1i Status: RO Content-Length: 2793 Lines: 66 Yesterday I submitted a patch to SSH 2.0.13. Please replace it with this one.
One of my peers who is much more the IA32 assembler wizard than myself
explained what these functions were trying to do and why my patch was
misguided. He explained that they were just doing byteswapping.
> But neither is going to work right. They're pulling a trick here which
> *requires* the assembler to do what SCO's fails to do: accept a size
> mismatch between opcode and operand.
>
> They're trying to build code similar to:
>
> // __byte__--byte--__byte__--byte--
> movl (arg), %eax // eax = wwwwwwwwxxxxxxxxyyyyyyyyzzzzzzzz
> rolw $8, %ax // swap bytes: eax = wwwwwwwwxxxxxxxxzzzzzzzzyyyyyyyy
> roll $16, %eax // swap words: eax = zzzzzzzzyyyyyyyywwwwwwwwxxxxxxxx
> rolw $8, %ax // swap bytes: eax = zzzzzzzzyyyyyyyyxxxxxxxxwwwwwwww
>
> They definitely intend to manipulate only the low two bytes in
> instructions #2 and 4.
>
> Unfortunately, this requires some textual manipulation of the argument
> "%0", and I don't know whether that's possible in the context of the C
> preprocessor + "__asm__" handling. Their previous solution, now
> provoking warnings from GNU and failures from SCO, was to fudge it by
> spelling it "%eax" all the time; providing the size information in the
> opcode name; and hoping that the assembler would forgive the mismatch.
With that in mind, I believe thw following to be a better fix. It adjusts
the constraints on the asm operands to more accurately reflect what we're
trying to do.
--- sshgetput.c_ Mon Feb 8 02:32:59 1999
+++ sshgetput.c Thu Sep 30 20:29:12 1999
@@ -47,7 +47,7 @@
SshUInt32 SSH_GET_32BIT(const unsigned char *cp) {
SshUInt32 result; - __asm__ volatile ("movl (%1), %0; rolw $8, %0; roll $16, %0; rolw $8, %0;"
+ __asm__ volatile ("movl (%1), %0; rolw $8, %w0; roll $16, %0; rolw $8, %w0;"
: "=&r" (result)
: "r" (cp));
return result;
--- sshgetput.h_ Thu Sep 30 20:23:09 1999
+++ sshgetput.h Thu Sep 30 20:30:06 1999
@@ -181,7 +181,7 @@
#define SSH_GET_32BIT(cp) \
({ \
SshUInt32 __v__; \
- __asm__ volatile ("movl (%1), %0; rolw $8, %0; roll $16, %0; rolw $8, %0;" \
+ __asm__ volatile ("movl (%1), %0; rolw $8, %w0; roll $16, %0; rolw $8, %w0;" \
: "=&r" (__v__) \
: "r" (cp)); \
__v__; \
Imposing the additional (word) constraint on the zero't argument does indeed
result in assembly code like this:
movl (%edx), %eax; rolw $8, %ax; roll $16, %eax; rolw $8, %ax;
Thanx to the person that pointed this out. Once I had that hint,
expressing it in GCC syntax wasn't too hard.
RJL
/Bofcusm/199.html copyright 1997-2004 (various authors) All Rights Reserved
Have you tried Searching this site?
Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.
Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.
Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.
We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.
Click here to add your comments
Don't miss responses! Subscribe to Comments by RSS or by Email
Click here to add your comments
If you want a picture to show with your comment, go get a Gravatar