Print this page
5270 ld(1) cannot handle CIE version 3 in .eh_frame

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/sgs/libld/common/unwind.c
          +++ new/usr/src/cmd/sgs/libld/common/unwind.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) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright 2014 Nexenta Systems, Inc.
  24   25   */
  25   26  
  26   27  #include        <string.h>
  27   28  #include        <stdio.h>
  28   29  #include        <sys/types.h>
  29   30  #include        <sgs.h>
  30   31  #include        <debug.h>
  31   32  #include        <_libld.h>
  32   33  #include        <dwarf.h>
  33   34  #include        <stdlib.h>
↓ open down ↓ 368 lines elided ↑ open up ↑
 402  403                                   */
 403  404                                  id = extract_uint(data + off, &ndx, bswap);
 404  405  
 405  406                                  /*
 406  407                                   * A CIE record has a id of '0', otherwise
 407  408                                   * this is a FDE entry and the 'id' is the
 408  409                                   * CIE pointer.
 409  410                                   */
 410  411                                  if (id == 0) {
 411  412                                          uint_t  cieversion;
 412      -                                        /*
 413      -                                         * The only CIE version supported
 414      -                                         * is '1' - quick sanity check
 415      -                                         * here.
 416      -                                         */
 417  413                                          cieversion = data[off + ndx];
 418  414                                          ndx += 1;
 419  415                                          /* BEGIN CSTYLED */
 420      -                                        if (cieversion != 1) {
      416 +                                        if (cieversion != 1 && cieversion != 3) {
 421  417                                              ld_eprintf(ofl, ERR_FATAL,
 422  418                                                  MSG_INTL(MSG_UNW_BADCIEVERS),
 423  419                                                  isp->is_file->ifl_name,
 424  420                                                  isp->is_name, off);
 425  421                                              return (S_ERROR);
 426  422                                          }
 427  423                                          /* END CSTYLED */
 428  424                                  } else {
 429  425                                          fde_cnt++;
 430  426                                  }
↓ open down ↓ 144 lines elided ↑ open up ↑
 575  571                          id = extract_uint(data + off, &ndx, bswap);
 576  572  
 577  573                          /*
 578  574                           * A CIE record has a id of '0'; otherwise
 579  575                           * this is a FDE entry and the 'id' is the
 580  576                           * CIE pointer.
 581  577                           */
 582  578                          if (id == 0) {
 583  579                                  char    *cieaugstr;
 584  580                                  uint_t  cieaugndx;
      581 +                                uint_t  cieversion;
 585  582  
 586  583                                  ciePflag = 0;
 587  584                                  cieRflag = 0;
 588  585                                  /*
 589  586                                   * We need to drill through the CIE
 590  587                                   * to find the Rflag.  It's the Rflag
 591  588                                   * which describes how the FDE code-pointers
 592  589                                   * are encoded.
 593  590                                   */
 594  591  
 595      -                                /*
 596      -                                 * burn through version
 597      -                                 */
 598      -                                ndx++;
      592 +                                cieversion = data[off + ndx];
      593 +                                ndx += 1;
 599  594  
 600  595                                  /*
 601  596                                   * augstr
 602  597                                   */
 603  598                                  cieaugstr = (char *)(&data[off + ndx]);
 604  599                                  ndx += strlen(cieaugstr) + 1;
 605  600  
 606  601                                  /*
 607  602                                   * calign & dalign
 608  603                                   */
 609  604                                  (void) uleb_extract(&data[off], &ndx);
 610  605                                  (void) sleb_extract(&data[off], &ndx);
 611  606  
 612  607                                  /*
 613  608                                   * retreg
 614  609                                   */
 615      -                                ndx++;
 616      -
      610 +                                if (cieversion == 1)
      611 +                                        ndx++;
      612 +                                else
      613 +                                        (void) uleb_extract(&data[off], &ndx);
 617  614                                  /*
 618  615                                   * we walk through the augmentation
 619  616                                   * section now looking for the Rflag
 620  617                                   */
 621  618                                  for (cieaugndx = 0; cieaugstr[cieaugndx];
 622  619                                      cieaugndx++) {
 623  620                                          /* BEGIN CSTYLED */
 624  621                                          switch (cieaugstr[cieaugndx]) {
 625  622                                          case 'z':
 626  623                                              /* size */
↓ open down ↓ 173 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX