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]

[AArch64] Remove BFD overflow check restrictions


I have been adding some testcases to test relocation overflow, while bfd
linker haven't given any error report.

After some debugging, it's caused by these extra checked removed in the
patch. They prevent the error report happening.

Although the comment says:

 "If the overflowing reloc was to an undefined symbol, we have already
 printed one error message and there is no point complaining again."

But, I haven't seen any error message before reach here.

x86/mips/sparc etc don't have such restriction. "git blame" shows it
first added to ARM back in 2000, 15 years ago, then propagated to a few
other targets including AArch64.

These code do looks insane and hard to understand, this patch remove
them. I'd like to fix further issue caused by this remove if any.

OK for trunk and 2.25 backport?

Thanks.

2015-05-12  Jiong Wang  <jiong.wang@arm.com>

bfd/
  * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Remove overflow check restrictions.
-- 
Regards,
Jiong

commit c2e5e4823fb50eae7759c57278d377ce06e8a1c4
Author: Jiong Wang <jiong.wang@arm.com>
Date:   Thu May 7 21:12:26 2015 +0000

    [BFD] Release error report

diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index bd42219..6808ca3 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -5691,15 +5691,9 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
 	  switch (r)
 	    {
 	    case bfd_reloc_overflow:
-	      /* If the overflowing reloc was to an undefined symbol,
-		 we have already printed one error message and there
-		 is no point complaining again.  */
-	      if ((!h ||
-		   h->root.type != bfd_link_hash_undefined)
-		  && (!((*info->callbacks->reloc_overflow)
-			(info, (h ? &h->root : NULL), name, howto->name,
-			 (bfd_vma) 0, input_bfd, input_section,
-			 rel->r_offset))))
+	      if (!(*info->callbacks->reloc_overflow)
+		  (info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0,
+		   input_bfd, input_section, rel->r_offset))
 		return FALSE;
 	      break;
 

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