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

@@ -637,12 +637,12 @@
                                                  * field.
                                                  */
                                             (void) dwarf_ehe_extract(
                                                 &data[off + ndx],
                                                 &ndx, ciePflag,
-                                                ofl->ofl_dehdr->e_ident,
-                                                shdr->sh_addr, off + ndx);
+                                                ofl->ofl_dehdr->e_ident, B_FALSE,
+                                                shdr->sh_addr, off + ndx, 0);
                                             break;
                                         case 'R':
                                             /* code encoding */
                                             cieRflag = data[off + ndx];
                                             ndx++;

@@ -656,14 +656,21 @@
                                 }
                         } else {
                                 uint_t      bintabndx;
                                 uint64_t    initloc;
                                 uint64_t    fdeaddr;
+                                uint64_t    gotaddr = 0;
+
+                                if (ofl->ofl_osgot != NULL)
+                                        gotaddr =
+                                            ofl->ofl_osgot->os_shdr->sh_addr;
 
                                 initloc = dwarf_ehe_extract(&data[off],
                                     &ndx, cieRflag, ofl->ofl_dehdr->e_ident,
-                                    shdr->sh_addr, off + ndx);
+                                    B_FALSE,
+                                    shdr->sh_addr, off + ndx,
+                                    gotaddr);
 
                                 /*
                                  * Ignore FDEs with initloc set to 0.
                                  * initloc will not be 0 unless this FDE was
                                  * abandoned due to GNU linkonce processing.