diff options
| author | Kostya Serebryany <kcc@google.com> | 2011-12-28 01:08:14 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2011-12-28 01:08:14 +0000 |
| commit | 8b981c25642d3a4319c52aa906a4f45c63f8143e (patch) | |
| tree | 6cc210f6cac749e8a47a8b28d04ca679dd6405e5 /compiler-rt/lib/asan/mach_override/mach_override.c | |
| parent | 46c70d33d7b6ece449093d5afa7d7d10b7d1c1ed (diff) | |
| download | bcm5719-llvm-8b981c25642d3a4319c52aa906a4f45c63f8143e.tar.gz bcm5719-llvm-8b981c25642d3a4319c52aa906a4f45c63f8143e.zip | |
The code instrumented with ASan may have its own instance of the
mach_override library.
In this case chances are that functions from it will be called from
mach_override_ptr() during ASan initialization.
This may lead to crashes (if those functions are instrumented) or
incorrect behavior (if the implementations differ).
The attached patch renames mach_override_ptr() into
__asan_mach_override_ptr() and makes the rest of the mach_override
internals hidden.
The corresponding AddressSanitizer bug is
http://code.google.com/p/address-sanitizer/issues/detail?id=22
Patch by glider@google.com
llvm-svn: 147303
Diffstat (limited to 'compiler-rt/lib/asan/mach_override/mach_override.c')
| -rw-r--r-- | compiler-rt/lib/asan/mach_override/mach_override.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/compiler-rt/lib/asan/mach_override/mach_override.c b/compiler-rt/lib/asan/mach_override/mach_override.c index 25ee9d29bb8..7c259000891 100644 --- a/compiler-rt/lib/asan/mach_override/mach_override.c +++ b/compiler-rt/lib/asan/mach_override/mach_override.c @@ -108,18 +108,18 @@ typedef struct { allocateBranchIsland( BranchIsland **island, int allocateHigh, - void *originalFunctionAddress); + void *originalFunctionAddress) __attribute__((visibility("hidden"))); mach_error_t freeBranchIsland( - BranchIsland *island ); + BranchIsland *island ) __attribute__((visibility("hidden"))); #if defined(__ppc__) || defined(__POWERPC__) mach_error_t setBranchIslandTarget( BranchIsland *island, const void *branchTo, - long instruction ); + long instruction ) __attribute__((visibility("hidden"))); #endif #if defined(__i386__) || defined(__x86_64__) @@ -127,11 +127,11 @@ mach_error_t setBranchIslandTarget_i386( BranchIsland *island, const void *branchTo, - char* instructions ); + char* instructions ) __attribute__((visibility("hidden"))); void atomic_mov64( uint64_t *targetAddress, - uint64_t value ); + uint64_t value ) __attribute__((visibility("hidden"))); static Boolean eatKnownInstructions( @@ -140,7 +140,7 @@ eatKnownInstructions( int *howManyEaten, char *originalInstructions, int *originalInstructionCount, - uint8_t *originalInstructionSizes ); + uint8_t *originalInstructionSizes ) __attribute__((visibility("hidden"))); static void fixupInstructions( @@ -148,7 +148,7 @@ fixupInstructions( void *escapeIsland, void *instructionsToFix, int instructionCount, - uint8_t *instructionSizes ); + uint8_t *instructionSizes ) __attribute__((visibility("hidden"))); #endif /******************************************************************************* @@ -176,7 +176,7 @@ mach_error_t makeIslandExecutable(void *address) { #endif mach_error_t -mach_override_ptr( +__asan_mach_override_ptr( void *originalFunctionAddress, const void *overrideFunctionAddress, void **originalFunctionReentryIsland ) |

