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: PATCH: PR ld/3966: 32bit address wrap around doesn't work with 32bit host


On Sun, Feb 04, 2007 at 03:19:39PM -0800, H. J. Lu wrote:
> To support ia32 address wrap around, we need 64bit BFD. This patch
> enables 64bit BFD for ia32.

I don't like this.  Instead, let's not warn until we wrap to a
section that has non-zero size.

	* ldlang.c (lang_size_sections_1): Don't warn on backwards dot
	move unless section size is non-zero.

Index: ld/ldlang.c
===================================================================
RCS file: /cvs/src/src/ld/ldlang.c,v
retrieving revision 1.248
diff -u -p -r1.248 ldlang.c
--- ld/ldlang.c	16 Jan 2007 14:56:31 -0000	1.248
+++ ld/ldlang.c	6 Feb 2007 03:56:13 -0000
@@ -4413,7 +4412,8 @@ lang_size_sections_1
 		   an explicit assignment to the section LMA (ie.
 		   os->load_base set) because backwards moves normally
 		   create overlapping LMAs.  */
-		if (dot < last->vma)
+		if (dot < last->vma
+		    && os->bfd_section->size != 0)
 		  {
 		    einfo (_("%P: warning: dot moved backwards before `%s'\n"),
 			   os->name);
@@ -4463,8 +4463,11 @@ lang_size_sections_1
 		 || (os->bfd_section->flags & SEC_THREAD_LOCAL) == 0)
 		&& (os->bfd_section->flags & SEC_ALLOC) != 0
 		&& (os->bfd_section->size != 0
-		    || os->bfd_section->vma != os->bfd_section->lma
-		    || r->last_os != NULL)
+		    || (r->last_os == NULL
+			&& os->bfd_section->vma != os->bfd_section->lma)
+		    || (r->last_os != NULL
+			&& dot >= (r->last_os->output_section_statement
+				   .bfd_section->vma))
 		&& os->lma_region == NULL
 		&& !link_info.relocatable)
 	      r->last_os = s;


-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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