ecoff_object.hh revision 12
1955SN/A/* 2955SN/A * Copyright (c) 2003 The Regents of The University of Michigan 31762SN/A * All rights reserved. 4955SN/A * 5955SN/A * Redistribution and use in source and binary forms, with or without 6955SN/A * modification, are permitted provided that the following conditions are 7955SN/A * met: redistributions of source code must retain the above copyright 8955SN/A * notice, this list of conditions and the following disclaimer; 9955SN/A * redistributions in binary form must reproduce the above copyright 10955SN/A * notice, this list of conditions and the following disclaimer in the 11955SN/A * documentation and/or other materials provided with the distribution; 12955SN/A * neither the name of the copyright holders nor the names of its 13955SN/A * contributors may be used to endorse or promote products derived from 14955SN/A * this software without specific prior written permission. 15955SN/A * 16955SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17955SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18955SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19955SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20955SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21955SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22955SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23955SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24955SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25955SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26955SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27955SN/A */ 282665Ssaidi@eecs.umich.edu 294762Snate@binkert.org#ifndef __ECOFF_OBJECT_HH__ 30955SN/A#define __ECOFF_OBJECT_HH__ 315522Snate@binkert.org 326143Snate@binkert.org#include "object_file.hh" 334762Snate@binkert.org 345522Snate@binkert.org// forward decls: avoid including exec_ecoff.h here 35955SN/Astruct ecoff_exechdr; 365522Snate@binkert.orgstruct ecoff_filehdr; 37955SN/Astruct ecoff_aouthdr; 385522Snate@binkert.org 394202Sbinkertn@umich.educlass EcoffObject : public ObjectFile 405742Snate@binkert.org{ 41955SN/A protected: 424381Sbinkertn@umich.edu ecoff_exechdr *execHdr; 434381Sbinkertn@umich.edu ecoff_filehdr *fileHdr; 448334Snate@binkert.org ecoff_aouthdr *aoutHdr; 45955SN/A 46955SN/A EcoffObject(const std::string &_filename, int _fd, 474202Sbinkertn@umich.edu size_t _len, uint8_t *_data); 48955SN/A 494382Sbinkertn@umich.edu public: 504382Sbinkertn@umich.edu virtual ~EcoffObject() {} 514382Sbinkertn@umich.edu 526654Snate@binkert.org virtual bool loadSections(FunctionalMemory *mem, 535517Snate@binkert.org bool loadPhys = false); 548614Sgblack@eecs.umich.edu virtual bool loadGlobalSymbols(SymbolTable *symtab); 557674Snate@binkert.org virtual bool loadLocalSymbols(SymbolTable *symtab); 566143Snate@binkert.org 576143Snate@binkert.org static ObjectFile *tryFile(const std::string &fname, int fd, 586143Snate@binkert.org size_t len, uint8_t *data); 598233Snate@binkert.org}; 608233Snate@binkert.org 618233Snate@binkert.org#endif // __ECOFF_OBJECT_HH__ 628233Snate@binkert.org