[parisc-linux] elf32-hppa fix for new ld.so

Alan Modra amodra@bigpond.net.au
Thu, 1 Nov 2001 02:03:19 +1030


Fixes a mismatch between elf32_hppa_size_dynamic_sections, where .plt
relocs aren't counted in the total reloc count, and finish_dynamic_sections,
where the default elf scheme counts 'em.  Things sort-of worked previously
due to various bugs in ld.so cancelling out.  

bfd/ChangeLog
	* elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Don't count
	.plt relocs in DT_RELASZ.

This means glibc/sysdeps/hppa/dl-machine.h should no longer define
ELF_MACHINE_PLTREL_OVERLAP.

-- 
Alan Modra
 
Index: bfd/elf32-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-hppa.c,v
retrieving revision 1.56
diff -u -p -r1.55 elf32-hppa.c
--- elf32-hppa.c	2001/10/31 14:58:14	1.56
+++ elf32-hppa.c	2001/10/31 15:22:53
@@ -4273,6 +4273,19 @@ elf32_hppa_finish_dynamic_sections (outp
 		dyn.d_un.d_val = s->_cooked_size;
 	      else
 		dyn.d_un.d_val = s->_raw_size;
+	      break;
+
+	    case DT_RELASZ:
+	      /* Don't count procedure linkage table relocs in the
+		 overall reloc count.  */
+	      if (htab->srelplt != NULL)
+		{
+		  s = htab->srelplt->output_section;
+		  if (s->_cooked_size != 0)
+		    dyn.d_un.d_val -= s->_cooked_size;
+		  else
+		    dyn.d_un.d_val -= s->_raw_size;
+		}
 	      break;
 	    }