* elf32-xtensa.c (relax_section): Update DIFF relocations in the
authorBob Wilson <bob.wilson@acm.org>
Fri, 21 Dec 2007 23:11:28 +0000 (23:11 +0000)
committerBob Wilson <bob.wilson@acm.org>
Fri, 21 Dec 2007 23:11:28 +0000 (23:11 +0000)
same way as other relocations.

bfd/ChangeLog
bfd/elf32-xtensa.c

index 0759d0b5d558eed9677d42efdae82bb0a440bebe..bd611041f882238a1e69dc3076b52bfb9e4a4b15 100644 (file)
@@ -1,3 +1,8 @@
+2007-12-21  Bob Wilson  <bob.wilson@acm.org>
+
+       * elf32-xtensa.c (relax_section): Update DIFF relocations in the
+       same way as other relocations.
+       
 2007-12-18  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * section.c (BFD_FAKE_SECTION): Update.
index a1c608872fe4676e6c00cd343a6777b9069ef675..d9f2aa25c9ce94384522793603f47a7faa1219bb 100644 (file)
@@ -8240,30 +8240,28 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
 
                  pin_contents (sec, contents);
                }
+
+             /* If the relocation still references a section in the same
+                input file, modify the relocation directly instead of
+                adding a "fix" record.  */
+             if (target_sec->owner == abfd)
+               {
+                 unsigned r_symndx = ELF32_R_SYM (new_reloc.rela.r_info);
+                 irel->r_info = ELF32_R_INFO (r_symndx, r_type);
+                 irel->r_addend = new_reloc.rela.r_addend;
+                 pin_internal_relocs (sec, internal_relocs);
+               }
              else
                {
-                 /* If the relocation still references a section in the same
-                    input file, modify the relocation directly instead of
-                    adding a "fix" record.  */
-                 if (target_sec->owner == abfd)
-                   {
-                     unsigned r_symndx = ELF32_R_SYM (new_reloc.rela.r_info);
-                     irel->r_info = ELF32_R_INFO (r_symndx, r_type);
-                     irel->r_addend = new_reloc.rela.r_addend;
-                     pin_internal_relocs (sec, internal_relocs);
-                   }
-                 else
-                   {
-                     bfd_vma addend_displacement;
-                     reloc_bfd_fix *fix;
-
-                     addend_displacement =
-                       new_reloc.target_offset + new_reloc.virtual_offset;
-                     fix = reloc_bfd_fix_init (sec, source_offset, r_type,
-                                               target_sec,
-                                               addend_displacement, TRUE);
-                     add_fix (sec, fix);
-                   }
+                 bfd_vma addend_displacement;
+                 reloc_bfd_fix *fix;
+
+                 addend_displacement =
+                   new_reloc.target_offset + new_reloc.virtual_offset;
+                 fix = reloc_bfd_fix_init (sec, source_offset, r_type,
+                                           target_sec,
+                                           addend_displacement, TRUE);
+                 add_fix (sec, fix);
                }
            }
        }