aboutsummaryrefslogtreecommitdiff
path: root/gold/object.h
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-02-04 05:43:05 +0000
committerIan Lance Taylor <iant@google.com>2008-02-04 05:43:05 +0000
commita445fddf828b0e8251fbdce91bc9372e7efd24f0 (patch)
tree6af0ee8254a9432643798126eef663603d92eb08 /gold/object.h
parentd16c732117ed4b752abd51dd1598c9cec9d2b26c (diff)
downloadgdb-a445fddf828b0e8251fbdce91bc9372e7efd24f0.zip
gdb-a445fddf828b0e8251fbdce91bc9372e7efd24f0.tar.gz
gdb-a445fddf828b0e8251fbdce91bc9372e7efd24f0.tar.bz2
Fully implement the SECTIONS clause.
Diffstat (limited to 'gold/object.h')
-rw-r--r--gold/object.h31
1 files changed, 29 insertions, 2 deletions
diff --git a/gold/object.h b/gold/object.h
index e4140be..5a62546 100644
--- a/gold/object.h
+++ b/gold/object.h
@@ -206,8 +206,12 @@ class Object
const unsigned char*
section_contents(unsigned int shndx, section_size_type* plen, bool cache);
- // Return the name of a section given a section index. This is only
- // used for error messages.
+ // Return the size of a section given a section index.
+ uint64_t
+ section_size(unsigned int shndx)
+ { return this->do_section_size(shndx); }
+
+ // Return the name of a section given a section index.
std::string
section_name(unsigned int shndx)
{ return this->do_section_name(shndx); }
@@ -232,6 +236,11 @@ class Object
section_info(unsigned int shndx)
{ return this->do_section_info(shndx); }
+ // Return the required section alignment given a section index.
+ uint64_t
+ section_addralign(unsigned int shndx)
+ { return this->do_section_addralign(shndx); }
+
// Read the symbol information.
void
read_symbols(Read_symbols_data* sd)
@@ -344,6 +353,10 @@ class Object
virtual Location
do_section_contents(unsigned int shndx) = 0;
+ // Get the size of a section--implemented by child class.
+ virtual uint64_t
+ do_section_size(unsigned int shndx) = 0;
+
// Get the name of a section--implemented by child class.
virtual std::string
do_section_name(unsigned int shndx) = 0;
@@ -364,6 +377,10 @@ class Object
virtual unsigned int
do_section_info(unsigned int shndx) = 0;
+ // Get section alignment--implemented by child class.
+ virtual uint64_t
+ do_section_addralign(unsigned int shndx) = 0;
+
// Get the file. We pass on const-ness.
Input_file*
input_file()
@@ -1136,6 +1153,11 @@ class Sized_relobj : public Relobj
do_relocate(const General_options& options, const Symbol_table* symtab,
const Layout*, Output_file* of);
+ // Get the size of a section.
+ uint64_t
+ do_section_size(unsigned int shndx)
+ { return this->elf_file_.section_size(shndx); }
+
// Get the name of a section.
std::string
do_section_name(unsigned int shndx)
@@ -1166,6 +1188,11 @@ class Sized_relobj : public Relobj
do_section_info(unsigned int shndx)
{ return this->elf_file_.section_info(shndx); }
+ // Return the section alignment.
+ uint64_t
+ do_section_addralign(unsigned int shndx)
+ { return this->elf_file_.section_addralign(shndx); }
+
private:
// For convenience.
typedef Sized_relobj<size, big_endian> This;