From owner-svn-src-all@FreeBSD.ORG Thu Nov 19 16:25:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 866EA106568B; Thu, 19 Nov 2009 16:25:41 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7772D8FC1C; Thu, 19 Nov 2009 16:25:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAJGPf7p011866; Thu, 19 Nov 2009 16:25:41 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAJGPfx7011864; Thu, 19 Nov 2009 16:25:41 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200911191625.nAJGPfx7011864@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 19 Nov 2009 16:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199534 - head/sys/boot/uboot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 19 Nov 2009 16:25:41 -0000 Author: raj Date: Thu Nov 19 16:25:41 2009 New Revision: 199534 URL: http://svn.freebsd.org/changeset/base/199534 Log: Provide an effective (relocated) address when building modules metadata. This lets modules loaded dynamically in loader(8) work for U-Boot-based platforms. MFC after: 1 week Modified: head/sys/boot/uboot/common/metadata.c Modified: head/sys/boot/uboot/common/metadata.c ============================================================================== --- head/sys/boot/uboot/common/metadata.c Thu Nov 19 16:21:26 2009 (r199533) +++ head/sys/boot/uboot/common/metadata.c Thu Nov 19 16:25:41 2009 (r199534) @@ -231,6 +231,7 @@ md_copymodules(vm_offset_t addr) struct preloaded_file *fp; struct file_metadata *md; int c; + vm_offset_t a; c = addr != 0; /* start with the first module on the list, should be the kernel */ @@ -240,7 +241,8 @@ md_copymodules(vm_offset_t addr) MOD_TYPE(addr, fp->f_type, c); if (fp->f_args) MOD_ARGS(addr, fp->f_args, c); - MOD_ADDR(addr, fp->f_addr, c); + a = fp->f_addr - __elfN(relocation_offset); + MOD_ADDR(addr, a, c); MOD_SIZE(addr, fp->f_size, c); for (md = fp->f_metadata; md != NULL; md = md->md_next) { if (!(md->md_type & MODINFOMD_NOCOPY))