readelf: skip 'S' character in CFI 'z' augmentation strings

Jim Blandy jimb@red-bean.com
Mon Feb 8 10:16:00 GMT 2010


The 'readelf' program fails to process 'z' augmentation strings using
the 'S' character, making it unable to display valid FDEs.

A 'z' CFI augmentation string can include an 'S' character, indicating
that the frame is a signal handler. When unwinding an ordinary stack
frame, the PC recovered for the caller is usually that of the
instruction after the call, which causes difficulties if the call is
the last instruction of the function --- presumably to a function the
compiler knows will never return. The 'S' augmentation character
allows unwinders to avoid performing this hack when unwinding from a
signal handler.

The Linux Standards Base 4.0 doesn't mention 'S', but this isn't too
surprising --- the section describing the .eh_frame augmentations
still has simple copy-editing problems and serious omissions unfixed
since LSB 3.0.  The best documentation for 'S' appears to be:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26208

Because readelf doesn't recognize 'S', it may fail to process other
augmentation string characters necessary to parse the FDE, like 'R'.
This patch fixes that.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: skip-S-augmentation.patch
Type: text/x-patch
Size: 2158 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20100208/0ada7591/attachment.bin>


More information about the Binutils mailing list