branch_to_sub issue resolved.
turn off sdk.

Change-Id: I1a6def700a2333ca8612138dadb610180d3dcbf3
diff --git a/Android.mk b/Android.mk
index f0d15a1..218ec9a 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,5 +1,6 @@
 # Only use this on the device or emulator.
 ifneq ($(TARGET_SIMULATOR),true)
+ifneq ($(TARGET_PRODUCT),sdk)
 
 LOCAL_PATH := $(call my-dir)
 LLVM_ROOT_PATH := external/llvm/llvm
@@ -114,4 +115,5 @@
 
 include $(call all-makefiles-under,$(LOCAL_PATH))
 
-endif
+endif # TARGET_PRODUCT != sdk
+endif # TARGET_SIMULATOR != true
diff --git a/bcc.cpp b/bcc.cpp
index d27ff36..02cd867 100644
--- a/bcc.cpp
+++ b/bcc.cpp
@@ -1559,28 +1559,27 @@
           {
             llvm::Function* F = (llvm::Function*) V;
 
+            /* If we have code, go ahead and return that. */
+            if(void* ResultPtr = GetPointerToGlobalIfAvailable(F))
+              return ResultPtr;
+
+            if(void* FnStub = GetLazyFunctionStubIfAvailable(F))
+              /*
+               * Return the function stub if it's already created.
+               * We do this first so that:
+               *   we're returning the same address for the function
+               *   as any previous call.
+               *
+               *  TODO: Yes, this is wrong. The lazy stub isn't guaranteed
+               *  to be close enough to call.
+               */
+              return FnStub;
+
             /*
              * If we know the target can handle arbitrary-distance calls, try to
              *  return a direct pointer.
              */
             if(!MayNeedFarStub) {
-              /* If we have code, go ahead and return that. */
-              if(void* ResultPtr = GetPointerToGlobalIfAvailable(F))
-                return ResultPtr;
-
-              void* FnStub = GetLazyFunctionStubIfAvailable(F);
-              if(FnStub)
-                /*
-                 * Return the function stub if it's already created.
-                 * We do this first so that:
-                 *   we're returning the same address for the function
-                 *   as any previous call.
-                 *
-                 *  TODO: Yes, this is wrong. The lazy stub isn't guaranteed
-                 *  to be close enough to call.
-                 */
-                return FnStub;
-
               /*
                * x86_64 architecture may encounter the bug
                *  http://hlvm.llvm.org/bugs/show_bug.cgi?id=5201