public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* elf32-arm.c corrections
@ 2005-03-20  6:08 Peter S. Mazinger
  2005-03-20 13:19 ` Daniel Jacobowitz
  2005-04-04 13:45 ` Richard Earnshaw
  0 siblings, 2 replies; 11+ messages in thread
From: Peter S. Mazinger @ 2005-03-20  6:08 UTC (permalink / raw)
  To: binutils

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

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

end of thread, other threads:[~2005-04-04 14:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-20  6:08 elf32-arm.c corrections Peter S. Mazinger
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

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