This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

A couple of frv fixes


Fixes the following
FAIL: ld-elf/orphan-region
FAIL: Weak symbols in dynamic objects 1 (main test)

bfd/
	* elf32-frv.c (elf32_frv_relocate_section): Set "name" for global syms.
	(elf32_frvfdpic_finish_dynamic_sections): Don't crash on
	__ROFIXUP_END__ defined in shared lib.
ld/testsuite/
	* ld-elf/orphan-region.d: xfail frv-*-*.

Index: bfd/elf32-frv.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-frv.c,v
retrieving revision 1.69
diff -u -p -r1.69 elf32-frv.c
--- bfd/elf32-frv.c	25 Aug 2010 14:53:41 -0000	1.69
+++ bfd/elf32-frv.c	11 Oct 2010 07:33:15 -0000
@@ -2770,7 +2770,7 @@ elf32_frv_relocate_section (output_bfd, 
       struct elf_link_hash_entry *h;
       bfd_vma relocation;
       bfd_reloc_status_type r;
-      const char * name = NULL;
+      const char *name;
       int r_type;
       asection *osec;
       struct frvfdpic_relocs_info *picrel;
@@ -2796,7 +2796,8 @@ elf32_frv_relocate_section (output_bfd, 
 
 	  name = bfd_elf_string_from_elf_section
 	    (input_bfd, symtab_hdr->sh_link, sym->st_name);
-	  name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+	  if (name == NULL || name[0] == 0)
+	    name = bfd_section_name (input_bfd, sec);
 	}
       else
 	{
@@ -2808,6 +2809,7 @@ elf32_frv_relocate_section (output_bfd, 
 				   h, sec, relocation,
 				   unresolved_reloc, warned);
 	  osec = sec;
+	  name = h->root.root.string;
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
@@ -5896,7 +5889,8 @@ elf32_frvfdpic_finish_dynamic_sections (
 				       FALSE, FALSE, TRUE);
 	  if (hend
 	      && (hend->type == bfd_link_hash_defined
-		  || hend->type == bfd_link_hash_defweak))
+		  || hend->type == bfd_link_hash_defweak)
+	      && hend->u.def.section->output_section != NULL)
 	    {
 	      bfd_vma value =
 		frvfdpic_gotfixup_section (info)->output_section->vma
Index: ld/testsuite/ld-elf/orphan-region.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-elf/orphan-region.d,v
retrieving revision 1.4
diff -u -p -r1.4 orphan-region.d
--- ld/testsuite/ld-elf/orphan-region.d	18 Sep 2010 02:30:41 -0000	1.4
+++ ld/testsuite/ld-elf/orphan-region.d	11 Oct 2010 07:33:53 -0000
@@ -3,9 +3,9 @@
 #readelf: -S -l --wide
 #xfail: arc-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
 #xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* or32-*-* pj*-*-*
-#xfail: spu-*-* hppa*64*-*-*
+#xfail: spu-*-* hppa*64*-*-* frv-*-*
 # if not using elf32.em, you don't get fancy orphan handling
-# spu twiddles LOAD range, hppa64 adds PHDR
+# spu twiddles LOAD range, hppa64 adds PHDR, frv-linux adds GNU_STACK
 
 #...
   \[[ 0-9]+\] \.text[ \t]+PROGBITS[ \t]+0*40000000[ \t]+.*

-- 
Alan Modra
Australia Development Lab, IBM


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