blob: 37766fbdb01b26a6fae701a7b6202e7b1f08a880 [file] [log] [blame]
Zonr Changbf6498e2012-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
17#ifndef BCC_EXECUTION_ENGINE_ELF_OBJECT_LOADER_IMPL_H
18#define BCC_EXECUTION_ENGINE_ELF_OBJECT_LOADER_IMPL_H
19
20#include "ObjectLoaderImpl.h"
21
22// ELFObject and ELFSectionSymTab comes from librsloader. They're both
23// defined under global scope without a namespace enclosed.
24template <unsigned Bitwidth>
25class ELFObject;
26
27template <unsigned Bitwidth>
28class ELFSectionSymTab;
29
30namespace bcc {
31
32class ELFObjectLoaderImpl : public ObjectLoaderImpl {
33private:
34 ELFObject<32> *mObject;
35 ELFSectionSymTab<32> *mSymTab;
36
37public:
38 ELFObjectLoaderImpl() : ObjectLoaderImpl(), mObject(NULL), mSymTab(NULL) { }
39
40 virtual bool load(const void *pMem, size_t pMemSize);
41
42 virtual bool relocate(SymbolResolverInterface &pResolver);
43
44 virtual bool prepareDebugImage(void *pDebugImg, size_t pDebugImgSize);
45
46 virtual void *getSymbolAddress(const char *pName) const;
47
48 ~ELFObjectLoaderImpl();
49};
50
51} // end namespace bcc
52
53#endif // BCC_EXECUTION_ENGINE_ELF_OBJECT_LOADER_IMPL_H