Split Object into Dynobj and Relobj, incorporate elfcpp swapping changes.
[binutils.git] / gold / dynobj.h
blob99e78830d15b70e5b35e3f842e1fa4aa67a00120
1 // dynobj.h -- dynamic object support for gold -*- C++ -*-
3 #ifndef GOLD_DYNOBJ_H
4 #define GOLD_DYNOBJ_H
6 #include "object.h"
8 namespace gold
11 // A dynamic object (ET_DYN). This is an abstract base class itself.
12 // The implementations is the template class Sized_dynobj.
14 class Dynobj : public Object
16 public:
17 Dynobj(const std::string& name, Input_file* input_file, off_t offset = 0)
18 : Object(name, input_file, true, offset)
19 { }
22 // A dynamic object, size and endian specific version.
24 template<int size, bool big_endian>
25 class Sized_dynobj : public Dynobj
27 public:
28 Sized_dynobj(const std::string& name, Input_file* input_file, off_t offset,
29 const typename elfcpp::Ehdr<size, big_endian>&);
31 // Read the symbols.
32 void
33 do_read_symbols(Read_symbols_data*);
35 // Lay out the input sections.
36 void
37 do_layout(const General_options&, Symbol_table*, Layout*,
38 Read_symbols_data*);
40 // Add the symbols to the symbol table.
41 void
42 do_add_symbols(Symbol_table*, Read_symbols_data*);
44 // Return a view of the contents of a section. Set *PLEN to the
45 // size.
46 const unsigned char*
47 do_section_contents(unsigned int shnum, off_t* plen) = 0;
49 // Get the name of a section.
50 std::string
51 do_section_name(unsigned int shnum);
54 } // End namespace gold.
56 #endif // !defined(GOLD_DYNOBJ_H)