Print this page
9059 Simplify SMAP relocations with krtld
Portions contributed by: John Levon <john.levon@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/modctl.c
          +++ new/usr/src/uts/common/os/modctl.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright (c) 2017 Joyent, Inc.
  24   25   */
  25   26  
  26   27  /*
  27   28   * modctl system call for loadable module support.
  28   29   */
  29   30  
  30   31  #include <sys/param.h>
  31   32  #include <sys/user.h>
  32   33  #include <sys/systm.h>
  33   34  #include <sys/exec.h>
↓ open down ↓ 3432 lines elided ↑ open up ↑
3466 3467                   */
3467 3468                  if ((cluster_bootflags & CLUSTER_BOOTED) && !modrootloaded) {
3468 3469                          retval = clboot_modload(mp);
3469 3470                  }
3470 3471  
3471 3472                  kmem_free(modinfop, sizeof (struct modinfo));
3472 3473                  (void) mod_sysctl(SYS_SET_MVAR, (void *)mp);
3473 3474                  retval = install_stubs_by_name(mp, mp->mod_modname);
3474 3475  
3475 3476                  /*
     3477 +                 * Perform hotinlines before module is started.
     3478 +                 */
     3479 +                do_hotinlines(mp->mod_mp);
     3480 +
     3481 +                /*
3476 3482                   * Now that the module is loaded, we need to give DTrace
3477 3483                   * a chance to notify its providers.  This is done via
3478 3484                   * the dtrace_modload function pointer.
3479 3485                   */
3480 3486                  if (strcmp(mp->mod_modname, "dtrace") != 0) {
3481 3487                          struct modctl *dmp = mod_hold_by_name("dtrace");
3482 3488  
3483 3489                          if (dmp != NULL && dtrace_modload != NULL)
3484 3490                                  (*dtrace_modload)(mp);
3485 3491  
↓ open down ↓ 1353 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX