platform_bionic/tests/libs/cfi_test_bad_lib.cpp
Evgenii Stepanov 0a3637d3eb Runtime support for CFI
Control Flow Integrity support in bionic.

General design:
http://clang.llvm.org/docs/ControlFlowIntegrityDesign.html#shared-library-support

This CL implements subsections "CFI Shadow" and "CFI_SlowPath" in the above document.

Bug: 22033465
Test: bionic device tests
Change-Id: I14dfea630de468eb5620e7f55f92b1397ba06217
2017-01-18 13:13:52 -08:00

4 lines
198 B
C++

// Mock an invalid CFI-enabled library.
__attribute__((aligned(4096))) extern "C" char dummy[16] = {};
__asm__(".globl __cfi_check");
__asm__("__cfi_check = dummy + 3"); // Not aligned to anything.