ecoff_object.hh revision 360
12568SN/A/* 210723Sandreas.hansson@arm.com * Copyright (c) 2003 The Regents of The University of Michigan 38668Sgeoffrey.blake@arm.com * All rights reserved. 48668Sgeoffrey.blake@arm.com * 58668Sgeoffrey.blake@arm.com * Redistribution and use in source and binary forms, with or without 68668Sgeoffrey.blake@arm.com * modification, are permitted provided that the following conditions are 78668Sgeoffrey.blake@arm.com * met: redistributions of source code must retain the above copyright 88668Sgeoffrey.blake@arm.com * notice, this list of conditions and the following disclaimer; 98668Sgeoffrey.blake@arm.com * redistributions in binary form must reproduce the above copyright 108668Sgeoffrey.blake@arm.com * notice, this list of conditions and the following disclaimer in the 118668Sgeoffrey.blake@arm.com * documentation and/or other materials provided with the distribution; 128668Sgeoffrey.blake@arm.com * neither the name of the copyright holders nor the names of its 138668Sgeoffrey.blake@arm.com * contributors may be used to endorse or promote products derived from 142568SN/A * this software without specific prior written permission. 157636Ssteve.reinhardt@amd.com * 162568SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 172568SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 182568SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 192568SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 202568SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 212568SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 222568SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 232568SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 242568SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 252568SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 262568SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272568SN/A */ 282568SN/A 292568SN/A#ifndef __ECOFF_OBJECT_HH__ 302568SN/A#define __ECOFF_OBJECT_HH__ 312568SN/A 322568SN/A#include "base/loader/object_file.hh" 332568SN/A 342568SN/A// forward decls: avoid including exec_ecoff.h here 352568SN/Astruct ecoff_exechdr; 362568SN/Astruct ecoff_filehdr; 372568SN/Astruct ecoff_aouthdr; 382568SN/A 392568SN/Aclass EcoffObject : public ObjectFile 402665Ssaidi@eecs.umich.edu{ 412665Ssaidi@eecs.umich.edu protected: 422665Ssaidi@eecs.umich.edu ecoff_exechdr *execHdr; 432568SN/A ecoff_filehdr *fileHdr; 442568SN/A ecoff_aouthdr *aoutHdr; 452568SN/A 462568SN/A EcoffObject(const std::string &_filename, int _fd, 472568SN/A size_t _len, uint8_t *_data, 482568SN/A Arch _arch, OpSys _opSys); 492568SN/A 503260Ssaidi@eecs.umich.edu public: 518229Snate@binkert.org virtual ~EcoffObject() {} 523260Ssaidi@eecs.umich.edu 538229Snate@binkert.org virtual bool loadSections(FunctionalMemory *mem, 545314Sstever@gmail.com bool loadPhys = false); 552590SN/A virtual bool loadGlobalSymbols(SymbolTable *symtab); 563348Sbinkertn@umich.edu virtual bool loadLocalSymbols(SymbolTable *symtab); 572568SN/A 582568SN/A static ObjectFile *tryFile(const std::string &fname, int fd, 595735Snate@binkert.org size_t len, uint8_t *data); 605735Snate@binkert.org}; 614022Sstever@eecs.umich.edu 624022Sstever@eecs.umich.edu#endif // __ECOFF_OBJECT_HH__ 634022Sstever@eecs.umich.edu