Revert "Fix relocation to look for symbols in local group"

This reverts commit fd2747bb585fc51b5ad56db09c0e9b66c7091a92.

Bug: 18222321
Bug: 18211780
Change-Id: I2d4ebab1e73b7277161af76b99f8249825b22d65
diff --git a/tests/libs/Android.build.dlopen_check_order_dlsym.mk b/tests/libs/Android.build.dlopen_check_order_dlsym.mk
deleted file mode 100644
index 73d8c1a..0000000
--- a/tests/libs/Android.build.dlopen_check_order_dlsym.mk
+++ /dev/null
@@ -1,90 +0,0 @@
-#
-# Copyright (C) 2012 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# -----------------------------------------------------------------------------
-# Libraries used by dlfcn tests to verify correct load order:
-# libtest_check_order_2_right.so
-# -----------------------------------------------------------------------------
-libtest_check_order_dlsym_2_right_src_files := \
-    dlopen_check_order_dlsym_answer.cpp
-
-libtest_check_order_dlsym_2_right_cflags := -D__ANSWER=42
-module := libtest_check_order_dlsym_2_right
-include $(LOCAL_PATH)/Android.build.testlib.mk
-
-# -----------------------------------------------------------------------------
-# libtest_check_order_a.so
-# -----------------------------------------------------------------------------
-libtest_check_order_dlsym_a_src_files := \
-    dlopen_check_order_dlsym_answer.cpp
-
-libtest_check_order_dlsym_a_cflags := -D__ANSWER=1
-module := libtest_check_order_dlsym_a
-include $(LOCAL_PATH)/Android.build.testlib.mk
-
-# -----------------------------------------------------------------------------
-# libtest_check_order_b.so
-# -----------------------------------------------------------------------------
-libtest_check_order_dlsym_b_src_files := \
-    dlopen_check_order_dlsym_answer.cpp
-
-libtest_check_order_dlsym_b_cflags := -D__ANSWER=2 -D__ANSWER2=43
-module := libtest_check_order_dlsym_b
-include $(LOCAL_PATH)/Android.build.testlib.mk
-
-# -----------------------------------------------------------------------------
-# libtest_check_order_c.so
-# -----------------------------------------------------------------------------
-libtest_check_order_dlsym_3_c_src_files := \
-    dlopen_check_order_dlsym_answer.cpp
-
-libtest_check_order_dlsym_3_c_cflags := -D__ANSWER=3
-module := libtest_check_order_dlsym_3_c
-include $(LOCAL_PATH)/Android.build.testlib.mk
-
-# -----------------------------------------------------------------------------
-# libtest_check_order_d.so
-# -----------------------------------------------------------------------------
-libtest_check_order_dlsym_d_src_files := \
-   dlopen_check_order_dlsym_answer.cpp
-
-libtest_check_order_dlsym_d_shared_libraries := libtest_check_order_dlsym_b
-libtest_check_order_dlsym_d_cflags := -D__ANSWER=4 -D__ANSWER2=4
-module := libtest_check_order_dlsym_d
-include $(LOCAL_PATH)/Android.build.testlib.mk
-
-# -----------------------------------------------------------------------------
-# libtest_check_order_left.so
-# -----------------------------------------------------------------------------
-libtest_check_order_dlsym_1_left_src_files := \
-    empty.cpp
-
-libtest_check_order_dlsym_1_left_shared_libraries := libtest_check_order_dlsym_a libtest_check_order_dlsym_b
-
-module := libtest_check_order_dlsym_1_left
-include $(LOCAL_PATH)/Android.build.testlib.mk
-
-# -----------------------------------------------------------------------------
-# libtest_check_order.so
-# -----------------------------------------------------------------------------
-libtest_check_order_dlsym_src_files := \
-    empty.cpp
-
-libtest_check_order_dlsym_shared_libraries := libtest_check_order_dlsym_1_left \
-  libtest_check_order_dlsym_2_right libtest_check_order_dlsym_3_c
-
-module := libtest_check_order_dlsym
-include $(LOCAL_PATH)/Android.build.testlib.mk
diff --git a/tests/libs/Android.build.dlopen_check_order_reloc_main_executable.mk b/tests/libs/Android.build.dlopen_check_order_reloc_main_executable.mk
deleted file mode 100644
index 639696b..0000000
--- a/tests/libs/Android.build.dlopen_check_order_reloc_main_executable.mk
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# Copyright (C) 2012 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# -----------------------------------------------------------------------------
-# Libraries used by dlfcn tests to verify correct relocation order:
-# libtest_check_order_reloc_root*.so
-# -----------------------------------------------------------------------------
-
-
-# -----------------------------------------------------------------------------
-# ..._1.so - empty
-# -----------------------------------------------------------------------------
-libtest_check_order_reloc_root_1_src_files := \
-    empty.cpp
-
-
-module := libtest_check_order_reloc_root_1
-include $(LOCAL_PATH)/Android.build.testlib.mk
-
-
-# -----------------------------------------------------------------------------
-# ..._2.so - this one has the incorrect answer
-# -----------------------------------------------------------------------------
-libtest_check_order_reloc_root_2_src_files := \
-    dlopen_check_order_reloc_root_answer_impl.cpp
-
-libtest_check_order_reloc_root_2_cflags := -D__ANSWER=2
-
-module := libtest_check_order_reloc_root_2
-include $(LOCAL_PATH)/Android.build.testlib.mk
-
-# -----------------------------------------------------------------------------
-# libtest_check_order_reloc_root.so <- implements get_answer3()
-# -----------------------------------------------------------------------------
-libtest_check_order_reloc_root_src_files := \
-    dlopen_check_order_reloc_root_answer.cpp
-
-libtest_check_order_reloc_root_shared_libraries := \
-    libtest_check_order_reloc_root_1 \
-    libtest_check_order_reloc_root_2
-
-module := libtest_check_order_reloc_root
-include $(LOCAL_PATH)/Android.build.testlib.mk
diff --git a/tests/libs/Android.build.dlopen_check_order_reloc_siblings.mk b/tests/libs/Android.build.dlopen_check_order_reloc_siblings.mk
deleted file mode 100644
index 0f1a2b4..0000000
--- a/tests/libs/Android.build.dlopen_check_order_reloc_siblings.mk
+++ /dev/null
@@ -1,133 +0,0 @@
-#
-# Copyright (C) 2014 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# -----------------------------------------------------------------------------
-# Libraries used by dlfcn tests to verify correct relocation order:
-# libtest_check_order_reloc_siblings*.so
-# -----------------------------------------------------------------------------
-
-# -----------------------------------------------------------------------------
-# ..._1.so - empty
-# -----------------------------------------------------------------------------
-libtest_check_order_reloc_siblings_1_src_files := \
-    empty.cpp
-
-libtest_check_order_reloc_siblings_1_shared_libraries := \
-    libtest_check_order_reloc_siblings_a \
-    libtest_check_order_reloc_siblings_b
-
-module := libtest_check_order_reloc_siblings_1
-include $(LOCAL_PATH)/Android.build.testlib.mk
-
-
-# -----------------------------------------------------------------------------
-# ..._2.so - empty
-# -----------------------------------------------------------------------------
-libtest_check_order_reloc_siblings_2_src_files := \
-    empty.cpp
-
-libtest_check_order_reloc_siblings_2_shared_libraries := \
-    libtest_check_order_reloc_siblings_c \
-    libtest_check_order_reloc_siblings_d
-
-module := libtest_check_order_reloc_siblings_2
-include $(LOCAL_PATH)/Android.build.testlib.mk
-
-# -----------------------------------------------------------------------------
-# ..._3.so - get_answer2();
-# -----------------------------------------------------------------------------
-libtest_check_order_reloc_siblings_3_src_files := \
-    dlopen_check_order_reloc_nephew_answer.cpp
-
-libtest_check_order_reloc_siblings_3_shared_libraries := \
-    libtest_check_order_reloc_siblings_e \
-    libtest_check_order_reloc_siblings_f
-
-module := libtest_check_order_reloc_siblings_3
-include $(LOCAL_PATH)/Android.build.testlib.mk
-
-# -----------------------------------------------------------------------------
-# ..._a.so <- correct impl
-# -----------------------------------------------------------------------------
-libtest_check_order_reloc_siblings_a_src_files := \
-    dlopen_check_order_reloc_answer_impl.cpp
-
-libtest_check_order_reloc_siblings_a_cflags := -D__ANSWER=42
-module := libtest_check_order_reloc_siblings_a
-include $(LOCAL_PATH)/Android.build.testlib.mk
-
-# -----------------------------------------------------------------------------
-# ..._b.so
-# -----------------------------------------------------------------------------
-libtest_check_order_reloc_siblings_b_src_files := \
-    dlopen_check_order_reloc_answer_impl.cpp
-
-libtest_check_order_reloc_siblings_b_cflags := -D__ANSWER=1
-module := libtest_check_order_reloc_siblings_b
-include $(LOCAL_PATH)/Android.build.testlib.mk
-
-# -----------------------------------------------------------------------------
-# ..._c.so
-# -----------------------------------------------------------------------------
-libtest_check_order_reloc_siblings_c_src_files := \
-    dlopen_check_order_reloc_answer_impl.cpp
-
-libtest_check_order_reloc_siblings_c_cflags := -D__ANSWER=2
-module := libtest_check_order_reloc_siblings_c
-include $(LOCAL_PATH)/Android.build.testlib.mk
-
-# -----------------------------------------------------------------------------
-# ..._d.so
-# -----------------------------------------------------------------------------
-libtest_check_order_reloc_siblings_d_src_files := \
-    dlopen_check_order_reloc_answer_impl.cpp
-
-libtest_check_order_reloc_siblings_d_cflags := -D__ANSWER=3
-module := libtest_check_order_reloc_siblings_d
-include $(LOCAL_PATH)/Android.build.testlib.mk
-
-# -----------------------------------------------------------------------------
-# ..._e.so
-# -----------------------------------------------------------------------------
-libtest_check_order_reloc_siblings_e_src_files := \
-    dlopen_check_order_reloc_answer_impl.cpp
-
-libtest_check_order_reloc_siblings_e_cflags := -D__ANSWER=4
-module := libtest_check_order_reloc_siblings_e
-include $(LOCAL_PATH)/Android.build.testlib.mk
-
-# -----------------------------------------------------------------------------
-# ..._f.so <- get_answer()
-# -----------------------------------------------------------------------------
-libtest_check_order_reloc_siblings_f_src_files := \
-    dlopen_check_order_reloc_answer.cpp
-
-module := libtest_check_order_reloc_siblings_f
-include $(LOCAL_PATH)/Android.build.testlib.mk
-
-# -----------------------------------------------------------------------------
-# libtest_check_order_reloc_siblings.so
-# -----------------------------------------------------------------------------
-libtest_check_order_reloc_siblings_src_files := \
-    empty.cpp
-
-libtest_check_order_reloc_siblings_shared_libraries := \
-    libtest_check_order_reloc_siblings_1 \
-    libtest_check_order_reloc_siblings_2 \
-    libtest_check_order_reloc_siblings_3
-
-module := libtest_check_order_reloc_siblings
-include $(LOCAL_PATH)/Android.build.testlib.mk
diff --git a/tests/libs/Android.mk b/tests/libs/Android.mk
index 05e7113..175a635 100644
--- a/tests/libs/Android.mk
+++ b/tests/libs/Android.mk
@@ -21,9 +21,6 @@
 common_additional_dependencies := \
     $(LOCAL_PATH)/Android.mk \
     $(LOCAL_PATH)/Android.build.dlext_testzip.mk \
