Print this page
7324 stack needs to be sufficiently aligned for SSE before init_array are called

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/sgs/rtld/i386/boot.s
          +++ new/usr/src/cmd/sgs/rtld/i386/boot.s
↓ open down ↓ 19 lines elided ↑ open up ↑
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*
  23   23   *      Copyright (c) 1988 AT&T
  24   24   *        All Rights Reserved
  25   25   *
  26   26   *
  27   27   * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  28   28   * Use is subject to license terms.
  29   29   */
  30      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  31   30  
  32   31  /*
  33   32   * Bootstrap routine for run-time linker.
  34   33   * We get control from exec which has loaded our text and
  35   34   * data into the process' address space and created the process
  36   35   * stack.
  37   36   *
  38   37   * On entry, the process stack looks like this:
  39   38   *
  40   39   *      #                       # <- %esp
↓ open down ↓ 47 lines elided ↑ open up ↑
  88   87  #include        <link.h>
  89   88  
  90   89          .file   "boot.s"
  91   90          .text
  92   91          .globl  _rt_boot
  93   92          .globl  _setup
  94   93          .globl  _GLOBAL_OFFSET_TABLE_
  95   94          .type   _rt_boot,@function
  96   95          .align  4
  97   96  
       97 +        / init is called from the _init symbol in the CRT, however .init_array
       98 +        / are called "naturally" from call_init.  Because of that, we need the
       99 +        / stack aligned here so that initializers called via _array sections may
      100 +        / safely use SIMD instructions.
  98  101  _rt_alias:
  99  102          jmp     .get_ip                 / in case we were invoked from libc.so
 100  103  _rt_boot:
 101  104          movl    %esp,%ebp               / save for referencing args
 102  105          subl    $EB_MAX_SIZE32,%esp     / make room for a max sized boot vector
      106 +        andl    $-16,%esp
      107 +        subl    $8,%esp
 103  108          movl    %esp,%esi               / use esi as a pointer to &eb[0]
 104  109          movl    $EB_ARGV,0(%esi)        / set up tag for argv
 105  110          leal    4(%ebp),%eax            / get address of argv
 106  111          movl    %eax,4(%esi)            / put after tag
 107  112          movl    $EB_ENVP,8(%esi)        / set up tag for envp
 108  113          movl    (%ebp),%eax             / get # of args
 109  114          addl    $2,%eax                 / one for the zero & one for argc
 110  115          leal    (%ebp,%eax,4),%edi      / now points past args & @ envp
 111  116          movl    %edi,12(%esi)           / set envp
 112  117  .L0:    addl    $4,%edi                 / next
↓ open down ↓ 21 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX