ld -A EXAMPLE !

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Wed Sep 12 09:45:04 AEST 1990


In article <9780 at discus.technion.ac.il> devil%techunix.bitnet at 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



More information about the Comp.unix.programmer mailing list