Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH/RFA] Define various OS/ABI note types
@ 2002-05-07 13:18 Jason R Thorpe
  2002-05-07 15:28 ` David O'Brien
  0 siblings, 1 reply; 10+ messages in thread
From: Jason R Thorpe @ 2002-05-07 13:18 UTC (permalink / raw)
  To: binutils; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 375 bytes --]

The following patch to include/elf/common.h defines the note types used by
GNU and NetBSD ABI identification notes.  These are needed by GDB.

OK to commit?

	* common.h (NT_GNU_ABI_TAG): Define.
	(GNU_ABI_TAG_LINUX): Define.
	(GNU_ABI_TAG_HURD): Define.
	(GNU_ABI_TAG_SOLARIS): Define.
	(NT_NETBSD_IDENT): Define.

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

[-- Attachment #2: elf-common-patch --]
[-- Type: text/plain, Size: 895 bytes --]

Index: common.h
===================================================================
RCS file: /cvs/src/src/include/elf/common.h,v
retrieving revision 1.41
diff -u -r1.41 common.h
--- common.h	31 Jan 2002 17:33:02 -0000	1.41
+++ common.h	7 May 2002 20:15:19 -0000
@@ -358,6 +358,17 @@
 #define NT_VERSION	1		/* Contains a version string.  */
 #define NT_ARCH		2		/* Contains an architecture string.  */
 
+/* Values for GNU .note.ABI-tag notes.  Note name is "GNU".  */
+
+#define NT_GNU_ABI_TAG		1
+#define GNU_ABI_TAG_LINUX	0
+#define GNU_ABI_TAG_HURD	1
+#define GNU_ABI_TAG_SOLARIS	2
+
+/* Values for NetBSD .note.netbsd.ident notes.  Note name is "NetBSD".  */
+
+#define NT_NETBSD_IDENT		1
+
 /* These three macros disassemble and assemble a symbol table st_info field,
    which contains the symbol binding and symbol type.  The STB_ and STT_
    defines identify the binding and type.  */

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH/RFA] Define various OS/ABI note types
  2002-05-07 13:18 [PATCH/RFA] Define various OS/ABI note types Jason R Thorpe
@ 2002-05-07 15:28 ` David O'Brien
  2002-05-07 15:58   ` Jason R Thorpe
  2002-05-07 22:33   ` Jason R Thorpe
  0 siblings, 2 replies; 10+ messages in thread
From: David O'Brien @ 2002-05-07 15:28 UTC (permalink / raw)
  To: Jason R Thorpe, binutils, gdb-patches

On Tue, May 07, 2002 at 01:18:33PM -0700, Jason R Thorpe wrote:
> The following patch to include/elf/common.h defines the note types used by
> GNU and NetBSD ABI identification notes.  These are needed by GDB.
> 
> OK to commit?

Please add the FreeBSD .note.ABI-tag if you are going to do this.
FreeBSD has a .note.ABI-tag with note type "1", vendor "FreeBSD", and
description that is a 6-digit number encoding major and minor version.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH/RFA] Define various OS/ABI note types
  2002-05-07 15:28 ` David O'Brien
@ 2002-05-07 15:58   ` Jason R Thorpe
  2002-05-07 16:12     ` David O'Brien
  2002-05-07 22:33   ` Jason R Thorpe
  1 sibling, 1 reply; 10+ messages in thread
From: Jason R Thorpe @ 2002-05-07 15:58 UTC (permalink / raw)
  To: David O'Brien; +Cc: binutils, gdb-patches

On Tue, May 07, 2002 at 03:28:01PM -0700, David O'Brien wrote:

 > Please add the FreeBSD .note.ABI-tag if you are going to do this.
 > FreeBSD has a .note.ABI-tag with note type "1", vendor "FreeBSD", and
 > description that is a 6-digit number encoding major and minor version.

I can't find the actual definition of the version number encoding in
the FreeBSD header files.

