blob: 5f7ab862c78e23c3856105ec18720dcefdbea814 [file] [log] [blame]
Logan Chienf7015fd2012-03-18 01:19:37 +08001/*
2 * Copyright (C) 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 ART_SRC_COMPILER_LLVM_ELF_LOADER_H_
18#define ART_SRC_COMPILER_LLVM_ELF_LOADER_H_
19
20#include "globals.h"
21#include "object.h"
22
23#include <android/librsloader.h>
24#include <vector>
25
26namespace art {
27 class Method;
28}
29
30namespace art {
31namespace compiler_llvm {
32
33class ElfLoader {
34 public:
35 ~ElfLoader();
36
37 bool LoadElfAt(size_t elf_idx, const byte* addr, size_t size);
38
39 const void* GetMethodCodeAddr(size_t elf_idx, const Method* method) const;
40
41 const Method::InvokeStub* GetMethodInvokeStubAddr(size_t elf_idx,
42 const Method* method) const;
43
44 private:
45 const void* GetAddr(size_t elf_idx, const char* sym_name) const;
46
47 std::vector<RSExecRef> executables_;
48};
49
50
51} // namespace compiler_llvm
52} // namespace art
53
54#endif // ART_SRC_COMPILER_LLVM_ELF_LOADER_H_