From owner-svn-src-all@FreeBSD.ORG Sat Oct 18 13:38:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24054EE0; Sat, 18 Oct 2014 13:38:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F9CEED7; Sat, 18 Oct 2014 13:38:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9IDc5LJ047026; Sat, 18 Oct 2014 13:38:05 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9IDc5NE047022; Sat, 18 Oct 2014 13:38:05 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201410181338.s9IDc5NE047022@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 18 Oct 2014 13:38:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273251 - in head/sys: arm/arm arm/include conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Oct 2014 13:38:06 -0000 Author: andrew Date: Sat Oct 18 13:38:04 2014 New Revision: 273251 URL: https://svnweb.freebsd.org/changeset/base/273251 Log: Add an elf not so kgdb detects the kernel as a FreeBSD elf file. The ELFNOTE macro is based on one from the FreeBSD/ARM Xen tree [1]. Obtained from: Julien Grall [1] Added: head/sys/arm/arm/elf_note.S (contents, props changed) Modified: head/sys/arm/include/asmacros.h head/sys/conf/files.arm Added: head/sys/arm/arm/elf_note.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/elf_note.S Sat Oct 18 13:38:04 2014 (r273251) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +/* An ELF note so GDB detects this as a FreeBSD elf file */ +ELFNOTE(.note.tag, 1, "FreeBSD", .long, __FreeBSD_version); + Modified: head/sys/arm/include/asmacros.h ============================================================================== --- head/sys/arm/include/asmacros.h Sat Oct 18 12:28:51 2014 (r273250) +++ head/sys/arm/include/asmacros.h Sat Oct 18 13:38:04 2014 (r273251) @@ -45,6 +45,18 @@ ldr tmp, [tmp, #PC_CURTHREAD] #endif +#define ELFNOTE(section, type, vendor, desctype, descdata...) \ + .pushsection section ; \ + .balign 4 ; \ + .long 2f - 1f /* namesz */ ; \ + .long 4f - 3f /* descsz */ ; \ + .long type /* type */ ; \ + 1: .asciz vendor /* vendor name */ ; \ + 2: .balign 4 ; \ + 3: desctype descdata /* node */ ; \ + 4: .balign 4 ; \ + .popsection + #endif /* LOCORE */ #endif /* _KERNEL */ Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Sat Oct 18 12:28:51 2014 (r273250) +++ head/sys/conf/files.arm Sat Oct 18 13:38:04 2014 (r273251) @@ -18,6 +18,7 @@ arm/arm/devmap.c standard arm/arm/disassem.c optional ddb arm/arm/dump_machdep.c standard arm/arm/elf_machdep.c standard +arm/arm/elf_note.S standard arm/arm/exception.S standard arm/arm/fiq.c standard arm/arm/fiq_subr.S standard