This is the mail archive of the binutils@sources.redhat.com 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: Fix ia64 br relax check


My patch breaks existing binaries. We should only issue an error when
we try to relax br in .init/.fini sections. I will check it in shortly
as an obvious fix.


H.J.
---
2004-07-09  H.J. Lu  <hongjiu.lu@intel.com>

	PR 240
	* elfxx-ia64.c (elfNN_ia64_relax_section): Only warn br in
	.init/.fini sections when trying to relax it.

--- elfxx-ia64.c.brl	2004-07-08 08:08:42.000000000 -0700
+++ elfxx-ia64.c	2004-07-09 12:06:41.482806394 -0700
@@ -953,19 +953,6 @@ elfNN_ia64_relax_section (abfd, sec, lin
 	{
 	  bfd_signed_vma offset;
 
-	  /* We can't put a trampoline in a .init/.fini section. Issue
-	     an error.  */
-	  if (strcmp (sec->output_section->name, ".init") == 0
-	      || strcmp (sec->output_section->name, ".fini") == 0)
-	    {
-	      (*_bfd_error_handler)
-		(_("%s: Can't relax br at 0x%lx in section `%s'. Please use brl or indirect branch."),
-		 bfd_archive_filename (sec->owner),
-		 (unsigned long) roff, sec->name);
-	      bfd_set_error (bfd_error_bad_value);
-	      goto error_return;
-	    }
-
 	  reladdr = (sec->output_section->vma
 		     + sec->output_offset
 		     + roff) & (bfd_vma) -4;
@@ -994,6 +981,19 @@ elfNN_ia64_relax_section (abfd, sec, lin
 	  else if (r_type == R_IA64_PCREL60B)
 	    continue;
 
+	  /* We can't put a trampoline in a .init/.fini section. Issue
+	     an error.  */
+	  if (strcmp (sec->output_section->name, ".init") == 0
+	      || strcmp (sec->output_section->name, ".fini") == 0)
+	    {
+	      (*_bfd_error_handler)
+		(_("%s: Can't relax br at 0x%lx in section `%s'. Please use brl or indirect branch."),
+		 bfd_archive_filename (sec->owner),
+		 (unsigned long) roff, sec->name);
+	      bfd_set_error (bfd_error_bad_value);
+	      goto error_return;
+	    }
+
 	  /* If the branch and target are in the same section, you've
 	     got one honking big section and we can't help you.  You'll
 	     get an error message later.  */


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