/* * Copyright (C) 2019 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. */ #pragma once #include #include #include // Define basic data structure for linker configuration struct Namespace; struct Link { Namespace *from, *to; bool allow_all_shared; std::vector shared_libs; }; struct Namespace { std::string name; bool is_isolated; bool is_visible; std::vector search_path; std::vector permitted_path; std::vector asan_search_path; std::vector asan_permitted_path; std::map links; std::vector allowed_libs; }; struct Section { std::string name; std::vector dirs; std::map namespaces; }; struct Configuration { std::map sections; }; template bool MapContainsKey(const std::map& map, K key) { return map.find(key) != map.end(); }