aboutsummaryrefslogtreecommitdiff
path: root/gold/merge.h
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-10-18 17:46:23 +0000
committerIan Lance Taylor <iant@google.com>2007-10-18 17:46:23 +0000
commit87f9577614a90f155dcdf59864d21dbc3f106469 (patch)
treef8c50dbd3e92c4a509c500608e9510e666cc0904 /gold/merge.h
parentba32f9896b4b1e79f36ae03ac383869127a461e0 (diff)
downloadgdb-87f9577614a90f155dcdf59864d21dbc3f106469.zip
gdb-87f9577614a90f155dcdf59864d21dbc3f106469.tar.gz
gdb-87f9577614a90f155dcdf59864d21dbc3f106469.tar.bz2
Correctly handle alignment in merge sections.
Diffstat (limited to 'gold/merge.h')
-rw-r--r--gold/merge.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/gold/merge.h b/gold/merge.h
index ab382a1..cc554f2 100644
--- a/gold/merge.h
+++ b/gold/merge.h
@@ -37,8 +37,8 @@ namespace gold
class Output_merge_base : public Output_section_data
{
public:
- Output_merge_base(uint64_t entsize)
- : Output_section_data(1), merge_map_(), entsize_(entsize)
+ Output_merge_base(uint64_t entsize, uint64_t addralign)
+ : Output_section_data(addralign), merge_map_(), entsize_(entsize)
{ }
// Return the output address for an input address.
@@ -90,8 +90,8 @@ class Output_merge_base : public Output_section_data
class Output_merge_data : public Output_merge_base
{
public:
- Output_merge_data(uint64_t entsize)
- : Output_merge_base(entsize), p_(NULL), len_(0), alc_(0),
+ Output_merge_data(uint64_t entsize, uint64_t addralign)
+ : Output_merge_base(entsize, addralign), p_(NULL), len_(0), alc_(0),
hashtable_(128, Merge_data_hash(this), Merge_data_eq(this))
{ }
@@ -188,9 +188,13 @@ template<typename Char_type>
class Output_merge_string : public Output_merge_base
{
public:
- Output_merge_string()
- : Output_merge_base(sizeof(Char_type)), stringpool_(), merged_strings_()
- { this->stringpool_.set_no_zero_null(); }
+ Output_merge_string(uint64_t addralign)
+ : Output_merge_base(sizeof(Char_type), addralign), stringpool_(),
+ merged_strings_()
+ {
+ gold_assert(addralign <= sizeof(Char_type));
+ this->stringpool_.set_no_zero_null();
+ }
// Add an input section.
bool