blob: 95d4ab4e44ff57db53610ae9b4ee023679916bac [file] [log] [blame]
Zonr Chang0f9cad92012-04-13 14:35:45 +08001/*
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 Changc72c4dd2012-04-12 15:38:53 +080017#ifndef OBJECT_LOADER_IMPL_H
18#define OBJECT_LOADER_IMPL_H
Zonr Chang0f9cad92012-04-13 14:35:45 +080019
20#include <cstring>
Chris Wailes5e7d8762014-07-25 18:02:32 -070021#include <vector>
Zonr Chang0f9cad92012-04-13 14:35:45 +080022
Shih-wei Liao97957542012-07-22 15:42:53 -070023#include "bcc/ExecutionEngine/ObjectLoader.h"
24#include "bcc/Support/Log.h"
25
Zonr Chang0f9cad92012-04-13 14:35:45 +080026namespace bcc {
27
28class SymbolResolverInterface;
29
30class ObjectLoaderImpl {
31public:
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 Liao97957542012-07-22 15:42:53 -070042 virtual size_t getSymbolSize(const char *pName) const = 0;
43
Chris Wailes5e7d8762014-07-25 18:02:32 -070044 virtual bool getSymbolNameList(std::vector<const char *>& pNameList,
Shih-wei Liao97957542012-07-22 15:42:53 -070045 ObjectLoader::SymbolType pType) const = 0;
46
Zonr Chang0f9cad92012-04-13 14:35:45 +080047 virtual ~ObjectLoaderImpl() { }
48};
49
50} // namespace bcc
51
Zonr Changc72c4dd2012-04-12 15:38:53 +080052#endif // OBJECT_LOADER_IMPL_H