public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] alpha: Warn DT_TEXTREL with -M
Date: Mon, 04 May 2020 04:09:10 -0400	[thread overview]
Message-ID: <1f7f2abbc31ee9e6d4faca58bef14d8ee8cb1bd2@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT 1f7f2abbc31ee9e6d4faca58bef14d8ee8cb1bd2 ***

commit 1f7f2abbc31ee9e6d4faca58bef14d8ee8cb1bd2
Author:     H.J. Lu <hjl.tools@gmail.com>
AuthorDate: Tue Apr 21 05:20:11 2020 -0700
Commit:     H.J. Lu <hjl.tools@gmail.com>
CommitDate: Tue Apr 21 05:20:23 2020 -0700

    alpha: Warn DT_TEXTREL with -M
    
    This fixes:
    
    FAIL: DT_TEXTREL map file warning
    
            * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
            sec.
            (elf64_alpha_check_relocs): Set sec instead of reltext.  Warn
            DT_TEXTREL with -M.
            (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 1b174f3082..a15a0f3775 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,11 @@
+2020-04-21  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
+	sec.
+	(elf64_alpha_check_relocs): Set sec instead of reltext.  Warn
+	DT_TEXTREL with -M.
+	(elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
+
 2020-04-21  Nick Clifton  <nickc@redhat.com>
 
 	* po/sr.po: Updated Serbian translation.
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index ca15944e60..9f79d8e3fb 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -144,14 +144,14 @@ struct alpha_elf_reloc_entry
   /* Which .reloc section? */
   asection *srel;
 
-  /* What kind of relocation? */
-  unsigned int rtype;
-
-  /* Is this against read-only section? */
-  unsigned int reltext : 1;
+  /* Which section this relocation is against? */
+  asection *sec;
 
   /* How many did we find?  */
   unsigned long count;
+
+  /* What kind of relocation? */
+  unsigned int rtype;
 };
 
 struct alpha_elf_link_hash_entry
@@ -1998,9 +1998,9 @@ elf64_alpha_check_relocs (bfd *abfd, struct bfd_link_info *info,
 		    return FALSE;
 
 		  rent->srel = sreloc;
+		  rent->sec = sec;
 		  rent->rtype = r_type;
 		  rent->count = 1;
-		  rent->reltext = (sec->flags & SEC_READONLY) != 0;
 
 		  rent->next = h->reloc_entries;
 		  h->reloc_entries = rent;
@@ -2014,7 +2014,13 @@ elf64_alpha_check_relocs (bfd *abfd, struct bfd_link_info *info,
 		 loaded into memory, we need a RELATIVE reloc.  */
 	      sreloc->size += sizeof (Elf64_External_Rela);
 	      if (sec->flags & SEC_READONLY)
-		info->flags |= DF_TEXTREL;
+		{
+		  info->flags |= DF_TEXTREL;
+		  info->callbacks->minfo
+		    (_("%pB: dynamic relocation against `%pT' in "
+		       "read-only section `%pA'\n"),
+		     sec->owner, h->root.root.root.string, sec);
+		}
 	    }
 	}
     }
@@ -2699,10 +2705,17 @@ elf64_alpha_calc_dynrel_sizes (struct alpha_elf_link_hash_entry *h,
 						 bfd_link_pie (info));
       if (entries)
 	{
+	  asection *sec = relent->sec;
 	  relent->srel->size +=
 	    entries * sizeof (Elf64_External_Rela) * relent->count;
-	  if (relent->reltext)
-	    info->flags |= DT_TEXTREL;
+	  if ((sec->flags & SEC_READONLY) != 0)
+	    {
+	      info->flags |= DT_TEXTREL;
+	      info->callbacks->minfo
+		(_("%pB: dynamic relocation against `%pT' in "
+		   "read-only section `%pA'\n"),
+		 sec->owner, h->root.root.root.string, sec);
+	    }
 	}
     }
 


             reply	other threads:[~2020-05-04  8:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04  8:09 gdb-buildbot [this message]
2020-05-04  8:09 ` Failures on Fedora-i686, branch master gdb-buildbot
2020-05-04  8:26 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2020-05-04  8:42 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2020-05-04  9:00 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2020-05-04  9:24 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2020-05-04  9:46 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2020-05-05  6:14 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot
2020-05-06 15:23 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot

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=1f7f2abbc31ee9e6d4faca58bef14d8ee8cb1bd2@gdb-build \
    --to=gdb-buildbot@sergiodj.net \
    --cc=gdb-testers@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).