Date: Wed, 30 Jan 2013 23:49:36 +0000 (UTC) From: Ian Lepore <ian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246135 - head/sys/boot/uboot/common Message-ID: <201301302349.r0UNnam9038258@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ian Date: Wed Jan 30 23:49:36 2013 New Revision: 246135 URL: http://svnweb.freebsd.org/changeset/base/246135 Log: Do metadata relocation fixup on all loaded modules, not just the kernel. Approved by: cognet (mentor) Modified: head/sys/boot/uboot/common/metadata.c Modified: head/sys/boot/uboot/common/metadata.c ============================================================================== --- head/sys/boot/uboot/common/metadata.c Wed Jan 30 23:37:35 2013 (r246134) +++ head/sys/boot/uboot/common/metadata.c Wed Jan 30 23:49:36 2013 (r246135) @@ -369,12 +369,15 @@ md_load(char *args, vm_offset_t *modulep /* Convert addresses to the final VA */ *modulep -= __elfN(relocation_offset); - for (i = 0; i < sizeof mdt / sizeof mdt[0]; i++) { - md = file_findmetadata(kfp, mdt[i]); - if (md) { - bcopy(md->md_data, &vaddr, sizeof vaddr); - vaddr -= __elfN(relocation_offset); - bcopy(&vaddr, md->md_data, sizeof vaddr); + /* Do relocation fixup on metadata of each module. */ + for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { + for (i = 0; i < sizeof mdt / sizeof mdt[0]; i++) { + md = file_findmetadata(xp, mdt[i]); + if (md) { + bcopy(md->md_data, &vaddr, sizeof vaddr); + vaddr -= __elfN(relocation_offset); + bcopy(&vaddr, md->md_data, sizeof vaddr); + } } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301302349.r0UNnam9038258>