Removing some cruft...

M. Warner Losh imp at bsdimp.com
Tue Dec 16 12:21:13 PST 2008


I was looking at the MIPS elf stuff based on a submission of some
64-bit support.  In doing so, I discovered a number of 'unused' types
that appear to have comments that indicate that they can be removed
now and were just slavishly copied from arch to arch to arch.

/*
 * The following non-standard values are used for passing information
 * from John Polstra's testbed program to the dynamic linker.  These
 * are expected to go away soon.
 *
 * Unfortunately, these overlap the Linux non-standard values, so they
 * must not be used in the same context.
 */
#define	AT_BRK		10	/* Starting point for sbrk and brk. */
#define	AT_DEBUG	11	/* Debugging level. */

These have be slavishly copied to arm, powerpc, sparc64, ia64, mips,
sun4v and amd64.  All these files have nearly identical comments
(except powerpc, which changes the value).

The only place these are used in the kernel is in the Linux!
emulation in i386/linux/linux_sysvec.c and
amd64/linux32/linux32_sysvec.c:

	if (args->trace)
		AUXARGS_ENTRY(pos, AT_DEBUG, 1);

Since AT_DEBUG and AT_UID have the same value, and we look at AT_UID
later, we wind up passing the wrong value for AT_UID.  Fortunately, we
don't use AT_UID for anything in the tree....

So I'd like to remove all this stuff unless there's a compelling
reason to keep it.

Can anybody think of a reason to keep it?  It seems completely
non-functional...

Warner



More information about the freebsd-arch mailing list