Author: jhb
Date: Wed Jun 20 21:06:51 2012
New Revision: 237338
URL: http://svn.freebsd.org/changeset/base/237338

Log:
  Don't return an error if a kld does not contain any modules (e.g. a
  kld that only contained a sysctl).  The kernel linker allows such
  modules, so the boot loader should not reject them.
  
  MFC after:    2 weeks

Modified:
  head/sys/boot/common/load_elf.c
  head/sys/boot/common/load_elf_obj.c

Modified: head/sys/boot/common/load_elf.c
==============================================================================
--- head/sys/boot/common/load_elf.c     Wed Jun 20 20:01:51 2012        
(r237337)
+++ head/sys/boot/common/load_elf.c     Wed Jun 20 21:06:51 2012        
(r237338)
@@ -612,7 +612,7 @@ __elfN(parse_modmetadata)(struct preload
     Elf_Addr v, p, p_stop;
 
     if (__elfN(lookup_symbol)(fp, ef, "__start_set_modmetadata_set", &sym) != 
0)
-       return ENOENT;
+       return 0;
     p = sym.st_value + ef->off;
     if (__elfN(lookup_symbol)(fp, ef, "__stop_set_modmetadata_set", &sym) != 0)
        return ENOENT;

Modified: head/sys/boot/common/load_elf_obj.c
==============================================================================
--- head/sys/boot/common/load_elf_obj.c Wed Jun 20 20:01:51 2012        
(r237337)
+++ head/sys/boot/common/load_elf_obj.c Wed Jun 20 21:06:51 2012        
(r237338)
@@ -369,7 +369,7 @@ __elfN(obj_parse_modmetadata)(struct pre
 
        if (__elfN(obj_lookup_set)(fp, ef, "modmetadata_set", &p, &p_stop,
            &modcnt) != 0)
-               return ENOENT;
+               return 0;
 
        modcnt = 0;
        while (p < p_stop) {
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to