Changeset fd73248 for doc/working


Ignore:
Timestamp:
Jan 14, 2019, 5:02:08 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
3e06da2
Parents:
276a55b2
Message:

Some progress on pic exceptions

Location:
doc/working/exception/impl
Files:
1 added
3 edited

Legend:

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

    r276a55b2 rfd73248  
    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
    322327        asm volatile (".cfi_personality 0x3,__gcfa_personality_v0");
    323328        // Setup the exception table
    324329        asm volatile (".cfi_lsda 0x3, .LLSDACFA2");
     330        #endif
    325331
    326332        // Label which defines the start of the area for which the handler is setup
     
    356362// Some more works need to be done if we want to have a single
    357363// call to the try routine
     364#if defined(__PIC__)
     365asm (
     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        "       .hidden CFA.ref.__gcfa_personality_v0\n"        // Declare an new hidden symbol
     385        "       .weak   CFA.ref.__gcfa_personality_v0\n"
     386        "       .section        .data.rel.local.CFA.ref.__gcfa_personality_v0,\"awG\",@progbits,CFA.ref.__gcfa_personality_v0,comdat\n" // No clue what this does specifically
     387        "       .align 8\n"
     388        "       .type CFA.ref.__gcfa_personality_v0, @object\n" // Type of our hidden symbol (it's not actually the function itself)
     389        "       .size CFA.ref.__gcfa_personality_v0, 8\n"               // Size of our hidden symbol
     390        "CFA.ref.__gcfa_personality_v0:\n"
     391        "       .quad __gcfa_personality_v0\n"
     392);
     393#else
    358394asm (
    359395        //HEADER
     
    375411        "       .text\n"                                                        // TABLE footer
    376412        "       .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"
    379413);
     414#endif
  • doc/working/exception/impl/nopic.s

    r276a55b2 rfd73248  
    101101        .text
    102102        .size   foo, .-foo
    103         .ident  "GCC: (Ubuntu 7.3.0-21ubuntu1~16.04) 7.3.0"
     103        .ident  "GCC: (Ubuntu 7.4.0-1ubuntu1~16.04~ppa1) 7.4.0"
    104104        .section        .note.GNU-stack,"",@progbits
  • doc/working/exception/impl/pic.s

    r276a55b2 rfd73248  
    103103        .hidden DW.ref.__gcc_personality_v0
    104104        .weak   DW.ref.__gcc_personality_v0
    105         .section        .data.DW.ref.__gcc_personality_v0,"awG",@progbits,DW.ref.__gcc_personality_v0,comdat
     105        .section        .data.rel.local.DW.ref.__gcc_personality_v0,"awG",@progbits,DW.ref.__gcc_personality_v0,comdat
    106106        .align 8
    107107        .type   DW.ref.__gcc_personality_v0, @object
     
    109109DW.ref.__gcc_personality_v0:
    110110        .quad   __gcc_personality_v0
    111         .ident  "GCC: (Ubuntu 7.3.0-21ubuntu1~16.04) 7.3.0"
     111        .ident  "GCC: (Ubuntu 7.4.0-1ubuntu1~16.04~ppa1) 7.4.0"
    112112        .section        .note.GNU-stack,"",@progbits
Note: See TracChangeset for help on using the changeset viewer.