Subject: Fix sysident.h to have correct NetBSD version
To: None <tech-userlevel@netbsd.org>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: tech-userlevel
Date: 01/04/2003 09:31:51
--Qxx1br4bt0+wmkIi
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

The "NetBSD" constant in <sys/param.h> is forever fixed at its
current value, and has been for eons.  It thus has no value as
an indicator of the OS version.  This is what the __NetBSD_Version__
constant was created for.

The following patch changes sysident.h (and thus crti/crtn) to use
__NetBSD_Version__ in the NetBSD ABI note.  There should be no real
compatibility issues, since:

	* Clearly, no one is using the version tag now, since it
	  is meaningless.

	* The new value will correctly compare > to the old one.

Can anyone think of why this would be a bad idea?

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>

--Qxx1br4bt0+wmkIi
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=rtld-patch

Index: sysident.h
===================================================================
RCS file: /cvsroot/src/libexec/ld.elf_so/sysident.h,v
retrieving revision 1.9
diff -c -r1.9 sysident.h
*** sysident.h	2001/06/19 12:07:21	1.9
--- sysident.h	2003/01/04 17:28:16
***************
*** 47,53 ****
   *	string		OS name
   *
   * OSVERSION notes also have:
!  *	long		OS version (NetBSD constant from param.h)
   *
   * The DATUM fields should be padded out such that their actual (not
   * declared) sizes % 4 == 0.
--- 47,53 ----
   *	string		OS name
   *
   * OSVERSION notes also have:
!  *	long		OS version (__NetBSD_Version__ constant from param.h)
   *
   * The DATUM fields should be padded out such that their actual (not
   * declared) sizes % 4 == 0.
***************
*** 70,76 ****
  	"\t.long   4\n"
  	"\t.long   " __S(ELF_NOTE_TYPE_NETBSD_TAG) "\n"
  	"\t.ascii \"NetBSD\\0\\0\"\n"
! 	"\t.long   " __S(NetBSD) "\n\n"
  
  	"\t.p2align 2\n"
  );
--- 70,76 ----
  	"\t.long   4\n"
  	"\t.long   " __S(ELF_NOTE_TYPE_NETBSD_TAG) "\n"
  	"\t.ascii \"NetBSD\\0\\0\"\n"
! 	"\t.long   " __S(__NetBSD_Version__) "\n\n"
  
  	"\t.p2align 2\n"
  );

--Qxx1br4bt0+wmkIi--