aout_object.hh revision 1762
11689SN/A/*
21689SN/A * Copyright (c) 2003-2005 The Regents of The University of Michigan
31689SN/A * All rights reserved.
41689SN/A *
51689SN/A * Redistribution and use in source and binary forms, with or without
61689SN/A * modification, are permitted provided that the following conditions are
71689SN/A * met: redistributions of source code must retain the above copyright
81689SN/A * notice, this list of conditions and the following disclaimer;
91689SN/A * redistributions in binary form must reproduce the above copyright
101689SN/A * notice, this list of conditions and the following disclaimer in the
111689SN/A * documentation and/or other materials provided with the distribution;
121689SN/A * neither the name of the copyright holders nor the names of its
131689SN/A * contributors may be used to endorse or promote products derived from
141689SN/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.
272665Ssaidi@eecs.umich.edu */
282665Ssaidi@eecs.umich.edu
292756Sksewell@umich.edu#ifndef __AOUT_OBJECT_HH__
301689SN/A#define __AOUT_OBJECT_HH__
311689SN/A
322325SN/A#include "base/loader/object_file.hh"
332325SN/A
341060SN/A// forward decls: avoid including exec_aout.h here
351060SN/Astruct aout_exechdr;
361060SN/A
372292SN/Aclass AoutObject : public ObjectFile
382292SN/A{
391681SN/A  protected:
401060SN/A    aout_exechdr *execHdr;
412669Sktlim@umich.edu
421060SN/A    AoutObject(const std::string &_filename, int _fd,
431060SN/A               size_t _len, uint8_t *_data,
441858SN/A               Arch _arch, OpSys _opSys);
452325SN/A
461717SN/A  public:
472683Sktlim@umich.edu    virtual ~AoutObject() {}
481717SN/A
491717SN/A    virtual bool loadSections(FunctionalMemory *mem,
502292SN/A                              bool loadPhys = false);
512292SN/A    virtual bool loadGlobalSymbols(SymbolTable *symtab);
522817Sksewell@umich.edu    virtual bool loadLocalSymbols(SymbolTable *symtab);
531060SN/A
541060SN/A    static ObjectFile *tryFile(const std::string &fname, int fd,
552316SN/A                               size_t len, uint8_t *data);
562316SN/A};
572680Sktlim@umich.edu
582817Sksewell@umich.edu#endif // __AOUT_OBJECT_HH__
592817Sksewell@umich.edu