Revert part "Set dynamic tag VMA and size from dynamic section when possible"

Alan Modra amodra@gmail.com
Mon Oct 31 03:32:00 GMT 2016


This fixes the PR, but I intend to make a further patch when I get
back from vacation.  If we add a flag to elf_backend_data that says
whether DT_RELA/DT_RELASZ includes PLT relocs, most DT_RELA and
DT_RELASZ target handling should be unnecessary.

	PR 20748
	* elf32-microblaze.c (microblaze_elf_finish_dynamic_sections): Revert
	2016-05-13 change.

diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
index 477e7b3..5c66808 100644
--- a/bfd/elf32-microblaze.c
+++ b/bfd/elf32-microblaze.c
@@ -3396,13 +3396,13 @@ microblaze_elf_finish_dynamic_sections (bfd *output_bfd,
             {
               asection *s;
 
-              s = bfd_get_linker_section (dynobj, name);
+              s = bfd_get_section_by_name (output_bfd, name);
               if (s == NULL)
                 dyn.d_un.d_val = 0;
               else
                 {
                   if (! size)
-                    dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
+                    dyn.d_un.d_ptr = s->vma;
                   else
                     dyn.d_un.d_val = s->size;
                 }

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list