[compiler-rt] r292751 - Revert "[interception] Check for export table's size before referring to its elements."

Marcos Pividori via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 21 19:30:15 PST 2017


Author: mpividori
Date: Sat Jan 21 21:30:14 2017
New Revision: 292751

URL: http://llvm.org/viewvc/llvm-project?rev=292751&view=rev
Log:
Revert "[interception] Check for export table's size before referring to its elements."

This reverts commit r292747 because cmake fails for some archs.

Removed:
    compiler-rt/trunk/test/interception/TestCases/Windows/empty_export_table.cc
    compiler-rt/trunk/test/interception/TestCases/Windows/lit.local.cfg
    compiler-rt/trunk/test/interception/lit.cfg
    compiler-rt/trunk/test/interception/lit.site.cfg.in
Modified:
    compiler-rt/trunk/lib/interception/interception_win.cc
    compiler-rt/trunk/test/interception/CMakeLists.txt

Modified: compiler-rt/trunk/lib/interception/interception_win.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/interception/interception_win.cc?rev=292751&r1=292750&r2=292751&view=diff
==============================================================================
--- compiler-rt/trunk/lib/interception/interception_win.cc (original)
+++ compiler-rt/trunk/lib/interception/interception_win.cc Sat Jan 21 21:30:14 2017
@@ -878,8 +878,6 @@ uptr InternalGetProcAddress(void *module
 
   IMAGE_DATA_DIRECTORY *export_directory =
       &headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT];
-  if (export_directory->Size == 0)
-    return 0;
   RVAPtr<IMAGE_EXPORT_DIRECTORY> exports(module,
                                          export_directory->VirtualAddress);
   RVAPtr<DWORD> functions(module, exports->AddressOfFunctions);

