Changeset c018b85 for doc/working/exception/impl/exception.c
- Timestamp:
- Jan 18, 2019, 4:30:07 PM (5 years ago)
- 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:
- 0c13238
- Parents:
- e1f7eef (diff), bead1cf (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/working/exception/impl/exception.c
re1f7eef rc018b85 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 table 325 asm volatile (".cfi_lsda 0x1b, .LLSDACFA2"); 326 #else 322 327 asm volatile (".cfi_personality 0x3,__gcfa_personality_v0"); 323 328 // Setup the exception table 324 329 asm volatile (".cfi_lsda 0x3, .LLSDACFA2"); 330 #endif 325 331 326 332 // Label which defines the start of the area for which the handler is setup … … 356 362 // Some more works need to be done if we want to have a single 357 363 // 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 358 399 asm ( 359 400 //HEADER … … 375 416 " .text\n" // TABLE footer 376 417 " .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"379 418 ); 419 #endif
Note: See TracChangeset
for help on using the changeset viewer.