svn commit: r199850 - stable/8/sys/boot/uboot/common

Rafal Jaworowski raj at FreeBSD.org
Thu Nov 26 22:35:27 UTC 2009


Author: raj
Date: Thu Nov 26 22:35:26 2009
New Revision: 199850
URL: http://svn.freebsd.org/changeset/base/199850

Log:
  MFC r199534:
  
  Provide an effective (relocated) address when building modules metadata.
  
  This lets modules loaded dynamically in loader(8) work for U-Boot-based
  platforms.

Modified:
  stable/8/sys/boot/uboot/common/metadata.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/boot/uboot/common/metadata.c
==============================================================================
--- stable/8/sys/boot/uboot/common/metadata.c	Thu Nov 26 22:09:37 2009	(r199849)
+++ stable/8/sys/boot/uboot/common/metadata.c	Thu Nov 26 22:35:26 2009	(r199850)
@@ -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))


More information about the svn-src-stable mailing list