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]

[Xtensa] fix dynamic tags


My change from 2007-02-02 to record sections in a hash table broke the dynamic tags for Xtensa. The vma needs to come from the output section. Committed on mainline.

2007-07-18  Bob Wilson  <bob.wilson@acm.org>
	
	* elf32-xtensa.c (elf_xtensa_finish_dynamic_sections): Get section
	vma and size for dynamic tags from the output sections.
Index: elf32-xtensa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-xtensa.c,v
retrieving revision 1.91
diff -u -p -r1.91 elf32-xtensa.c
--- elf32-xtensa.c	3 Jul 2007 14:26:41 -0000	1.91
+++ elf32-xtensa.c	18 Jul 2007 17:56:43 -0000
@@ -2649,19 +2649,19 @@ elf_xtensa_finish_dynamic_sections (bfd 
 	  break;
 
 	case DT_XTENSA_GOT_LOC_OFF:
-	  dyn.d_un.d_ptr = htab->sgotloc->vma;
+	  dyn.d_un.d_ptr = htab->sgotloc->output_section->vma;
 	  break;
 
 	case DT_PLTGOT:
-	  dyn.d_un.d_ptr = htab->sgot->vma;
+	  dyn.d_un.d_ptr = htab->sgot->output_section->vma;
 	  break;
 
 	case DT_JMPREL:
-	  dyn.d_un.d_ptr = htab->srelplt->vma;
+	  dyn.d_un.d_ptr = htab->srelplt->output_section->vma;
 	  break;
 
 	case DT_PLTRELSZ:
-	  dyn.d_un.d_val = htab->srelplt->size;
+	  dyn.d_un.d_val = htab->srelplt->output_section->size;
 	  break;
 
 	case DT_RELASZ:
@@ -2672,7 +2672,7 @@ elf_xtensa_finish_dynamic_sections (bfd 
 	     for .rela.plt to follow all other relocation sections, we
 	     don't have to worry about changing the DT_RELA entry.  */
 	  if (htab->srelplt)
-	    dyn.d_un.d_val -= htab->srelplt->size;
+	    dyn.d_un.d_val -= htab->srelplt->output_section->size;
 	  break;
 	}
 

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