diff options
author | Ian Lance Taylor <ian@airs.com> | 2008-06-18 04:39:41 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2008-06-18 04:39:41 +0000 |
commit | f34787f832c7a94cda142b7fa867a9be37e8f2af (patch) | |
tree | 627cb059c40eb7c34bd74e077509162c00a87a39 /gold/output.h | |
parent | c42e122ead58317580cb49a2e0db60fd8e308edd (diff) | |
download | gdb-f34787f832c7a94cda142b7fa867a9be37e8f2af.zip gdb-f34787f832c7a94cda142b7fa867a9be37e8f2af.tar.gz gdb-f34787f832c7a94cda142b7fa867a9be37e8f2af.tar.bz2 |
* output.h (Output_section::Input_section): Initialize p2align_ to
zero for Output_section_data constructors.
(Output_section::Input_section::addralign): If not an input
section, return the alignment of the Output_section_data.
* testsuite/copy_test.cc: New file.
* testsuite/copy_test_1.cc: New file.
* testsuite/copy_test_2.cc: New file.
* testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
(copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
(copy_test_LDFLAGS, copy_test_LDADD): New variables.
(copy_test_1_pic.o, copy_test_1.so): New targets.
(copy_test_2_pic.o, copy_test_2.so): New targets.
* testsuite/Makefile.in: Rebuild.
Diffstat (limited to 'gold/output.h')
-rw-r--r-- | gold/output.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gold/output.h b/gold/output.h index dceaceb..952f24f 100644 --- a/gold/output.h +++ b/gold/output.h @@ -2443,8 +2443,7 @@ class Output_section : public Output_data // For a non-merge output section. Input_section(Output_section_data* posd) - : shndx_(OUTPUT_SECTION_CODE), - p2align_(ffsll(static_cast<long long>(posd->addralign()))) + : shndx_(OUTPUT_SECTION_CODE), p2align_(0) { this->u1_.data_size = 0; this->u2_.posd = posd; @@ -2455,7 +2454,7 @@ class Output_section : public Output_data : shndx_(is_string ? MERGE_STRING_SECTION_CODE : MERGE_DATA_SECTION_CODE), - p2align_(ffsll(static_cast<long long>(posd->addralign()))) + p2align_(0) { this->u1_.entsize = entsize; this->u2_.posd = posd; @@ -2465,6 +2464,8 @@ class Output_section : public Output_data uint64_t addralign() const { + if (!this->is_input_section()) + return this->u2_.posd->addralign(); return (this->p2align_ == 0 ? 0 : static_cast<uint64_t>(1) << (this->p2align_ - 1)); |