Print this page
3265 link-editor builds bogus .eh_frame_hdr on ia32

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 ↓ 631 lines elided ↑ open up ↑
 632  632                                              ciePflag = data[off + ndx];
 633  633                                              ndx++;
 634  634                                                  /*
 635  635                                                   * Just need to extract the
 636  636                                                   * value to move on to the next
 637  637                                                   * field.
 638  638                                                   */
 639  639                                              (void) dwarf_ehe_extract(
 640  640                                                  &data[off + ndx],
 641  641                                                  &ndx, ciePflag,
 642      -                                                ofl->ofl_dehdr->e_ident,
 643      -                                                shdr->sh_addr, off + ndx);
      642 +                                                ofl->ofl_dehdr->e_ident, B_FALSE,
      643 +                                                shdr->sh_addr, off + ndx, 0);
 644  644                                              break;
 645  645                                          case 'R':
 646  646                                              /* code encoding */
 647  647                                              cieRflag = data[off + ndx];
 648  648                                              ndx++;
 649  649                                              break;
 650  650                                          case 'L':
 651  651                                              /* lsda encoding */
 652  652                                              ndx++;
 653  653                                              break;
 654  654                                          }
 655  655                                          /* END CSTYLED */
 656  656                                  }
 657  657                          } else {
 658  658                                  uint_t      bintabndx;
 659  659                                  uint64_t    initloc;
 660  660                                  uint64_t    fdeaddr;
      661 +                                uint64_t    gotaddr = 0;
      662 +
      663 +                                if (ofl->ofl_osgot != NULL)
      664 +                                        gotaddr =
      665 +                                            ofl->ofl_osgot->os_shdr->sh_addr;
 661  666  
 662  667                                  initloc = dwarf_ehe_extract(&data[off],
 663  668                                      &ndx, cieRflag, ofl->ofl_dehdr->e_ident,
 664      -                                    shdr->sh_addr, off + ndx);
      669 +                                    B_FALSE,
      670 +                                    shdr->sh_addr, off + ndx,
      671 +                                    gotaddr);
 665  672  
 666  673                                  /*
 667  674                                   * Ignore FDEs with initloc set to 0.
 668  675                                   * initloc will not be 0 unless this FDE was
 669  676                                   * abandoned due to GNU linkonce processing.
 670  677                                   * The 0 value occurs because we don't resolve
 671  678                                   * sloppy relocations for unwind header target
 672  679                                   * sections.
 673  680                                   */
 674  681                                  if (initloc != 0) {
↓ open down ↓ 118 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX