This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

The ELF/HPPA linker is broken.


I got

/export/build/gnu/binutils/build-hppa-linux/ld/ld-new  -o tmpdir/weak  -T /home/
hjl/work/linux/import/binutils/ld/testsuite/ld-scripts/weak.t tmpdir/weak1.o tmp
dir/weak2.o
child killed: segmentation violation
FAIL: weak symbols

Here is a patch.


H.J.
---
2001-06-29  H.J. Lu  <hjl@gnu.org>

	* elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Check
	if hplink->sgot is NULL before filling GOT. Checck if hplink->splt
	is NULL before filling PLT.

Index: elf32-hppa.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf32-hppa.c,v
retrieving revision 1.31
diff -u -p -r1.31 elf32-hppa.c
--- elf32-hppa.c	2001/06/29 18:25:44	1.31
+++ elf32-hppa.c	2001/06/29 20:43:30
@@ -4334,7 +4334,7 @@ elf32_hppa_finish_dynamic_sections (outp
 	}
     }
 
-  if (hplink->sgot->_raw_size != 0)
+  if (hplink->sgot != NULL && hplink->sgot->_raw_size != 0)
     {
       /* Fill in the first entry in the global offset table.
 	 We use it to point to our dynamic section, if we have one.  */
@@ -4352,7 +4352,7 @@ elf32_hppa_finish_dynamic_sections (outp
 	->this_hdr.sh_entsize = GOT_ENTRY_SIZE;
     }
 
-  if (hplink->splt->_raw_size != 0)
+  if (hplink->splt != NULL && hplink->splt->_raw_size != 0)
     {
       /* Set plt entry size.  */
       elf_section_data (hplink->splt->output_section)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]