Subject: VTEXT usage
To: None <tech-kern@netbsd.org>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 10/02/2002 00:16:41
hi,

I noticed recently that while shared libraries are now marked with VEXECMAP,
base executables are only marked with VTEXT.  while fixing this, I saw that
all of the a.out heritage code has something like this:

	if ((execp->a_text != 0 || execp->a_data != 0) &&
	    epp->ep_vp->v_writecount != 0) {
#ifdef DIAGNOSTIC
		if (epp->ep_vp->v_flag & VTEXT)
			panic("exec: a VTEXT vnode has writecount != 0");
#endif
		return ETXTBSY;
	}


this doesn't make much sense to me, it means we're not enforcing the
VTEXT vs. v_writecount exclusion if the executable has a zero-length
text or data segment.  does anyone know why this is here?

I'm planning on changing this to enforce the check regardless of the
segment sizes.  the full diff for all of this is at:

	ftp://ftp.netbsd.org/pub/NetBSD/misc/chs/marktext/diff.marktext.2

-Chuck