public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Peter S. Mazinger" <ps.m@gmx.net>
To: binutils@sourceware.org
Subject: elf32-arm.c corrections
Date: Sun, 20 Mar 2005 06:08:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.44.0503200200320.5758-300000@lnx.bridge.intra> (raw)

[-- Attachment #1: Type: TEXT/PLAIN, Size: 534 bytes --]

Hello!

add_dynamic_entry: changes !info->shared to info->executable (PIE)
corrects typo, and syncs up with other archs (some others could do the 
same). For !relocs the hole part would be omitted, probably some speed gain.

Should the other patch (*3) for allocate_dynrelocs be applied (as done for 
ppc32)?

Why is ELIMINATE_COPY_RELOCS not used for arm?

Thanks, Peter

Please cc to me, 

-- 
Peter S. Mazinger <ps dot m at gmx dot net>           ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08  BB6E C389 975E A5F0 59F2

[-- Attachment #2: Type: TEXT/PLAIN, Size: 724 bytes --]

--- bfd/elf32-arm.c.mps	2005-03-19 22:57:32 +0100
+++ bfd/elf32-arm.c	2005-03-19 23:05:34 +0100
@@ -4658,6 +4658,19 @@
       if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
 	  && h->root.type == bfd_link_hash_undefweak)
 	eh->relocs_copied = NULL;
+
+      /* Make sure undefined weak symbols are output as a dynamic symbol
+	 in PIEs.  */
+      if (info->pie
+	  && eh->relocs_copied != NULL
+	  && h->dynindx == -1
+	  && h->root.type == bfd_link_hash_undefweak
+	  && !h->forced_local)
+	{
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
+	    return FALSE;
+	}
+
       else if (htab->root.is_relocatable_executable && h->dynindx == -1
 	       && h->root.type == bfd_link_hash_new)
 	{

[-- Attachment #3: Type: TEXT/PLAIN, Size: 1338 bytes --]

--- bfd/elf32-arm.c.mps	2005-03-19 22:57:32 +0100
+++ bfd/elf32-arm.c	2005-03-19 23:05:34 +0100
@@ -4926,7 +4926,7 @@
 #define add_dynamic_entry(TAG, VAL) \
   _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
-      if (!info->shared)
+      if (info->executable)
 	{
 	  if (!add_dynamic_entry (DT_DEBUG, 0))
 	    return FALSE;
@@ -4947,22 +4947,21 @@
 	      || !add_dynamic_entry (DT_RELSZ, 0)
 	      || !add_dynamic_entry (DT_RELENT, sizeof (Elf32_External_Rel)))
 	    return FALSE;
-	}
 
-      /* If any dynamic relocs apply to a read-only section,
-	 then we need a DT_TEXTREL entry.  */
-      if ((info->flags & DF_TEXTREL) == 0)
-	elf_link_hash_traverse (&htab->root, elf32_arm_readonly_dynrelocs,
+	  /* If any dynamic relocs apply to a read-only section,
+	     then we need a DT_TEXTREL entry.  */
+	  if ((info->flags & DF_TEXTREL) == 0)
+	    elf_link_hash_traverse (&htab->root, elf32_arm_readonly_dynrelocs,
 				(PTR) info);
 
-      if ((info->flags & DF_TEXTREL) != 0)
-	{
-	  if (!add_dynamic_entry (DT_TEXTREL, 0))
-	    return FALSE;
-	  info->flags |= DF_TEXTREL;
+	  if ((info->flags & DF_TEXTREL) != 0)
+	    {
+	      if (!add_dynamic_entry (DT_TEXTREL, 0))
+		return FALSE;
+	    }
 	}
     }
-#undef add_synamic_entry
+#undef add_dynamic_entry
 
   return TRUE;
 }

             reply	other threads:[~2005-03-20  1:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-20  6:08 Peter S. Mazinger [this message]
2005-03-20 13:19 ` Daniel Jacobowitz
2005-03-20 15:39   ` Peter S. Mazinger
2005-03-20 19:45     ` Daniel Jacobowitz
2005-03-27 22:57       ` Peter S. Mazinger
2005-03-27 23:56         ` Daniel Jacobowitz
2005-03-28  1:58           ` Peter S. Mazinger
2005-03-29 22:05             ` Nick Clifton
2005-04-04 13:45 ` Richard Earnshaw
2005-04-04 14:27   ` Peter S. Mazinger
2005-04-04 14:41     ` Richard Earnshaw

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=Pine.LNX.4.44.0503200200320.5758-300000@lnx.bridge.intra \
    --to=ps.m@gmx.net \
    --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).