* elf32-bfin.c (bfinfdpic_relocate_section): Clear reloc for
authorJie Zhang <jie.zhang@analog.com>
Tue, 23 May 2006 05:45:22 +0000 (05:45 +0000)
committerJie Zhang <jie.zhang@analog.com>
Tue, 23 May 2006 05:45:22 +0000 (05:45 +0000)
deteted entries in .eh_frame section.

bfd/ChangeLog
bfd/elf32-bfin.c

index 40920c63c3294de249d8ff1552a754cc221f1bad..b6c2c771440a761b070b3c476d0efa901e44533c 100644 (file)
@@ -1,3 +1,8 @@
+2006-05-23  Jie Zhang  <jie.zhang@analog.com>
+
+       * elf32-bfin.c (bfinfdpic_relocate_section): Clear reloc for
+       deteted entries in .eh_frame section.
+
 2006-05-23  Jie Zhang  <jie.zhang@analog.com>
 
        * elf32-bfin.c (bfin_check_relocs): Use __GLOBAL_OFFSET_TABLE_
index 5d6e1e1825c4132fabbfd796beff990f64a18fe1..ba6bc62528921b2aa5c1b3eead649ff7d95b6cf0 100644 (file)
@@ -2435,6 +2435,8 @@ bfinfdpic_relocate_section (bfd * output_bfd,
                                                 input_section->output_section)
                          & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
                  {
+                   bfd_vma offset;
+
                    if (_bfinfdpic_osec_readonly_p (output_bfd,
                                                   input_section
                                                   ->output_section))
@@ -2445,15 +2447,23 @@ bfinfdpic_relocate_section (bfd * output_bfd,
                           name, input_bfd, input_section, rel->r_offset);
                        return FALSE;
                      }
-                   _bfinfdpic_add_dyn_reloc (output_bfd,
-                                             bfinfdpic_gotrel_section (info),
-                                             _bfd_elf_section_offset
-                                             (output_bfd, info,
-                                              input_section, rel->r_offset)
-                                             + input_section
-                                             ->output_section->vma
-                                             + input_section->output_offset,
-                                             r_type, dynindx, addend, picrel);
+                   offset = _bfd_elf_section_offset (output_bfd, info,
+                                                     input_section, rel->r_offset);
+                   /* Only output a reloc for a not deleted entry.  */
+                   if (offset >= (bfd_vma) -2)
+                     _bfinfdpic_add_dyn_reloc (output_bfd,
+                                               bfinfdpic_gotrel_section (info),
+                                               0,
+                                               R_unused0,
+                                               dynindx, addend, picrel);
+                   else
+                     _bfinfdpic_add_dyn_reloc (output_bfd,
+                                               bfinfdpic_gotrel_section (info),
+                                               offset + input_section
+                                               ->output_section->vma
+                                               + input_section->output_offset,
+                                               r_type,
+                                               dynindx, addend, picrel);
                  }
                else
                  addend += bfinfdpic_got_section (info)->output_section->vma;