10f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang/* 20f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang * Copyright 2012, The Android Open Source Project 30f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang * 40f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang * Licensed under the Apache License, Version 2.0 (the "License"); 50f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang * you may not use this file except in compliance with the License. 60f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang * You may obtain a copy of the License at 70f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang * 80f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang * http://www.apache.org/licenses/LICENSE-2.0 90f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang * 100f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang * Unless required by applicable law or agreed to in writing, software 110f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang * distributed under the License is distributed on an "AS IS" BASIS, 120f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 130f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang * See the License for the specific language governing permissions and 140f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang * limitations under the License. 150f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang */ 160f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang 17c72c4ddfcd79c74f70713da91a69569451b5c19eZonr Chang#ifndef OBJECT_LOADER_IMPL_H 18c72c4ddfcd79c74f70713da91a69569451b5c19eZonr Chang#define OBJECT_LOADER_IMPL_H 190f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang 200f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang#include <cstring> 210f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang 229795754a34648d962f00ced51183b759b9eaf2b2Shih-wei Liao#include "bcc/ExecutionEngine/ObjectLoader.h" 239795754a34648d962f00ced51183b759b9eaf2b2Shih-wei Liao#include "bcc/Support/Log.h" 249795754a34648d962f00ced51183b759b9eaf2b2Shih-wei Liao 259795754a34648d962f00ced51183b759b9eaf2b2Shih-wei Liao#include <utils/Vector.h> 269795754a34648d962f00ced51183b759b9eaf2b2Shih-wei Liao 270f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Changnamespace bcc { 280f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang 290f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Changclass SymbolResolverInterface; 300f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang 310f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Changclass ObjectLoaderImpl { 320f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Changpublic: 330f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang ObjectLoaderImpl() { } 340f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang 350f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang virtual bool load(const void *pMem, size_t pMemSize) = 0; 360f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang 370f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang virtual bool relocate(SymbolResolverInterface &pResolver) = 0; 380f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang 390f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang virtual bool prepareDebugImage(void *pDebugImg, size_t pDebugImgSize) = 0; 400f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang 410f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang virtual void *getSymbolAddress(const char *pName) const = 0; 420f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang 439795754a34648d962f00ced51183b759b9eaf2b2Shih-wei Liao virtual size_t getSymbolSize(const char *pName) const = 0; 449795754a34648d962f00ced51183b759b9eaf2b2Shih-wei Liao 459795754a34648d962f00ced51183b759b9eaf2b2Shih-wei Liao virtual bool getSymbolNameList(android::Vector<const char *>& pNameList, 469795754a34648d962f00ced51183b759b9eaf2b2Shih-wei Liao ObjectLoader::SymbolType pType) const = 0; 479795754a34648d962f00ced51183b759b9eaf2b2Shih-wei Liao 480f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang virtual ~ObjectLoaderImpl() { } 490f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang}; 500f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang 510f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang} // namespace bcc 520f9cad99f9e3c4db42e9836cc0e316c3a84448f5Zonr Chang 53c72c4ddfcd79c74f70713da91a69569451b5c19eZonr Chang#endif // OBJECT_LOADER_IMPL_H 54