This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gold bug combining .bss sections...


David Miller <davem@davemloft.net> writes:

> If, for example, we have a normal .bss in the final link with only a
> necessary alignment of 4, and we also have a dynbss .bss with a copy
> reloc needing an alignment of 8, gold outputs the final combined .bss
> section with only an alignment of 4.

I just committed this patch which I think should fix this problem.

Ian


2008-04-11  Ian Lance Taylor  <iant@google.com>

	* output.h (class Output_section_data): Remove inline definition
	of set_addralign.
	* output.cc (Output_section_data::set_addralign): New function.


Index: output.cc
===================================================================
RCS file: /cvs/src/src/gold/output.cc,v
retrieving revision 1.70
diff -u -p -r1.70 output.cc
--- output.cc	11 Apr 2008 21:24:29 -0000	1.70
+++ output.cc	11 Apr 2008 22:54:29 -0000
@@ -535,6 +535,18 @@ Output_section_data::do_out_shndx() cons
   return this->output_section_->out_shndx();
 }
 
+// Set the alignment, which means we may need to update the alignment
+// of the output section.
+
+void
+Output_section_data::set_addralign(uint64_t addralign)
+{
+  this->addralign_ = addralign;
+  if (this->output_section_ != NULL
+      && this->output_section_->addralign() < addralign)
+    this->output_section_->set_addralign(addralign);
+}
+
 // Output_data_strtab methods.
 
 // Set the final data size.
Index: output.h
===================================================================
RCS file: /cvs/src/src/gold/output.h,v
retrieving revision 1.61
diff -u -p -r1.61 output.h
--- output.h	11 Apr 2008 21:24:29 -0000	1.61
+++ output.h	11 Apr 2008 22:54:29 -0000
@@ -595,8 +595,7 @@ class Output_section_data : public Outpu
 
   // Set the alignment.
   void
-  set_addralign(uint64_t addralign)
-  { this->addralign_ = addralign; }
+  set_addralign(uint64_t addralign);
 
  private:
   // The output section for this section.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]