[comp.unix.wizards] Appending text to executables

barber@rabbit1.UUCP (Steve Barber) (01/20/87)

Will anything bad happen if I append arbitrary text to a UNIX executable
(a.out) file?  Basically, I need to have copyright notices physically
present in my a.out files and I don't want to hassle with relinking
the things.  Now, run files don't have checksums, so there shouldn't
be any problem there.  The a.out formats are pretty self-describing, so
I don't think exec(2) will actually load the stuff, but I don't know for
sure.

So, just for the sake of argument and to provide an example, if I did

	cat /bin/sh /etc/group >mysh
	chmod 555 mysh

Would

	mysh

do the right thing?  That is, would it behave identically to /bin/sh?

Are there any versions of UNIX (or derivatives) where this wouldn't work?
Naturally, I'll summarize responses to this most burning of questions.
Thanks in advance. (No, I'm not intending to claim copyright on /bin/sh :-)


	
-- 
Steve Barber    Rabbit Software Corp.
...!ihnp4!{cbmvax,cuuxb}!hutch!barber  ...!psuvax1!burdvax!hutch!barber
(215) 647-0440  7 Great Valley Parkway East  Malvern PA 19355

grr@cbmvax.cbm.UUCP (George Robbins) (01/21/87)

In article <264@rabbit1.UUCP> barber@rabbit1.UUCP (Steve Barber) writes:
>Will anything bad happen if I append arbitrary text to a UNIX executable
>(a.out) file?  Basically, I need to have copyright notices physically
>present in my a.out files and I don't want to hassle with relinking
>the things.
>Steve Barber    Rabbit Software Corp.

I think to be of any value, the notices have to be 'visible', not hidden
at the end of the file.  To do this, you need to arrange for text constants
to be in the statup code.

Of course, if you are laying traps to mark your code for identification,
visibility is not an issue, but then just running the executable through
'ld' again will probably neatly trim off your addition.

Yes, I know that no 'written' copyright notice is needed for the work to
be copyrighted, but that isn't the issue here...
-- 
George Robbins - now working for,	uucp: {ihnp4|seismo|rutgers}!cbmvax!grr
but no way officially representing	arpa: cbmvax!grr@seismo.css.GOV
Commodore, Engineering Department	fone: 215-431-9255 (only by moonlite)