Correct handling of GOT references in a regular object.
[deliverable/binutils-gdb.git] / gold / i386.cc
index dcbb839ce1bb28ddd1cb91f8ae0dd0f3cdd66b36..eae6b7fa3397bf9efc1e1b369f81d0e712ccf401 100644 (file)
@@ -1046,9 +1046,10 @@ Target_i386::Scan::global(const General_options& options,
             if (!gsym->final_value_is_known())
               {
                 Reloc_section* rel_dyn = target->rel_dyn_section(layout);
-                if (gsym->is_preemptible())
-                    rel_dyn->add_global(gsym, elfcpp::R_386_GLOB_DAT, got,
-                                        gsym->got_offset());
+                if (gsym->is_from_dynobj()
+                   || gsym->is_preemptible())
+                 rel_dyn->add_global(gsym, elfcpp::R_386_GLOB_DAT, got,
+                                     gsym->got_offset());
                 else
                   {
                     rel_dyn->add_local(object, 0, elfcpp::R_386_RELATIVE,
This page took 0.023591 seconds and 4 git commands to generate.