-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Refactor DynamicLibrary so searching for a symbol will have a…
… defined order" The i686-mingw32-RA-on-linux bot is still having errors. This reverts commit r301236. llvm-svn: 301240
- Loading branch information
Frederich Munch
committed
Apr 24, 2017
1 parent
0f62eea
commit fd96d5e
Showing
11 changed files
with
285 additions
and
576 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
//===- SearchForAddressOfSpecialSymbol.cpp - Function addresses -*- C++ -*-===// | ||
// | ||
// The LLVM Compiler Infrastructure | ||
// | ||
// This file is distributed under the University of Illinois Open Source | ||
// License. See LICENSE.TXT for details. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This file pulls the addresses of certain symbols out of the linker. It must | ||
// include as few header files as possible because it declares the symbols as | ||
// void*, which would conflict with the actual symbol type if any header | ||
// declared it. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <string.h> | ||
|
||
// Must declare the symbols in the global namespace. | ||
static void *DoSearch(const char* symbolName) { | ||
#define EXPLICIT_SYMBOL(SYM) \ | ||
extern void *SYM; if (!strcmp(symbolName, #SYM)) return &SYM | ||
|
||
// If this is darwin, it has some funky issues, try to solve them here. Some | ||
// important symbols are marked 'private external' which doesn't allow | ||
// SearchForAddressOfSymbol to find them. As such, we special case them here, | ||
// there is only a small handful of them. | ||
|
||
#ifdef __APPLE__ | ||
{ | ||
// __eprintf is sometimes used for assert() handling on x86. | ||
// | ||
// FIXME: Currently disabled when using Clang, as we don't always have our | ||
// runtime support libraries available. | ||
#ifndef __clang__ | ||
#ifdef __i386__ | ||
EXPLICIT_SYMBOL(__eprintf); | ||
#endif | ||
#endif | ||
} | ||
#endif | ||
|
||
#ifdef __CYGWIN__ | ||
{ | ||
EXPLICIT_SYMBOL(_alloca); | ||
EXPLICIT_SYMBOL(__main); | ||
} | ||
#endif | ||
|
||
#undef EXPLICIT_SYMBOL | ||
return nullptr; | ||
} | ||
|
||
namespace llvm { | ||
void *SearchForAddressOfSpecialSymbol(const char* symbolName) { | ||
return DoSearch(symbolName); | ||
} | ||
} // namespace llvm |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
133 changes: 0 additions & 133 deletions
133
llvm/unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.