* elf.c (_bfd_elf_rela_local_sym): Accept asection **, and return
[deliverable/binutils-gdb.git] / bfd / elf.c
index 77fdfa1b0431373d36126b27d3a03254988a6060..e008cb7bd6dc50f1e0edfb48e395bd07181d3aaa 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1444,7 +1444,8 @@ _bfd_elf_link_hash_table_init
   memset (&table->eh_info, 0, sizeof (table->eh_info));
   table->dynlocal = NULL;
   table->runpath = NULL;
-  table->tls_segment = NULL;
+  table->tls_sec = NULL;
+  table->tls_size = 0;
   table->loaded = NULL;
 
   ret = _bfd_link_hash_table_init (&table->root, abfd, newfunc);
@@ -6095,7 +6096,7 @@ _bfd_elf_sizeof_headers (bfd *abfd, bfd_boolean reloc)
 bfd_boolean
 _bfd_elf_set_section_contents (bfd *abfd,
                               sec_ptr section,
-                              void *location,
+                              const void *location,
                               file_ptr offset,
                               bfd_size_type count)
 {
@@ -6239,7 +6240,7 @@ _bfd_elf_close_and_cleanup (bfd *abfd)
 bfd_reloc_status_type
 _bfd_elf_rel_vtable_reloc_fn
   (bfd *abfd ATTRIBUTE_UNUSED, arelent *re ATTRIBUTE_UNUSED,
-   struct symbol_cache_entry *symbol ATTRIBUTE_UNUSED,
+   struct bfd_symbol *symbol ATTRIBUTE_UNUSED,
    void *data ATTRIBUTE_UNUSED, asection *is ATTRIBUTE_UNUSED,
    bfd *obfd ATTRIBUTE_UNUSED, char **errmsg ATTRIBUTE_UNUSED)
 {
@@ -7367,9 +7368,10 @@ _bfd_elf_reloc_type_class (const Elf_Internal_Rela *rela ATTRIBUTE_UNUSED)
 bfd_vma
 _bfd_elf_rela_local_sym (bfd *abfd,
                         Elf_Internal_Sym *sym,
-                        asection *sec,
+                        asection **psec,
                         Elf_Internal_Rela *rel)
 {
+  asection *sec = *psec;
   bfd_vma relocation;
 
   relocation = (sec->output_section->vma
@@ -7379,16 +7381,14 @@ _bfd_elf_rela_local_sym (bfd *abfd,
       && ELF_ST_TYPE (sym->st_info) == STT_SECTION
       && sec->sec_info_type == ELF_INFO_TYPE_MERGE)
     {
-      asection *msec;
-
-      msec = sec;
       rel->r_addend =
-       _bfd_merged_section_offset (abfd, &msec,
+       _bfd_merged_section_offset (abfd, psec,
                                    elf_section_data (sec)->sec_info,
                                    sym->st_value + rel->r_addend,
-                                   0)
-       - relocation;
-      rel->r_addend += msec->output_section->vma + msec->output_offset;
+                                   0);
+      sec = *psec;
+      rel->r_addend -= relocation;
+      rel->r_addend += sec->output_section->vma + sec->output_offset;
     }
   return relocation;
 }
This page took 0.029364 seconds and 4 git commands to generate.