2004-02-25 H.J. Lu <hongjiu.lu@intel.com>
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 26 Feb 2004 03:54:06 +0000 (03:54 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 26 Feb 2004 03:54:06 +0000 (03:54 +0000)
* elfxx-ia64.c (elfNN_ia64_dyn_reloc_entry): Add the reltext.
field to track if a relocation is against readonly section.
(count_dyn_reloc): Take a new argument for rent->reltext.
(elfNN_ia64_check_relocs): Adjust call to count_dyn_reloc.
(get_reloc_section): Don't set ia64_info->reltext here.
(allocate_dynrel_entries): Set ia64_info->reltext here.

bfd/ChangeLog
bfd/elfxx-ia64.c

index 0ccab082a5c9cf0efb2b8928c11c518b72e5a35d..6aadd114889849f6f61e59bf4113b6a1221b0778 100644 (file)
@@ -1,3 +1,12 @@
+2004-02-25  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elfxx-ia64.c (elfNN_ia64_dyn_reloc_entry): Add the reltext.
+       field to track if a relocation is against readonly section.
+       (count_dyn_reloc): Take a new argument for rent->reltext.
+       (elfNN_ia64_check_relocs): Adjust call to count_dyn_reloc.
+       (get_reloc_section): Don't set ia64_info->reltext here.
+       (allocate_dynrel_entries): Set ia64_info->reltext here.
+
 2004-02-24  Alexandre Oliva  <aoliva@redhat.com>
 
        * elf32-frv.c (FRV_SYM_LOCAL): Weak undefined doesn't imply local.
index e223a10e09bc4ef47b7943de9272e12e802b4b97..332e361024bfa64e670a59a651755ebd5107be10 100644 (file)
@@ -92,6 +92,9 @@ struct elfNN_ia64_dyn_sym_info
     asection *srel;
     int type;
     int count;
+
+    /* Is this reloc against readonly section? */
+    bfd_boolean reltext;
   } *reloc_entries;
 
   /* TRUE when the section contents have been updated.  */
@@ -243,9 +246,6 @@ static asection *get_pltoff
 static asection *get_reloc_section
   PARAMS ((bfd *abfd, struct elfNN_ia64_link_hash_table *ia64_info,
           asection *sec, bfd_boolean create));
-static bfd_boolean count_dyn_reloc
-  PARAMS ((bfd *abfd, struct elfNN_ia64_dyn_sym_info *dyn_i,
-          asection *srel, int type));
 static bfd_boolean elfNN_ia64_check_relocs
   PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *sec,
           const Elf_Internal_Rela *relocs));
@@ -2175,18 +2175,12 @@ get_reloc_section (abfd, ia64_info, sec, create)
        return NULL;
     }
 
-  if (sec->flags & SEC_READONLY)
-    ia64_info->reltext = 1;
-
   return srel;
 }
 
 static bfd_boolean
-count_dyn_reloc (abfd, dyn_i, srel, type)
-     bfd *abfd;
-     struct elfNN_ia64_dyn_sym_info *dyn_i;
-     asection *srel;
-     int type;
+count_dyn_reloc (bfd *abfd, struct elfNN_ia64_dyn_sym_info *dyn_i,
+                asection *srel, int type, bfd_boolean reltext)
 {
   struct elfNN_ia64_dyn_reloc_entry *rent;
 
@@ -2207,6 +2201,7 @@ count_dyn_reloc (abfd, dyn_i, srel, type)
       rent->count = 0;
       dyn_i->reloc_entries = rent;
     }
+  rent->reltext = reltext;
   rent->count++;
 
   return TRUE;
@@ -2491,7 +2486,8 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
              if (!srel)
                return FALSE;
            }
-         if (!count_dyn_reloc (abfd, dyn_i, srel, dynrel_type))
+         if (!count_dyn_reloc (abfd, dyn_i, srel, dynrel_type,
+                               (sec->flags & SEC_READONLY)))
            return FALSE;
        }
     }
@@ -2798,6 +2794,8 @@ allocate_dynrel_entries (dyn_i, data)
        default:
          abort ();
        }
+      if (rent->reltext)
+       ia64_info->reltext = 1;
       rent->srel->_raw_size += sizeof (ElfNN_External_Rela) * count;
     }
 
This page took 0.027818 seconds and 4 git commands to generate.