public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* ARM: Fix DT_TEXTREL generation
@ 2005-03-26  0:35 Daniel Jacobowitz
  2005-03-29 16:21 ` Richard Earnshaw
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2005-03-26  0:35 UTC (permalink / raw)
  To: binutils

I posted this patch a couple days ago, but at the bottom of a thread ...
tsk tsk.

This patch prevents the incorrect generation of a DT_TEXTREL tag in ARM
shared libraries.  The problem was that p->count was correctly updated,
but we would sometimes create new relocs_copied entries with a zero count;
and when checking for text relocations, we don't look at the count, just
whether the pointer is non-NULL.  The cleanest fix is to avoid creating a
new relocs_copied structure if we aren't going to increment it.

OK for HEAD?  Any objection to fixing this on 2.16 also?

-- 
Daniel Jacobowitz
CodeSourcery, LLC

2005-03-18  Daniel Jacobowitz  <dan@codesourcery.com>

	* elf32-arm.c (elf32_arm_check_relocs): Increment count for all
	relocation types.  Don't count relocations which will use a PLT.

Index: binutils/bfd/elf32-arm.c
===================================================================
--- binutils.orig/bfd/elf32-arm.c	2005-03-18 13:20:03.152084693 -0500
+++ binutils/bfd/elf32-arm.c	2005-03-18 17:00:25.694851664 -0500
@@ -4093,18 +4093,9 @@ elf32_arm_check_relocs (bfd *abfd, struc
                relocs_copied field of the hash table entry.  */
 	    if ((info->shared || htab->root.is_relocatable_executable)
 		&& (sec->flags & SEC_ALLOC) != 0
-		&& ((r_type != R_ARM_PC24
-		     && r_type != R_ARM_PLT32
-#ifndef OLD_ARM_ABI
-		     && r_type != R_ARM_CALL
-		     && r_type != R_ARM_JUMP24
-		     && r_type != R_ARM_PREL31
-#endif
-		     && r_type != R_ARM_REL32
-		     && r_type != R_ARM_THM_PC22)
-		    || (h != NULL
-			&& (! info->symbolic
-			    || !h->def_regular))))
+		&& (r_type == R_ARM_ABS32
+		    || (h != NULL && ! h->needs_plt
+			&& (! info->symbolic || ! h->def_regular))))
 	      {
 		struct elf32_arm_relocs_copied *p, **head;
 
@@ -4184,9 +4175,7 @@ elf32_arm_check_relocs (bfd *abfd, struc
 		    p->count = 0;
 		  }
 
-		if (r_type == R_ARM_ABS32
-		    || r_type == R_ARM_REL32)
-		  p->count += 1;
+		p->count += 1;
 	      }
 	    break;
 

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

* Re: ARM: Fix DT_TEXTREL generation
  2005-03-26  0:35 ARM: Fix DT_TEXTREL generation Daniel Jacobowitz
@ 2005-03-29 16:21 ` Richard Earnshaw
  2005-03-29 20:00   ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Earnshaw @ 2005-03-29 16:21 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: binutils

On Fri, 2005-03-25 at 16:01, Daniel Jacobowitz wrote:
> I posted this patch a couple days ago, but at the bottom of a thread ...
> tsk tsk.
> 
> This patch prevents the incorrect generation of a DT_TEXTREL tag in ARM
> shared libraries.  The problem was that p->count was correctly updated,
> but we would sometimes create new relocs_copied entries with a zero count;
> and when checking for text relocations, we don't look at the count, just
> whether the pointer is non-NULL.  The cleanest fix is to avoid creating a
> new relocs_copied structure if we aren't going to increment it.
> 
> OK for HEAD?  Any objection to fixing this on 2.16 also?

This is OK for head.  For the record, I'm happy for this to go into 2.16
too, but I'm not sure if that's my call.
R.

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

* Re: ARM: Fix DT_TEXTREL generation
  2005-03-29 16:21 ` Richard Earnshaw
@ 2005-03-29 20:00   ` Daniel Jacobowitz
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Jacobowitz @ 2005-03-29 20:00 UTC (permalink / raw)
  To: Richard Earnshaw; +Cc: binutils

On Tue, Mar 29, 2005 at 04:22:08PM +0100, Richard Earnshaw wrote:
> On Fri, 2005-03-25 at 16:01, Daniel Jacobowitz wrote:
> > I posted this patch a couple days ago, but at the bottom of a thread ...
> > tsk tsk.
> > 
> > This patch prevents the incorrect generation of a DT_TEXTREL tag in ARM
> > shared libraries.  The problem was that p->count was correctly updated,
> > but we would sometimes create new relocs_copied entries with a zero count;
> > and when checking for text relocations, we don't look at the count, just
> > whether the pointer is non-NULL.  The cleanest fix is to avoid creating a
> > new relocs_copied structure if we aren't going to increment it.
> > 
> > OK for HEAD?  Any objection to fixing this on 2.16 also?
> 
> This is OK for head.  For the record, I'm happy for this to go into 2.16
> too, but I'm not sure if that's my call.

It's your call - or mine, as release manager.  Since we're both happy,
I'll commit it to both.

-- 
Daniel Jacobowitz
CodeSourcery, LLC

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

end of thread, other threads:[~2005-03-29 16:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-26  0:35 ARM: Fix DT_TEXTREL generation Daniel Jacobowitz
2005-03-29 16:21 ` Richard Earnshaw
2005-03-29 20:00   ` Daniel Jacobowitz

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