Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/working/exception/impl/exception.c

    r3e06da2 rc529a24  
    243243
    244244                                        // 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;                                   
    246246
    247247                                        _Unwind_Reason_Code (*matcher)() =
     
    320320        // on how the assembly works.
    321321        // Setup the personality routine
    322         #if defined(__PIC__)
    323         asm volatile (".cfi_personality 0x9b,CFA.ref.__gcfa_personality_v0");
    324         // Setup the exception table
    325         asm volatile (".cfi_lsda 0x1b, .LLSDACFA2");
    326         #else
    327322        asm volatile (".cfi_personality 0x3,__gcfa_personality_v0");
    328323        // Setup the exception table
    329324        asm volatile (".cfi_lsda 0x3, .LLSDACFA2");
    330         #endif
    331325
    332326        // Label which defines the start of the area for which the handler is setup
     
    362356// Some more works need to be done if we want to have a single
    363357// call to the try routine
    364 #if defined(__PIC__)
    365 asm (
    366         //HEADER
    367         ".LFECFA1:\n"
    368         "       .globl  __gcfa_personality_v0\n"
    369         "       .section        .gcc_except_table,\"a\",@progbits\n"
    370         ".LLSDACFA2:\n"                                                 //TABLE header
    371         "       .byte   0xff\n"
    372         "       .byte   0xff\n"
    373         "       .byte   0x1\n"
    374         "       .uleb128 .LLSDACSECFA2-.LLSDACSBCFA2\n"         // BODY length
    375         // Body uses language specific data and therefore could be modified arbitrarily
    376         ".LLSDACSBCFA2:\n"                                              // BODY start
    377         "       .uleb128 .TRYSTART-__try_terminate\n"           // Handled area start  (relative to start of function)
    378         "       .uleb128 .TRYEND-.TRYSTART\n"                           // Handled area length
    379         "       .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 0
    381         ".LLSDACSECFA2:\n"                                              // BODY end
    382         "       .text\n"                                                        // TABLE footer
    383         "       .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 symbol
    390         "       .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 specifically
    392         "       .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 symbol
    395         "CFA.ref.__gcfa_personality_v0:\n"
    396         "       .quad __gcfa_personality_v0\n"
    397 );
    398 #else
    399358asm (
    400359        //HEADER
     
    416375        "       .text\n"                                                        // TABLE footer
    417376        "       .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"
    418379);
    419 #endif
Note: See TracChangeset for help on using the changeset viewer.