elf32-arm.c (elf32_arm_tls_relax): Note fixme pointed out by AlanM
[deliverable/binutils-gdb.git] / gold / copy-relocs.cc
index 9544c811e1fba0feb037f1123069b3e04f708d42..4931aa06b659c1694d929a21433a951b2240322e 100644 (file)
@@ -60,7 +60,7 @@ Copy_relocs<sh_type, size, big_endian>::copy_reloc(
     Sized_symbol<size>* sym,
     Sized_relobj<size, big_endian>* object,
     unsigned int shndx,
-    Output_section *output_section,
+    Output_sectionoutput_section,
     const Reloc& rel,
     Output_data_reloc<sh_type, true, size, big_endian>* reloc_section)
 {
@@ -125,8 +125,17 @@ Copy_relocs<sh_type, size, big_endian>::emit_copy_reloc(
   bool is_ordinary;
   unsigned int shndx = sym->shndx(&is_ordinary);
   gold_assert(is_ordinary);
-  typename elfcpp::Elf_types<size>::Elf_WXword addralign =
-    sym->object()->section_addralign(shndx);
+  typename elfcpp::Elf_types<size>::Elf_WXword addralign;
+
+  {
+    // Lock the object so we can read from it.  This is only called
+    // single-threaded from scan_relocs, so it is OK to lock.
+    // Unfortunately we have no way to pass in a Task token.
+    const Task* dummy_task = reinterpret_cast<const Task*>(-1);
+    Object* obj = sym->object();
+    Task_lock_obj<Object> tl(dummy_task, obj);
+    addralign = obj->section_addralign(shndx);
+  }
 
   typename Sized_symbol<size>::Value_type value = sym->value();
   while ((value & (addralign - 1)) != 0)
This page took 0.024267 seconds and 4 git commands to generate.