Need help in understanding code generated for C++ exception handling

Shankar Iyer sh22iyer@yahoo.co.in
Tue Oct 20 09:20:00 GMT 2009


Hi,

  I have compiled and generated a C++ shared library with the "-fPIC" option. But this shared library requires text relocation during runtime and is not usable on seLinux which disables writeable text segments. The text relocation is due to use of exceptions inside the shared library. There is a segment ".gcc_except_table" created in the shared library and it contains symbols suffixed with "$$LSDA" :-

0013df38 <_ZN6comref4runt11userdef20releasebackEPS1_$$LSDA>:
  13df38:       ff 00                   incl   (%eax)
  13df3a:       18 01                   sbb    %al,(%ecx)
  13df3c:       0c 1c                   or     $0x1c,%al
  13df3e:       03 2f                   add    (%edi),%ebp
  13df40:       01 52 0a                add    %edx,0xa(%edx)
  13df43:       6d                      insl   (%dx),%es:(%edi)
  13df44:       00 66 1a                add    %ah,0x1a(%esi)
  13df47:       00 00                   add    %al,(%eax)
  13df49:       02 00                   add    (%eax),%al
        ...
   13df4b: R_386_32        _ZTIN6comref4runt12genExceptionE


  Can someone please help in understand the issue and how to work around?

Thanks,
Shankar


      Yahoo! India has a new look. Take a sneak peek http://in.yahoo.com/trynew



More information about the Gcc mailing list