-    $(LOCAL_PATH)/Android.build.dlopen_check_order_dlsym.mk \
-    $(LOCAL_PATH)/Android.build.dlopen_check_order_reloc_siblings.mk \
-    $(LOCAL_PATH)/Android.build.dlopen_check_order_reloc_main_executable.mk \
     $(LOCAL_PATH)/Android.build.testlib.mk \
     $(TEST_PATH)/Android.build.mk
 
@@ -153,19 +150,79 @@
 include $(LOCAL_PATH)/Android.build.testlib.mk
 
 # -----------------------------------------------------------------------------
-# Build libtest_check_order_dlsym.so with its dependencies.
+# Libraries used by dlfcn tests to verify correct load order:
+# libtest_check_order_2_right.so
 # -----------------------------------------------------------------------------
-include $(LOCAL_PATH)/Android.build.dlopen_check_order_dlsym.mk
+libtest_check_order_2_right_src_files := \
+    dlopen_testlib_answer.cpp
+
+libtest_check_order_2_right_cflags := -D__ANSWER=42
+module := libtest_check_order_2_right
+include $(LOCAL_PATH)/Android.build.testlib.mk
 
 # -----------------------------------------------------------------------------
-# Build libtest_check_order_siblings.so with its dependencies.
+# libtest_check_order_a.so
 # -----------------------------------------------------------------------------
