- File:
-
- 1 edited
-
doc/working/exception/impl/exception.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/working/exception/impl/exception.c
r3e06da2 rc529a24 243 243 244 244 // Get a function pointer from the relative offset and call it 245 // _Unwind_Reason_Code (*matcher)() = (_Unwind_Reason_Code (*)())lsd_info.LPStart + imatcher; 245 // _Unwind_Reason_Code (*matcher)() = (_Unwind_Reason_Code (*)())lsd_info.LPStart + imatcher; 246 246 247 247 _Unwind_Reason_Code (*matcher)() = … … 320 320 // on how the assembly works. 321 321 // Setup the personality routine 322 #if defined(__PIC__)323 asm volatile (".cfi_personality 0x9b,CFA.ref.__gcfa_personality_v0");324 // Setup the exception table325 asm volatile (".cfi_lsda 0x1b, .LLSDACFA2");326 #else327 322 asm volatile (".cfi_personality 0x3,__gcfa_personality_v0"); 328 323 // Setup the exception table 329 324 asm volatile (".cfi_lsda 0x3, .LLSDACFA2"); 330 #endif331 325 332 326 // Label which defines the start of the area for which the handler is setup … … 362 356 // Some more works need to be done if we want to have a single 363 357 // call to the try routine 364 #if defined(__PIC__)365 asm (366 //HEADER367 ".LFECFA1:\n"368 " .globl __gcfa_personality_v0\n"369 " .section .gcc_except_table,\"a\",@progbits\n"370 ".LLSDACFA2:\n" //TABLE header371 " .byte 0xff\n"372 " .byte 0xff\n"373 " .byte 0x1\n"374 " .uleb128 .LLSDACSECFA2-.LLSDACSBCFA2\n" // BODY length375 // Body uses language specific data and therefore could be modified arbitrarily376 ".LLSDACSBCFA2:\n" // BODY start377 " .uleb128 .TRYSTART-__try_terminate\n" // Handled area start (relative to start of function)378 " .uleb128 .TRYEND-.TRYSTART\n" // Handled area length379 " .uleb128 .CATCH-__try_terminate\n" // Handler landing pad adress (relative to start of function)380 " .uleb128 1\n" // Action code, gcc seems to use always 0381 ".LLSDACSECFA2:\n" // BODY end382 " .text\n" // TABLE footer383 " .size __try_terminate, .-__try_terminate\n"384 );385 386 // Somehow this piece of helps with the resolution of debug symbols.387 __attribute__((unused)) static const int dummy = 0;388 asm (389 " .hidden CFA.ref.__gcfa_personality_v0\n" // Declare an new hidden symbol390 " .weak CFA.ref.__gcfa_personality_v0\n"391 " .section .data.rel.local.CFA.ref.__gcfa_personality_v0,\"awG\",@progbits,CFA.ref.__gcfa_personality_v0,comdat\n" // No clue what this does specifically392 " .align 8\n"393 " .type CFA.ref.__gcfa_personality_v0, @object\n" // Type of our hidden symbol (it's not actually the function itself)394 " .size CFA.ref.__gcfa_personality_v0, 8\n" // Size of our hidden symbol395 "CFA.ref.__gcfa_personality_v0:\n"396 " .quad __gcfa_personality_v0\n"397 );398 #else399 358 asm ( 400 359 //HEADER … … 416 375 " .text\n" // TABLE footer 417 376 " .size __try_terminate, .-__try_terminate\n" 377 " .ident \"GCC: (Ubuntu 6.2.0-3ubuntu11~16.04) 6.2.0 20160901\"\n" 378 // " .section .note.GNU-stack,\"x\",@progbits\n" 418 379 ); 419 #endif
Note:
See TracChangeset
for help on using the changeset viewer.