aboutsummaryrefslogtreecommitdiff
path: root/gold/output.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-02-06 19:32:32 +0000
committerIan Lance Taylor <iant@google.com>2008-02-06 19:32:32 +0000
commit755ab8af10558c40e5090e92c46bbbd89815c292 (patch)
treec2d87009c2ebc0af8507f0e2dddebdab5b91c608 /gold/output.cc
parent06b1d59cd626db8764130ba2a03daa42feefc968 (diff)
downloadbinutils-755ab8af10558c40e5090e92c46bbbd89815c292.zip
binutils-755ab8af10558c40e5090e92c46bbbd89815c292.tar.gz
binutils-755ab8af10558c40e5090e92c46bbbd89815c292.tar.bz2
Fix group signature handling for relocatable link, add bootstrap
relocatable test.
Diffstat (limited to 'gold/output.cc')
-rw-r--r--gold/output.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/gold/output.cc b/gold/output.cc
index 0e05ff7..332aa2c 100644
--- a/gold/output.cc
+++ b/gold/output.cc
@@ -1610,6 +1610,7 @@ Output_section::Output_section(const char* name, elfcpp::Elf_Word type,
requires_postprocessing_(false),
found_in_sections_clause_(false),
has_load_address_(false),
+ info_uses_section_index_(false),
tls_offset_(0)
{
// An unallocated section has no address. Forcing this means that
@@ -2005,7 +2006,7 @@ Output_section::write_header(const Layout* layout,
oshdr->put_sh_type(this->type_);
elfcpp::Elf_Xword flags = this->flags_;
- if (this->info_section_ != NULL)
+ if (this->info_section_ != NULL && this->info_uses_section_index_)
flags |= elfcpp::SHF_INFO_LINK;
oshdr->put_sh_flags(flags);
@@ -2020,12 +2021,21 @@ Output_section::write_header(const Layout* layout,
oshdr->put_sh_link(layout->dynsym_section()->out_shndx());
else
oshdr->put_sh_link(this->link_);
+
+ elfcpp::Elf_Word info;
if (this->info_section_ != NULL)
- oshdr->put_sh_info(this->info_section_->out_shndx());
+ {
+ if (this->info_uses_section_index_)
+ info = this->info_section_->out_shndx();
+ else
+ info = this->info_section_->symtab_index();
+ }
else if (this->info_symndx_ != NULL)
- oshdr->put_sh_info(this->info_symndx_->symtab_index());
+ info = this->info_symndx_->symtab_index();
else
- oshdr->put_sh_info(this->info_);
+ info = this->info_;
+ oshdr->put_sh_info(info);
+
oshdr->put_sh_addralign(this->addralign_);
oshdr->put_sh_entsize(this->entsize_);
}