Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!munnari.oz.au!mel.dit.csiro.au!yarra!pta!metro!dmssyd.syd.dms.CSIRO.AU!ditsydh.syd.dit.CSIRO.AU!evans From: evans@syd.dit.CSIRO.AU (Bruce.Evans) Newsgroups: comp.os.minix Subject: Re: Hack Report (well not really) - fixing 'strip' on Mac Message-ID: <1991Apr29.181351.9872@syd.dit.CSIRO.AU> Date: 29 Apr 91 18:13:51 GMT References: <1991Apr28.172029.5679@bronze.ucs.indiana.edu> Organization: CSIRO Division of Info Tech, Sydney, Australia Lines: 22 In article <1991Apr28.172029.5679@bronze.ucs.indiana.edu> templon@copper.ucs.indiana.edu (jeffrey templon) writes: > >The problem with 'strip' is in a file a.out.h - there are some #defines >which are apparently flipped around from what they ought to be. >I have not yet figured out why this matters, as in strip.c they seem >to always be used in pairs. But here is the patch, courtesy of Matthias >Pfaller. After installing this patch and recompiling, strip works fine. The reason this matters is that when the Minix was originally ported to the ST, a.out.h was not available and/or not used and/or not understood. So the first few fields, which are supposed to be chars, are packed into a long and so get swapped because of the different machines. This defeats the point of having a magic number in the first byte or two. The book gives an unfortunate recipe for the header too. "It consists of 8 longs ... alternative 48-byte header is also acceptable". Actually lengths of about 24 to 255 are acceptable to MM, if not to all utilities. There is a byte to give the length. I remember reading something about this too being broken in the Mac version. 0 works for it in MM (it is taken as 32) but not in all utilities. -- Bruce Evans evans@syd.dit.csiro.au