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


 622                                     cieaugndx++) {
 623                                         /* BEGIN CSTYLED */
 624                                         switch (cieaugstr[cieaugndx]) {
 625                                         case 'z':
 626                                             /* size */
 627                                             (void) uleb_extract(&data[off],
 628                                                 &ndx);
 629                                             break;
 630                                         case 'P':
 631                                             /* personality */
 632                                             ciePflag = data[off + ndx];
 633                                             ndx++;
 634                                                 /*
 635                                                  * Just need to extract the
 636                                                  * value to move on to the next
 637                                                  * field.
 638                                                  */
 639                                             (void) dwarf_ehe_extract(
 640                                                 &data[off + ndx],
 641                                                 &ndx, ciePflag,
 642                                                 ofl->ofl_dehdr->e_ident,
 643                                                 shdr->sh_addr, off + ndx);
 644                                             break;
 645                                         case 'R':
 646                                             /* code encoding */
 647                                             cieRflag = data[off + ndx];
 648                                             ndx++;
 649                                             break;
 650                                         case 'L':
 651                                             /* lsda encoding */
 652                                             ndx++;
 653                                             break;
 654                                         }
 655                                         /* END CSTYLED */
 656                                 }
 657                         } else {
 658                                 uint_t      bintabndx;
 659                                 uint64_t    initloc;
 660                                 uint64_t    fdeaddr;





 661 
 662                                 initloc = dwarf_ehe_extract(&data[off],
 663                                     &ndx, cieRflag, ofl->ofl_dehdr->e_ident,
 664                                     shdr->sh_addr, off + ndx);


 665 
 666                                 /*
 667                                  * Ignore FDEs with initloc set to 0.
 668                                  * initloc will not be 0 unless this FDE was
 669                                  * abandoned due to GNU linkonce processing.
 670                                  * The 0 value occurs because we don't resolve
 671                                  * sloppy relocations for unwind header target
 672                                  * sections.
 673                                  */
 674                                 if (initloc != 0) {
 675                                         bintabndx = fde_count * 2;
 676                                         fde_count++;
 677 
 678                                         /*
 679                                          * FDEaddr is adjusted
 680                                          * to account for the length & id which
 681                                          * have already been consumed.
 682                                          */
 683                                         fdeaddr = shdr->sh_addr + off;
 684 




 622                                     cieaugndx++) {
 623                                         /* BEGIN CSTYLED */
 624                                         switch (cieaugstr[cieaugndx]) {
 625                                         case 'z':
 626                                             /* size */
 627                                             (void) uleb_extract(&data[off],
 628                                                 &ndx);
 629                                             break;
 630                                         case 'P':
 631                                             /* personality */
 632                                             ciePflag = data[off + ndx];
 633                                             ndx++;
 634                                                 /*
 635                                                  * Just need to extract the
 636                                                  * value to move on to the next
 637                                                  * field.
 638                                                  */
 639                                             (void) dwarf_ehe_extract(
 640                                                 &data[off + ndx],
 641                                                 &ndx, ciePflag,
 642                                                 ofl->ofl_dehdr->e_ident, B_FALSE,
 643                                                 shdr->sh_addr, off + ndx, 0);
 644                                             break;
 645                                         case 'R':
 646                                             /* code encoding */
 647                                             cieRflag = data[off + ndx];
 648                                             ndx++;
 649                                             break;
 650                                         case 'L':
 651                                             /* lsda encoding */
 652                                             ndx++;
 653                                             break;
 654                                         }
 655                                         /* END CSTYLED */
 656                                 }
 657                         } else {
 658                                 uint_t      bintabndx;
 659                                 uint64_t    initloc;
 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;
 666 
 667                                 initloc = dwarf_ehe_extract(&data[off],
 668                                     &ndx, cieRflag, ofl->ofl_dehdr->e_ident,
 669                                     B_FALSE,
 670                                     shdr->sh_addr, off + ndx,
 671                                     gotaddr);
 672 
 673                                 /*
 674                                  * Ignore FDEs with initloc set to 0.
 675                                  * initloc will not be 0 unless this FDE was
 676                                  * abandoned due to GNU linkonce processing.
 677                                  * The 0 value occurs because we don't resolve
 678                                  * sloppy relocations for unwind header target
 679                                  * sections.
 680                                  */
 681                                 if (initloc != 0) {
 682                                         bintabndx = fde_count * 2;
 683                                         fde_count++;
 684 
 685                                         /*
 686                                          * FDEaddr is adjusted
 687                                          * to account for the length & id which
 688                                          * have already been consumed.
 689                                          */
 690                                         fdeaddr = shdr->sh_addr + off;
 691