1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

Changeset 1512

Show
Ignore:
Timestamp:
05/11/11 19:24:29 (3 years ago)
Author:
kaiwang27
Message:

When calculating padding for CIE and FDE, the length field itself
should be excluded.

Submitted by: Roman Divacky

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/libdwarf/libdwarf_frame.c

    r1511 r1512  
    14421442 
    14431443        /* Add padding. */ 
    1444         len = ds->ds_size - cie->cie_offset; 
     1444        len = ds->ds_size - cie->cie_offset - 4; 
    14451445        cie->cie_length = roundup(len, dbg->dbg_pointer_size); 
    14461446        while (len++ < cie->cie_length) 
     
    14481448 
    14491449        /* Fill in the length field. */ 
    1450         cie->cie_length -= 4; 
    14511450        dbg->write(ds->ds_data, &offset, cie->cie_length, 4); 
    14521451         
     
    15001499 
    15011500        /* Add padding. */ 
    1502         len = ds->ds_size - fde->fde_offset; 
     1501        len = ds->ds_size - fde->fde_offset - 4; 
    15031502        fde->fde_length = roundup(len, dbg->dbg_pointer_size); 
    15041503        while (len++ < fde->fde_length) 
     
    15061505 
    15071506        /* Fill in the length field. */ 
    1508         fde->fde_length -= 4; 
    15091507        dbg->write(ds->ds_data, &offset, fde->fde_length, 4); 
    15101508