Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site aplvax.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!umcp-cs!aplvax!ded From: ded@aplvax.UUCP (Don E. Davis) Newsgroups: net.unix-wizards Subject: Do you believe in MAGIC? Message-ID: <106@aplvax.UUCP> Date: Wed, 5-Jun-85 14:52:07 EDT Article-I.D.: aplvax.106 Posted: Wed Jun 5 14:52:07 1985 Date-Received: Mon, 10-Jun-85 00:46:34 EDT References: <821@unmvax.UUCP> <490@usl.UUCP> <82@decvax.UUCP> Reply-To: ded@aplvax.UUCP (Don E. Davis) Distribution: net Organization: JHU/Applied Physics Lab, Laurel, MD Lines: 25 We are currently in the midst of converting to 4.2BSD. During this conversion a question popped up which different parts of the documentation seemed to answer differently (so what else is new). We wanted to identify which programs were running with shared text. Unfortunately, we couldn't ascertain this info using "file" or "ps" (and "stat" wasn't even there). The "ld" man page says that loading with a "-n" flag will result in a shared text program via magic number 0410. But a perusal of the kern_exec.c source seemed to indicate that either 0413 or 0410 would result in a shared text program. I compiled a test program with and without the -n option, and the only difference seemed to be that the 0413 magic version had its header padded with zeros up until word 1024. Thereafter, the 0410 and 0413 versions seemed identical. A "file" run on the 0413 version returns "demand paged"; the 0410 doesn't. What is going on here? Is there an easy way to determine which files are running shared text? What are the tradeoffs? Why not make all programs shared text? Thanks? -- Don Davis JHU/APL ...decvax!harpo!seismo!umcp-cs!aplvax!ded ...rlgvax!cvl!umcp-cs!aplvax!ded