-include $(LOCAL_PATH)/Android.build.dlopen_check_order_reloc_siblings.mk
+libtest_check_order_a_src_files := \
+    dlopen_testlib_answer.cpp
+
+libtest_check_order_a_cflags := -D__ANSWER=1
+module := libtest_check_order_a
+include $(LOCAL_PATH)/Android.build.testlib.mk
 
 # -----------------------------------------------------------------------------
-# Build libtest_check_order_root.so with its dependencies.
+# libtest_check_order_b.so
 # -----------------------------------------------------------------------------
-include $(LOCAL_PATH)/Android.build.dlopen_check_order_reloc_main_executable.mk
+libtest_check_order_b_src_files := \
+    dlopen_testlib_answer.cpp
+
+libtest_check_order_b_cflags := -D__ANSWER=2 -D__ANSWER2=43
+module := libtest_check_order_b
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# libtest_check_order_c.so
+# -----------------------------------------------------------------------------
+libtest_check_order_3_c_src_files := \
+    dlopen_testlib_answer.cpp
+
+libtest_check_order_3_c_cflags := -D__ANSWER=3
+module := libtest_check_order_3_c
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# libtest_check_order_d.so
+# -----------------------------------------------------------------------------
+libtest_check_order_d_src_files := \
+   dlopen_testlib_answer.cpp
+
+libtest_check_order_d_shared_libraries := libtest_check_order_b
+libtest_check_order_d_cflags := -D__ANSWER=4 -D__ANSWER2=4
+module := libtest_check_order_d
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# libtest_check_order_left.so
+# -----------------------------------------------------------------------------
+libtest_check_order_1_left_src_files := \
+    empty.cpp
+
+libtest_check_order_1_left_shared_libraries := libtest_check_order_a libtest_check_order_b
+
+module := libtest_check_order_1_left
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
+# libtest_check_order.so
+# -----------------------------------------------------------------------------
+libtest_check_order_src_files := \
+    empty.cpp
+
+libtest_check_order_shared_libraries := libtest_check_order_1_left \
+  libtest_check_order_2_right libtest_check_order_3_c
+
+module := libtest_check_order
+include $(LOCAL_PATH)/Android.build.testlib.mk
 
 # -----------------------------------------------------------------------------
 # Library with dependency loop used by dlfcn tests
