aout_object.hh revision 1762
14166Sgblack@eecs.umich.edu/*
210554Salexandru.dutu@amd.com * Copyright (c) 2003-2005 The Regents of The University of Michigan
37087Snate@binkert.org * All rights reserved.
47087Snate@binkert.org *
57087Snate@binkert.org * Redistribution and use in source and binary forms, with or without
67087Snate@binkert.org * modification, are permitted provided that the following conditions are
77087Snate@binkert.org * met: redistributions of source code must retain the above copyright
87087Snate@binkert.org * notice, this list of conditions and the following disclaimer;
97087Snate@binkert.org * redistributions in binary form must reproduce the above copyright
107087Snate@binkert.org * notice, this list of conditions and the following disclaimer in the
117087Snate@binkert.org * documentation and/or other materials provided with the distribution;
127087Snate@binkert.org * neither the name of the copyright holders nor the names of its
137087Snate@binkert.org * contributors may be used to endorse or promote products derived from
147087Snate@binkert.org * this software without specific prior written permission.
154166Sgblack@eecs.umich.edu *
164166Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
174166Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
184166Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
194166Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
204166Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
214166Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
224166Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
234166Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
244166Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
254166Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
264166Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
274166Sgblack@eecs.umich.edu */
284166Sgblack@eecs.umich.edu
294166Sgblack@eecs.umich.edu#ifndef __AOUT_OBJECT_HH__
304166Sgblack@eecs.umich.edu#define __AOUT_OBJECT_HH__
314166Sgblack@eecs.umich.edu
324166Sgblack@eecs.umich.edu#include "base/loader/object_file.hh"
334166Sgblack@eecs.umich.edu
344166Sgblack@eecs.umich.edu// forward decls: avoid including exec_aout.h here
354166Sgblack@eecs.umich.edustruct aout_exechdr;
364166Sgblack@eecs.umich.edu
374166Sgblack@eecs.umich.educlass AoutObject : public ObjectFile
384166Sgblack@eecs.umich.edu{
394166Sgblack@eecs.umich.edu  protected:
404166Sgblack@eecs.umich.edu    aout_exechdr *execHdr;
414166Sgblack@eecs.umich.edu
424166Sgblack@eecs.umich.edu    AoutObject(const std::string &_filename, int _fd,
434166Sgblack@eecs.umich.edu               size_t _len, uint8_t *_data,
444166Sgblack@eecs.umich.edu               Arch _arch, OpSys _opSys);
458229Snate@binkert.org
468229Snate@binkert.org  public:
474166Sgblack@eecs.umich.edu    virtual ~AoutObject() {}
484166Sgblack@eecs.umich.edu
4910554Salexandru.dutu@amd.com    virtual bool loadSections(FunctionalMemory *mem,
504166Sgblack@eecs.umich.edu                              bool loadPhys = false);
518229Snate@binkert.org    virtual bool loadGlobalSymbols(SymbolTable *symtab);
524166Sgblack@eecs.umich.edu    virtual bool loadLocalSymbols(SymbolTable *symtab);
534166Sgblack@eecs.umich.edu
545004Sgblack@eecs.umich.edu    static ObjectFile *tryFile(const std::string &fname, int fd,
554166Sgblack@eecs.umich.edu                               size_t len, uint8_t *data);
568232Snate@binkert.org};
5710554Salexandru.dutu@amd.com
584166Sgblack@eecs.umich.edu#endif // __AOUT_OBJECT_HH__
594434Ssaidi@eecs.umich.edu