diff options
author | Dmitriy Ivanov <dimitry@google.com> | 2014-11-03 21:14:07 -0800 |
---|---|---|
committer | Dmitriy Ivanov <dimitry@google.com> | 2014-11-03 22:15:08 -0800 |
commit | f947be2889639defc6424b1813ccc779528b7598 (patch) | |
tree | a4e2df0805ec9b33aec2ad494678415ce0ec835f /tests/dl_test.cpp | |
parent | 494bee796aa60131981308493e0e295493537e12 (diff) | |
download | android_bionic-f947be2889639defc6424b1813ccc779528b7598.tar.gz android_bionic-f947be2889639defc6424b1813ccc779528b7598.tar.bz2 android_bionic-f947be2889639defc6424b1813ccc779528b7598.zip |
Revert "Fix symbol lookup order during relocation"
This reverts commit 976402cca13a1f4f3aa988fd301575e134ef5f2c.
Bug: 18222321
Bug: 18211780
Change-Id: Iafdd3d843db7b1cf288be9a0232022816622c944
Diffstat (limited to 'tests/dl_test.cpp')
-rw-r--r-- | tests/dl_test.cpp | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/tests/dl_test.cpp b/tests/dl_test.cpp deleted file mode 100644 index 74c7b510f..000000000 --- a/tests/dl_test.cpp +++ /dev/null @@ -1,72 +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. - */ - -#include <gtest/gtest.h> - -#include <dlfcn.h> -#include <libgen.h> -#include <limits.h> -#include <stdio.h> -#include <stdint.h> - -#include <string> - -extern "C" int main_global_default_serial() { - return 3370318; -} - -extern "C" int main_global_protected_serial() { - return 2716057; -} - -// The following functions are defined in DT_NEEDED -// libdl_preempt_test.so library. - -// This one calls main_global_default_serial -extern "C" int main_global_default_get_serial(); - -// This one calls main_global_protected_serial -extern "C" int main_global_protected_get_serial(); - -// This one calls lib_global_default_serial -extern "C" int lib_global_default_get_serial(); - -// This one calls lib_global_protected_serial -extern "C" int lib_global_protected_get_serial(); - -// This test verifies that the global default function -// main_global_default_serial() is preempted by -// the function defined above. -TEST(dl, main_preempts_global_default) { - ASSERT_EQ(3370318, main_global_default_get_serial()); -} - -// This one makes sure that the global protected -// symbols do not get preempted -TEST(dl, main_does_not_preempt_global_protected) { - ASSERT_EQ(3370318, main_global_protected_get_serial()); -} - -// check same things for lib -TEST(dl, lib_preempts_global_default) { - ASSERT_EQ(3370318, lib_global_default_get_serial()); -} - -TEST(dl, lib_does_not_preempt_global_protected) { - ASSERT_EQ(3370318, lib_global_protected_get_serial()); -} - -// TODO: Add tests for LD_PRELOADs |