| Zonr Chang | 0f9cad9 | 2012-04-13 14:35:45 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012, The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| Zonr Chang | c72c4dd | 2012-04-12 15:38:53 +0800 | [diff] [blame] | 17 | #ifndef OBJECT_LOADER_IMPL_H |
| 18 | #define OBJECT_LOADER_IMPL_H |
| Zonr Chang | 0f9cad9 | 2012-04-13 14:35:45 +0800 | [diff] [blame] | 19 | |
| 20 | #include <cstring> |
| Chris Wailes | 5e7d876 | 2014-07-25 18:02:32 -0700 | [diff] [blame^] | 21 | #include <vector> |
| Zonr Chang | 0f9cad9 | 2012-04-13 14:35:45 +0800 | [diff] [blame] | 22 | |
| Shih-wei Liao | 9795754 | 2012-07-22 15:42:53 -0700 | [diff] [blame] | 23 | #include "bcc/ExecutionEngine/ObjectLoader.h" |
| 24 | #include "bcc/Support/Log.h" |
| 25 | |
| Zonr Chang | 0f9cad9 | 2012-04-13 14:35:45 +0800 | [diff] [blame] | 26 | namespace bcc { |
| 27 | |
| 28 | class SymbolResolverInterface; |
| 29 | |
| 30 | class ObjectLoaderImpl { |
| 31 | public: |
| 32 | ObjectLoaderImpl() { } |
| 33 | |
| 34 | virtual bool load(const void *pMem, size_t pMemSize) = 0; |
| 35 | |
| 36 | virtual bool relocate(SymbolResolverInterface &pResolver) = 0; |
| 37 | |
| 38 | virtual bool prepareDebugImage(void *pDebugImg, size_t pDebugImgSize) = 0; |
| 39 | |
| 40 | virtual void *getSymbolAddress(const char *pName) const = 0; |
| 41 | |
| Shih-wei Liao | 9795754 | 2012-07-22 15:42:53 -0700 | [diff] [blame] | 42 | virtual size_t getSymbolSize(const char *pName) const = 0; |
| 43 | |
| Chris Wailes | 5e7d876 | 2014-07-25 18:02:32 -0700 | [diff] [blame^] | 44 | virtual bool getSymbolNameList(std::vector<const char *>& pNameList, |
| Shih-wei Liao | 9795754 | 2012-07-22 15:42:53 -0700 | [diff] [blame] | 45 | ObjectLoader::SymbolType pType) const = 0; |
| 46 | |
| Zonr Chang | 0f9cad9 | 2012-04-13 14:35:45 +0800 | [diff] [blame] | 47 | virtual ~ObjectLoaderImpl() { } |
| 48 | }; |
| 49 | |
| 50 | } // namespace bcc |
| 51 | |
| Zonr Chang | c72c4dd | 2012-04-12 15:38:53 +0800 | [diff] [blame] | 52 | #endif // OBJECT_LOADER_IMPL_H |