If you can provide a precise description of it, I certainly have no
objections to including it in my patch.

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH/RFA] Define various OS/ABI note types
  2002-05-07 15:58   ` Jason R Thorpe
@ 2002-05-07 16:12     ` David O'Brien
  2002-05-07 16:30       ` Jason R Thorpe
  0 siblings, 1 reply; 10+ messages in thread
From: David O'Brien @ 2002-05-07 16:12 UTC (permalink / raw)
  To: Jason R Thorpe, binutils, gdb-patches

On Tue, May 07, 2002 at 03:58:11PM -0700, Jason R Thorpe wrote:
> On Tue, May 07, 2002 at 03:28:01PM -0700, David O'Brien wrote:
> 
>  > Please add the FreeBSD .note.ABI-tag if you are going to do this.
>  > FreeBSD has a .note.ABI-tag with note type "1", vendor "FreeBSD", and
>  > description that is a 6-digit number encoding major and minor version.
> 
> I can't find the actual definition of the version number encoding in
> the FreeBSD header files.


The definition comes from src/lib/csu/common/crtbrand.c.

    static const struct {
        int32_t	namesz;
        int32_t	descsz;
        int32_t	type;
        char	name[sizeof "FreeBSD"];
        int32_t	desc;
    } abitag __attribute__ ((section (.note.ABI-tag))) = {
        sizeof "FreeBSD",
        sizeof(int32_t),
        1,
        "FreeBSD",
        __FreeBSD_version
    };

Where __FreeBSD_version is in sys/param.h.
On FreeBSD 5-CURRENT it is 500034 right now.  (I guess we actually have a
7-digit encoding)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH/RFA] Define various OS/ABI note types
  2002-05-07 16:12     ` David O'Brien
@ 2002-05-07 16:30       ` Jason R Thorpe
  2002-05-07 16:57         ` David O'Brien
  0 siblings, 1 reply; 10+ messages in thread
From: Jason R Thorpe @ 2002-05-07 16:30 UTC (permalink / raw)
  To: David O'Brien; +Cc: binutils, gdb-patches

On Tue, May 07, 2002 at 04:11:44PM -0700, David O'Brien wrote:

 > Where __FreeBSD_version is in sys/param.h.
 > On FreeBSD 5-CURRENT it is 500034 right now.  (I guess we actually have a
 > 7-digit encoding)

...and that encoding is...?  (i.e. how are the fields in the number
split up?)

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH/RFA] Define various OS/ABI note types
  2002-05-07 16:30       ` Jason R Thorpe
@ 2002-05-07 16:57         ` David O'Brien
  0 siblings, 0 replies; 10+ messages in thread
From: David O'Brien @ 2002-05-07 16:57 UTC (permalink / raw)
  To: Jason R Thorpe, binutils, gdb-patches

On Tue, May 07, 2002 at 04:30:18PM -0700, Jason R Thorpe wrote:
> On Tue, May 07, 2002 at 04:11:44PM -0700, David O'Brien wrote:
> 
>  > Where __FreeBSD_version is in sys/param.h.
>  > On FreeBSD 5-CURRENT it is 500034 right now.  (I guess we actually have a
>  > 7-digit encoding)
> 
> ...and that encoding is...?  (i.e. how are the fields in the number
> split up?)

There is some historical baggage, but in the ELF world:

[0]5        major version number.
    0       minor version
     0034   34th significant change in 5.0 that needed an indicator

Another example from 4.5-STABLE, 450006
[0]4        major number
    5       minor number
     0006   6th significant change in 4.5 (before 4.6) that needed an
            indicator

All the various values are documented at
http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/porting-versions.html


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH/RFA] Define various OS/ABI note types
  2002-05-07 15:28 ` David O'Brien
  2002-05-07 15:58   ` Jason R Thorpe