Modified: compiler-rt/trunk/test/interception/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/interception/CMakeLists.txt?rev=292751&r1=292750&r2=292751&view=diff
==============================================================================
--- compiler-rt/trunk/test/interception/CMakeLists.txt (original)
+++ compiler-rt/trunk/test/interception/CMakeLists.txt Sat Jan 21 21:30:14 2017
@@ -1,30 +1,5 @@
 set(INTERCEPTION_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
 set(INTERCEPTION_TESTSUITES)
-set(INTERCEPTION_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-
-foreach(arch ${SANITIZER_COMMON_SUPPORTED_ARCH})
-  set(INTERCEPTION_TEST_TARGET_ARCH ${arch})
-  set(CONFIG_NAME ${arch}-${OS_NAME})
-
-  get_test_cc_for_arch(${arch} INTERCEPTION_TEST_TARGET_CC
-    INTERCEPTION_TEST_TARGET_CFLAGS)
-
-  string(TOUPPER ${arch} ARCH_UPPER_CASE)
-  set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config)
-  set(INTERCEPTION_TEST_TARGET_LIB RTInterception.test.${arch})
-
-  get_property(INTERCEPTION_TEST_TARGET_LIB_DIR TARGET
-    ${INTERCEPTION_TEST_TARGET_LIB} PROPERTY ARCHIVE_OUTPUT_DIRECTORY)
-
-  configure_lit_site_cfg(
-    ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
-    ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg
-    )
-
-  list(APPEND INTERCEPTION_TESTSUITES
-    ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
-  list(APPEND INTERCEPTION_TEST_DEPS RTInterception.test.${arch})
-endforeach()
 
 # Unit tests. There are currently no unit tests capable to running on Apple or
 # Android targets.

Removed: compiler-rt/trunk/test/interception/TestCases/Windows/empty_export_table.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/interception/TestCases/Windows/empty_export_table.cc?rev=292750&view=auto
==============================================================================
--- compiler-rt/trunk/test/interception/TestCases/Windows/empty_export_table.cc (original)
+++ compiler-rt/trunk/test/interception/TestCases/Windows/empty_export_table.cc (removed)
@@ -1,17 +0,0 @@
-// RUN: %clang_cl %s %inter_lib -o %t
-// RUN: %run %t 2>&1 | FileCheck %s
-// CHECK: OK
-
-#include "interception/interception.h"
-#include <stdio.h>
-#include <windows.h>
-
-// We try to get a pointer to a function from an executable that doesn't export
-// any symbol (empty export table).
-int main() {
-  __sanitizer::uptr FunPtr = __interception::InternalGetProcAddress(
-      (void *)GetModuleHandleA(0), "exampleFun");
-  if (FunPtr == 0)
-    printf("OK");
-  return 0;
-}

Removed: compiler-rt/trunk/test/interception/TestCases/Windows/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/interception/TestCases/Windows/lit.local.cfg?rev=292750&view=auto
==============================================================================
--- compiler-rt/trunk/test/interception/TestCases/Windows/lit.local.cfg (original)
+++ compiler-rt/trunk/test/interception/TestCases/Windows/lit.local.cfg (removed)
@@ -1,9 +0,0 @@
-def getRoot(config):
-  if not config.parent:
-    return config
-  return getRoot(config.parent)
-
-root = getRoot(config)
-
-if root.host_os not in ['Windows']:
-  config.unsupported = True

Removed: compiler-rt/trunk/test/interception/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/interception/lit.cfg?rev=292750&view=auto
==============================================================================
--- compiler-rt/trunk/test/interception/lit.cfg (original)
+++ compiler-rt/trunk/test/interception/lit.cfg (removed)
@@ -1,28 +0,0 @@
-# -*- Python -*-
-
-# Setup source root.
-config.test_source_root = os.path.join(os.path.dirname(__file__), "TestCases")
-
-# Setup config name.
-config.name = "Interception"
-
-# Add library sustitutions.
-if config.host_os == 'Windows':
-  libpath = os.path.join(config.target_lib_dir, config.target_lib + ".lib")
-  config.substitutions.append( ("%inter_lib", libpath))
-else:
-  libpath = os.path.join(config.target_lib_dir, "lib" + config.target_lib + ".a")
-  config.substitutions.append( ("%inter_lib", libpath))
-
-# Add clang substitutions.
-config.substitutions.append( ("%clang ", " ".join([config.clang,
-    config.target_cflags, "-I"+config.sources_dir, ""]) ))
-
-# Configure clang_cl for Windows.
-if config.host_os == 'Windows':
-  clang_cl_invocation = config.clang.replace("clang.exe","clang-cl.exe")
-  config.substitutions.append( ("%clang_cl ", " ".join([clang_cl_invocation,
-      config.target_cflags, "/I"+config.sources_dir, ""]) ))
-
-# Files to be considered for tests.
-config.suffixes = ['.c', '.cc', '.cpp']

Removed: compiler-rt/trunk/test/interception/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/interception/lit.site.cfg.in?rev=292750&view=auto
==============================================================================
--- compiler-rt/trunk/test/interception/lit.site.cfg.in (original)
+++ compiler-rt/trunk/test/interception/lit.site.cfg.in (removed)
@@ -1,15 +0,0 @@
- at LIT_SITE_CFG_IN_HEADER@
-
-# Tool-specific config options.
-config.target_cflags = "@INTERCEPTION_TEST_TARGET_CFLAGS@"
-config.clang = "@INTERCEPTION_TEST_TARGET_CC@"
-config.target_arch = "@INTERCEPTION_TEST_TARGET_ARCH@"
-config.target_lib = "@INTERCEPTION_TEST_TARGET_LIB@"
-config.target_lib_dir = "@INTERCEPTION_TEST_TARGET_LIB_DIR@"
-config.sources_dir = os.path.join("@COMPILER_RT_SOURCE_DIR@", "lib")
-
-# Load common config for all compiler-rt lit tests.
-lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")
-
-# Load tool-specific config that would do the real work.
-lit_config.load_config(config, "@INTERCEPTION_LIT_SOURCE_DIR@/lit.cfg")




More information about the llvm-commits mailing list