raw_object.hh revision 3584:8c3cdb2c001c
11689SN/A/*
29437SAndreas.Sandberg@ARM.com * Copyright (c) 2006 The Regents of The University of Michigan
37855SAli.Saidi@ARM.com * All rights reserved.
47855SAli.Saidi@ARM.com *
57855SAli.Saidi@ARM.com * Redistribution and use in source and binary forms, with or without
67855SAli.Saidi@ARM.com * modification, are permitted provided that the following conditions are
77855SAli.Saidi@ARM.com * met: redistributions of source code must retain the above copyright
87855SAli.Saidi@ARM.com * notice, this list of conditions and the following disclaimer;
97855SAli.Saidi@ARM.com * redistributions in binary form must reproduce the above copyright
107855SAli.Saidi@ARM.com * notice, this list of conditions and the following disclaimer in the
117855SAli.Saidi@ARM.com * documentation and/or other materials provided with the distribution;
127855SAli.Saidi@ARM.com * neither the name of the copyright holders nor the names of its
137855SAli.Saidi@ARM.com * contributors may be used to endorse or promote products derived from
142316SN/A * this software without specific prior written permission.
151689SN/A *
161689SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
171689SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
181689SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
191689SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
201689SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
211689SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
221689SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
231689SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
241689SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
251689SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
261689SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
271689SN/A *
281689SN/A * Authors: Ali Saidi
291689SN/A */
301689SN/A
311689SN/A#ifndef __BASE_LOADER_RAW_OBJECT_HH__
321689SN/A#define __BASE_LOADER_RAW_OBJECT_HH__
331689SN/A
341689SN/A#include "base/loader/object_file.hh"
351689SN/A
361689SN/Aclass RawObject: public ObjectFile
371689SN/A{
381689SN/A  protected:
392665Ssaidi@eecs.umich.edu    RawObject(const std::string &_filename, int _fd, size_t _len,
402665Ssaidi@eecs.umich.edu              uint8_t *_data, Arch _arch, OpSys _opSys);
412756Sksewell@umich.edu  public:
421689SN/A    virtual ~RawObject() {}
431689SN/A
442292SN/A    virtual bool loadGlobalSymbols(SymbolTable *symtab);
452292SN/A    virtual bool loadLocalSymbols(SymbolTable *symtab);
461060SN/A
478230Snate@binkert.org    static ObjectFile *tryFile(const std::string &fname, int fd, size_t len,
488230Snate@binkert.org            uint8_t *data);
491461SN/A};
502292SN/A
512329SN/A
528229Snate@binkert.org
531060SN/A#endif // __BASE_LOADER_RAW_OBJECT_HH__
548737Skoansin.tan@gmail.com