🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #840

Re: ld -A EXAMPLE !

#840
From: Dan Bernstein
Date: Tue, 11 Sep 1990 23:45
14 lines
1003 bytes
In article <9780@discus.technion.ac.il> devil%techunix.bitnet@lilac.berkeley.edu (Gil Tene) writes:
  [ a program illustrating in detail the use of ld -A ]
> I have tested this on a Sun 3 running SunOs 4.0.3 and on a VAX
> running BSD. This program DOES NOT work on a sun-4, I have no
> idea why, but everyone out there is welcome to fix it up and
> let me know what the fix was...

Your execx() assumes that arguments are placed onto the stack in a
particular way. Move it into the main code, and use a proper execl(),
and everything works fine on a Sun 4.

Moral: Don't try to imitate varargs manually.

---Dan
Technical Details
Message-ID: <24292:Sep1123:45:0490@kramden.acf.nyu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstnd
References: <9780@discus.technion.ac.il>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstnd
From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein)
Newsgroups: comp.unix.programmer
Subject: Re: ld -A EXAMPLE !
Message-ID: <24292:Sep1123:45:0490@kramden.acf.nyu.edu>
Date: 11 Sep 90 23:45:04 GMT
References: <9780@discus.technion.ac.il>
Organization: IR
Lines: 14