public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jiong Wang <jiong.wang@arm.com>
To: "binutils\@sourceware.org" <binutils@sourceware.org>
Subject: [AArch64] Remove BFD overflow check restrictions
Date: Tue, 12 May 2015 14:43:00 -0000	[thread overview]
Message-ID: <n99egmldffr.fsf@arm.com> (raw)

[-- 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;
 

             reply	other threads:[~2015-05-12 14:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-12 14:43 Jiong Wang [this message]
2015-05-14 11:40 ` Nicholas Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=n99egmldffr.fsf@arm.com \
    --to=jiong.wang@arm.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).