blob: acec531b6af347e1438a0953fa364b3e8da63d22 [file] [log] [blame]
Brian Carlstrom700c8d32012-11-05 10:42:02 -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
Brian Carlstrom700c8d32012-11-05 10:42:02 -080017#include "elf_writer.h"
18#include "os.h"
19
Ian Rogers1212a022013-03-04 10:48:41 -080020namespace art {
21class CompilerDriver;
Brian Carlstrom265091e2013-01-30 14:08:26 -080022class DexFile;
Ian Rogers1212a022013-03-04 10:48:41 -080023} // namespace art
24
25extern "C" bool WriteElf(art::CompilerDriver& driver,
Brian Carlstrom3f47c122013-03-07 00:02:40 -080026 const std::string& android_root,
Brian Carlstrom265091e2013-01-30 14:08:26 -080027 bool is_host,
28 const std::vector<const art::DexFile*>& dex_files,
Brian Carlstrom700c8d32012-11-05 10:42:02 -080029 std::vector<uint8_t>& oat_contents,
Brian Carlstrom265091e2013-01-30 14:08:26 -080030 art::File* file)
31 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
Brian Carlstrom3f47c122013-03-07 00:02:40 -080032 return art::ElfWriter::Create(file, oat_contents, dex_files, android_root, is_host, driver);
Brian Carlstrom700c8d32012-11-05 10:42:02 -080033}
34extern "C" bool FixupElf(art::File* file, uintptr_t oat_data_begin) {
35 return art::ElfWriter::Fixup(file, oat_data_begin);
36}
37extern "C" void GetOatElfInformation(art::File* file,
38 size_t& oat_loaded_size,
39 size_t& oat_data_offset) {
40 art::ElfWriter::GetOatElfInformation(file, oat_loaded_size, oat_data_offset);
41}
Brian Carlstrom265091e2013-01-30 14:08:26 -080042extern "C" bool StripElf(art::File* file) {
43 return art::ElfWriter::Strip(file);
44}