[GOLD] Correct powerpc64 ifunc plt entry test
authorAlan Modra <amodra@gmail.com>
Thu, 22 Jan 2015 02:09:50 +0000 (12:39 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 22 Jan 2015 05:12:45 +0000 (15:42 +1030)
Found when attempting to build an ELFv2 Linux kernel.  We don't
generally need a plt entry for ELFv2 got relocs, only on ifunc, just
like ppc32.

* powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
condition for need of ifunc plt entry.
(Target_powerpc::Scan::global <got relocs>): Likewise.

gold/ChangeLog
gold/powerpc.cc

index 9a52a3e86d140e709ebed25e074ccd14c1327ff3..48f46ce9f6f4b143aae13aea429f322fb2fc92b0 100644 (file)
@@ -1,3 +1,9 @@
+2015-01-22  Alan Modra  <amodra@gmail.com>
+
+       * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
+       condition for need of ifunc plt entry.
+       (Target_powerpc::Scan::global <got relocs>): Likewise.
+
 2015-01-14  Sasa Stankovic  <Sasa.Stankovic@imgtec.com>
 
        * mips.cc (reloc_high): Add r_sym.
index 04f24212ad710970210be304beb7fe10a6fcf623..2eae938ca6ebe0857b95bb9b92119223d9d2e9e3 100644 (file)
@@ -5671,8 +5671,8 @@ Target_powerpc<size, big_endian>::Scan::local(
 
        if (!parameters->options().output_is_position_independent())
          {
-           if ((size == 32 && is_ifunc)
-               || (size == 64 && target->abiversion() >= 2))
+           if (is_ifunc
+               && (size == 32 || target->abiversion() >= 2))
              got->add_local_plt(object, r_sym, GOT_TYPE_STANDARD);
            else
              got->add_local(object, r_sym, GOT_TYPE_STANDARD);
@@ -6119,8 +6119,8 @@ Target_powerpc<size, big_endian>::Scan::global(
        got = target->got_section(symtab, layout);
        if (gsym->final_value_is_known())
          {
-           if ((size == 32 && is_ifunc)
-               || (size == 64 && target->abiversion() >= 2))
+           if (is_ifunc
+               && (size == 32 || target->abiversion() >= 2))
              got->add_global_plt(gsym, GOT_TYPE_STANDARD);
            else
              got->add_global(gsym, GOT_TYPE_STANDARD);