Use relative relocation for R_X86_64_32 on x32
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 3 Sep 2013 17:38:57 +0000 (17:38 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 3 Sep 2013 17:38:57 +0000 (17:38 +0000)
2013-09-03  Pavel Chupin  <pavel.v.chupin@intel.com>

PR gold/15927
* x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
relocation for R_X86_64_32 on x32.

gold/ChangeLog
gold/x86_64.cc

index df61e9ccbd6488e2ab7d928f02b926c3dc87512d..ed8105d0229fa1304e2dde8f1c9948c56fdfd7a4 100644 (file)
@@ -1,3 +1,9 @@
+2013-09-03  Pavel Chupin  <pavel.v.chupin@intel.com>
+
+       PR gold/15927
+       * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
+       relocation for R_X86_64_32 on x32.
+
 2013-08-27  Roland McGrath  <mcgrathr@google.com>
 
        * output.cc (Output_segment::set_section_addresses): Take new
index dca6022271530b67722b3f166d83b27471f6ac97..5bf78fdef7fb40264b56dd295bec1f8652df8941 100644 (file)
@@ -2742,7 +2742,8 @@ Target_x86_64<size>::Scan::global(Symbol_table* symtab,
                                                       reloc.get_r_offset(),
                                                       reloc.get_r_addend());
              }
-           else if (r_type == elfcpp::R_X86_64_64
+           else if (((size == 64 && r_type == elfcpp::R_X86_64_64)
+                     || (size == 32 && r_type == elfcpp::R_X86_64_32))
                     && gsym->can_use_relative_reloc(false))
              {
                Reloc_section* rela_dyn = target->rela_dyn_section(layout);