@ 2002-05-07 22:33   ` Jason R Thorpe
  2002-05-08  3:21     ` Nick Clifton
  2002-05-08 11:23     ` David O'Brien
  1 sibling, 2 replies; 10+ messages in thread
From: Jason R Thorpe @ 2002-05-07 22:33 UTC (permalink / raw)
  To: David O'Brien; +Cc: binutils, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 635 bytes --]

On Tue, May 07, 2002 at 03:28:01PM -0700, David O'Brien wrote:

 > Please add the FreeBSD .note.ABI-tag if you are going to do this.
 > FreeBSD has a .note.ABI-tag with note type "1", vendor "FreeBSD", and
 > description that is a 6-digit number encoding major and minor version.

Ok, I've added the note type definition, but I have bothered adding
macros to decode the version number.

	* common.h (NT_GNU_ABI_TAG): Define.
	(GNU_ABI_TAG_LINUX): Define.
	(GNU_ABI_TAG_HURD): Define.
	(GNU_ABI_TAG_SOLARIS): Define.
	(NT_NETBSD_IDENT): Define.
	(NT_FREEBSD_ABI_TAG): Define.

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

[-- Attachment #2: elf-common-patch --]
[-- Type: text/plain, Size: 1002 bytes --]

Index: common.h
===================================================================
RCS file: /cvs/src/src/include/elf/common.h,v
retrieving revision 1.41
diff -u -r1.41 common.h
--- common.h	31 Jan 2002 17:33:02 -0000	1.41
+++ common.h	8 May 2002 05:26:44 -0000
@@ -358,6 +358,21 @@
 #define NT_VERSION	1		/* Contains a version string.  */
 #define NT_ARCH		2		/* Contains an architecture string.  */
 
+/* Values for GNU .note.ABI-tag notes.  Note name is "GNU".  */
+
+#define NT_GNU_ABI_TAG		1
+#define GNU_ABI_TAG_LINUX	0
+#define GNU_ABI_TAG_HURD	1
+#define GNU_ABI_TAG_SOLARIS	2
+
+/* Values for NetBSD .note.netbsd.ident notes.  Note name is "NetBSD".  */
+
+#define NT_NETBSD_IDENT		1
+
+/* Values for FreeBSD .note.ABI-tag notes.  Note name is "FreeBSD".  */
+
+#define NT_FREEBSD_ABI_TAG	1
+
 /* These three macros disassemble and assemble a symbol table st_info field,
    which contains the symbol binding and symbol type.  The STB_ and STT_
    defines identify the binding and type.  */

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH/RFA] Define various OS/ABI note types
  2002-05-07 22:33   ` Jason R Thorpe
@ 2002-05-08  3:21     ` Nick Clifton
  2002-05-08 11:23     ` David O'Brien
  1 sibling, 0 replies; 10+ messages in thread
From: Nick Clifton @ 2002-05-08  3:21 UTC (permalink / raw)
  To: thorpej; +Cc: obrien, binutils, gdb-patches

Hi Jason,

> 	* common.h (NT_GNU_ABI_TAG): Define.
> 	(GNU_ABI_TAG_LINUX): Define.
> 	(GNU_ABI_TAG_HURD): Define.
> 	(GNU_ABI_TAG_SOLARIS): Define.
> 	(NT_NETBSD_IDENT): Define.
> 	(NT_FREEBSD_ABI_TAG): Define.

Approved - please apply.

Cheers
        Nick


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH/RFA] Define various OS/ABI note types
  2002-05-07 22:33   ` Jason R Thorpe
  2002-05-08  3:21     ` Nick Clifton
@ 2002-05-08 11:23     ` David O'Brien
  2002-05-08 11:40       ` Jason R Thorpe
  1 sibling, 1 reply; 10+ messages in thread
From: David O'Brien @ 2002-05-08 11:23 UTC (permalink / raw)
  To: Jason R Thorpe, binutils, gdb-patches

On Tue, May 07, 2002 at 10:33:43PM -0700, Jason R Thorpe wrote:
> On Tue, May 07, 2002 at 03:28:01PM -0700, David O'Brien wrote:
> 
>  > Please add the FreeBSD .note.ABI-tag if you are going to do this.
>  > FreeBSD has a .note.ABI-tag with note type "1", vendor "FreeBSD", and
>  > description that is a 6-digit number encoding major and minor version.
> 
> Ok, I've added the note type definition, 

Thanks for adding this!

> but I have bothered adding
> macros to decode the version number.

That's fine, I didn't expect you to go to those lengths.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH/RFA] Define various OS/ABI note types
  2002-05-08 11:23     ` David O'Brien
@ 2002-05-08 11:40       ` Jason R Thorpe
  0 siblings, 0 replies; 10+ messages in thread
From: Jason R Thorpe @ 2002-05-08 11:40 UTC (permalink / raw)
  To: David O'Brien; +Cc: binutils, gdb-patches

On Wed, May 08, 2002 at 11:23:39AM -0700, David O'Brien wrote:

 > Thanks for adding this!

No sweat :-)

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2002-05-08 18:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-07 13:18 [PATCH/RFA] Define various OS/ABI note types Jason R Thorpe
2002-05-07 15:28 ` David O'Brien
2002-05-07 15:58   ` Jason R Thorpe
2002-05-07 16:12     ` David O'Brien
2002-05-07 16:30       ` Jason R Thorpe
2002-05-07 16:57         ` David O'Brien
2002-05-07 22:33   ` Jason R Thorpe
2002-05-08  3:21     ` Nick Clifton
2002-05-08 11:23     ` David O'Brien
2002-05-08 11:40       ` Jason R Thorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox