public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [AArch64] Remove BFD overflow check restrictions
@ 2015-05-12 14:43 Jiong Wang
  2015-05-14 11:40 ` Nicholas Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Jiong Wang @ 2015-05-12 14:43 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 1009 bytes --]


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


[-- Attachment #2: remove-check.patch --]
[-- Type: text/x-diff, Size: 1039 bytes --]

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;
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [AArch64] Remove BFD overflow check restrictions
  2015-05-12 14:43 [AArch64] Remove BFD overflow check restrictions Jiong Wang
@ 2015-05-14 11:40 ` Nicholas Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nicholas Clifton @ 2015-05-14 11:40 UTC (permalink / raw)
  To: Jiong Wang, binutils

Hi Jiong,

> 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.

OK for the mainline.

Cheers
   Nick

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-14 11:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-12 14:43 [AArch64] Remove BFD overflow check restrictions Jiong Wang
2015-05-14 11:40 ` Nicholas Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).