From owner-svn-src-head@FreeBSD.ORG Mon Feb 4 06:59:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BB44CF97; Mon, 4 Feb 2013 06:59:34 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9426BFB9; Mon, 4 Feb 2013 06:59:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r146xYic024172; Mon, 4 Feb 2013 06:59:34 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r146xXw4024168; Mon, 4 Feb 2013 06:59:33 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201302040659.r146xXw4024168@svn.freebsd.org> From: Andrew Turner Date: Mon, 4 Feb 2013 06:59:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246312 - in head/contrib: binutils/include/elf gdb/gdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 06:59:34 -0000 Author: andrew Date: Mon Feb 4 06:59:33 2013 New Revision: 246312 URL: http://svnweb.freebsd.org/changeset/base/246312 Log: Extend GDB to check the value in the .note.tag section along with the .note.ABI-tag section. This helps on ARM EABI where the OS/ABI field is zero. It would be better to use the NOTES program header however this would require a more invasive change. Modified: head/contrib/binutils/include/elf/common.h head/contrib/gdb/gdb/osabi.c Modified: head/contrib/binutils/include/elf/common.h ============================================================================== --- head/contrib/binutils/include/elf/common.h Mon Feb 4 00:34:35 2013 (r246311) +++ head/contrib/binutils/include/elf/common.h Mon Feb 4 06:59:33 2013 (r246312) @@ -435,6 +435,10 @@ #define NT_FREEBSD_ABI_TAG 1 +/* Values for FreeBSD .note.tag notes. Note name is "FreeBSD". */ + +#define NT_FREEBSD_TAG 2 + /* 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. */ Modified: head/contrib/gdb/gdb/osabi.c ============================================================================== --- head/contrib/gdb/gdb/osabi.c Mon Feb 4 00:34:35 2013 (r246311) +++ head/contrib/gdb/gdb/osabi.c Mon Feb 4 06:59:33 2013 (r246312) @@ -463,6 +463,20 @@ generic_elf_osabi_sniff_abi_tag_sections return; } + + /* .note.tag notes, used by FreeBSD. */ + if (strcmp (name, ".note.tag") == 0) + { + /* FreeBSD. */ + if (check_note (abfd, sect, note, "FreeBSD", 4, NT_FREEBSD_TAG)) + { + /* There is no need to check the version yet. */ + *osabi = GDB_OSABI_FREEBSD_ELF; + return; + } + + return; + } /* .note.netbsd.ident notes, used by NetBSD. */ if (strcmp (name, ".note.netbsd.ident") == 0