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]

PATCH: Always check section_alignment for output section alignment


Hi Alan,

lang_size_sections_1 used to always check section_alignment for section
alignment. Your patch:

http://sourceware.org/ml/binutils/2005-11/msg00235.html

moved the check to init_os. I have some local changes where some
targets may update section_alignment after init_os is called. This
patch restores the old behavior.


H.J.
----
2006-02-08  H.J. Lu  <hongjiu.lu@intel.com>

	* ldlang.c (lang_size_sections_1): Check section_alignment for
	output section alignment.

--- ld/ldlang.c.align	2006-02-08 10:12:45.000000000 -0800
+++ ld/ldlang.c	2006-02-08 11:13:32.000000000 -0800
@@ -4202,7 +4202,13 @@ lang_size_sections_1
 		      }
 
 		    newdot = os->region->current;
-		    align = os->bfd_section->alignment_power;
+		    /* Always use the larger alignment.  */
+		    if (os->section_alignment == -1
+			|| (os->bfd_section->alignment_power
+			    > (unsigned int) os->section_alignment))
+		      align = os->bfd_section->alignment_power;
+		    else
+		      align = os->section_alignment;
 		  }
 		else
 		  align = os->section_alignment;


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