diff --git a/tests/libs/dlopen_check_order_reloc_answer.cpp b/tests/libs/dlopen_check_order_reloc_answer.cpp
deleted file mode 100644
index 036670b..0000000
--- a/tests/libs/dlopen_check_order_reloc_answer.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-extern "C" int __attribute__((weak)) check_order_reloc_get_answer_impl() {
-  return 0;
-}
-
-extern "C" int check_order_reloc_get_answer() {
-  return check_order_reloc_get_answer_impl();
-}
diff --git a/tests/libs/dlopen_check_order_reloc_answer_impl.cpp b/tests/libs/dlopen_check_order_reloc_answer_impl.cpp
deleted file mode 100644
index 324b905..0000000
--- a/tests/libs/dlopen_check_order_reloc_answer_impl.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-extern "C" int check_order_reloc_get_answer_impl() {
-  return __ANSWER;
-}
diff --git a/tests/libs/dlopen_check_order_reloc_nephew_answer.cpp b/tests/libs/dlopen_check_order_reloc_nephew_answer.cpp
deleted file mode 100644
index 065d1be..0000000
--- a/tests/libs/dlopen_check_order_reloc_nephew_answer.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-extern "C" int check_order_reloc_get_answer_impl();
-
-extern "C" int check_order_reloc_nephew_get_answer() {
-  return check_order_reloc_get_answer_impl();
-}
diff --git a/tests/libs/dlopen_check_order_reloc_root_answer.cpp b/tests/libs/dlopen_check_order_reloc_root_answer.cpp
deleted file mode 100644
index b21abd7..0000000
--- a/tests/libs/dlopen_check_order_reloc_root_answer.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-extern "C" int check_order_reloc_root_get_answer_impl();
-
-extern "C" int check_order_reloc_root_get_answer() {
-  return check_order_reloc_root_get_answer_impl();
-}
diff --git a/tests/libs/dlopen_check_order_reloc_root_answer_impl.cpp b/tests/libs/dlopen_check_order_reloc_root_answer_impl.cpp
deleted file mode 100644
index 25fb9ac..0000000
--- a/tests/libs/dlopen_check_order_reloc_root_answer_impl.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-extern "C" int check_order_reloc_root_get_answer_impl() {
-  return __ANSWER;
-}
diff --git a/tests/libs/dlopen_check_order_dlsym_answer.cpp b/tests/libs/dlopen_testlib_answer.cpp
similarity index 87%
rename from tests/libs/dlopen_check_order_dlsym_answer.cpp
rename to tests/libs/dlopen_testlib_answer.cpp
index 2ae6cf7..a4d7504 100644
--- a/tests/libs/dlopen_check_order_dlsym_answer.cpp
+++ b/tests/libs/dlopen_testlib_answer.cpp
@@ -14,12 +14,12 @@
  * limitations under the License.
  */
 
-extern "C" int check_order_dlsym_get_answer() {
+extern "C" int dlopen_test_get_answer() {
   return __ANSWER;
 }
 
 #ifdef __ANSWER2
-extern "C" int check_order_dlsym_get_answer2() {
+extern "C" int dlopen_test_get_answer2() {
   return __ANSWER2;
 }
 #endif