From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 21 21:34:54 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AD9D106564A; Mon, 21 Jun 2010 21:34:54 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D314A8FC15; Mon, 21 Jun 2010 21:34:52 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA02380; Tue, 22 Jun 2010 00:34:51 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1OQodn-000Mvh-3K; Tue, 22 Jun 2010 00:34:51 +0300 Message-ID: <4C1FDAF9.3080808@freebsd.org> Date: Tue, 22 Jun 2010 00:34:49 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100603) MIME-Version: 1.0 To: Navdeep Parhar , freebsd-hackers@freebsd.org, freebsd-amd64@freebsd.org References: <4C1F798C.7010204@freebsd.org> <201006211143.26459.jhb@freebsd.org> <4C1F8BDD.9010408@freebsd.org> <201006211610.45811.jhb@freebsd.org> <20100621204435.GA98177@hub.freebsd.org> In-Reply-To: <20100621204435.GA98177@hub.freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: Re: amd64 kernel modules: mapping sections to addresses X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 21:34:54 -0000 on 21/06/2010 23:44 Navdeep Parhar said the following: > On Mon, Jun 21, 2010 at 04:10:45PM -0400, John Baldwin wrote: >> On Monday 21 June 2010 11:57:17 am Andriy Gapon wrote: >>> on 21/06/2010 18:43 John Baldwin said the following: >>>> np@ has a patch to gdb to fix this for kgdb. I haven't committed it as it >>>> patched gdb internals and wasn't in a kgdb-specific place, but I'm not >> sure of >>>> a better way to fix kgdb. >>> Oh, yes, section mapping is done in common gdb code. >>> Perhaps kld.c shouldn't call build_section_table, but directly call >>> bfd_map_over_sections with a custom variant of add_to_section_table? >>> Can you please share the patch? >> It was deeper level than that, I'd have to dig it up. > > I'm using this patch these days: > http://people.freebsd.org/~np/kgdb+kld+amd64.diff > > The changes to the kernel linker were not required originally. See this > for why they had to be made: > http://lists.freebsd.org/pipermail/freebsd-hackers/2009-November/030093.html > > The patch is quite crude and I have no idea how it behaves on other > platforms. Thanks a lot! These are exact issues that I hit and the patches are what I think they should be, take or give. I don't think they are really crude. I will try to get them committed. Kernel linker change is good as is, I'd just like to move the zero size check before the switch statement. gdb change - I'd rather do it via kld_current_sos, kld_relocate_section_addresses. I'd like to avoid changing common gdb code for a variety of reasons. -- Andriy Gapon