[binutils-gdb] [PowerPC64] Use STN_UNDEF internally for edited relocs

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[binutils-gdb] [PowerPC64] Use STN_UNDEF internally for edited relocs

gdb-buildbot
*** TEST RESULTS FOR COMMIT 71c4e95abe66ec9fc2c064268e3f9640a5b951d8 ***

commit 71c4e95abe66ec9fc2c064268e3f9640a5b951d8
Author:     Alan Modra <[hidden email]>
AuthorDate: Thu Jul 18 11:12:40 2019 +0930
Commit:     Alan Modra <[hidden email]>
CommitDate: Thu Jul 18 22:17:30 2019 +0930

    [PowerPC64] Use STN_UNDEF internally for edited relocs
   
    It's not correct to use non-STT_TLS symbols with TLS relocation, not
    that it matters much when editing relocs, but this edited reloc can be
    output by --emit-relocs.  So don't use a symbol on the reloc.
   
            * elf64-ppc.c (ppc64_elf_relocate_section): Don't bother selecting
            a TLS section symbol for edited relocs.  Tighten TLS symbol/reloc
            match test.

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index eb64f86389..a9dce78afc 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2019-07-18  Alan Modra  <[hidden email]>
+
+ * elf64-ppc.c (ppc64_elf_relocate_section): Don't bother selecting
+ a TLS section symbol for edited relocs.  Tighten TLS symbol/reloc
+ match test.
+
 2019-07-18  Alan Modra  <[hidden email]>
 
  * elf64-ppc.c (TLS_EXPLICIT): Define as 256.
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 0c0d4a4c13..df4a12c58d 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -14304,10 +14304,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
   && (h == NULL
       || h->elf.root.type == bfd_link_hash_defined
       || h->elf.root.type == bfd_link_hash_defweak)
-  && (IS_PPC64_TLS_RELOC (r_type)
-      != (sym_type == STT_TLS
-  || (sym_type == STT_SECTION
-      && (sec->flags & SEC_THREAD_LOCAL) != 0))))
+  && IS_PPC64_TLS_RELOC (r_type) != (sym_type == STT_TLS))
  {
   if ((tls_mask & TLS_TLS) != 0
       && (r_type == R_PPC64_TLS
@@ -14547,20 +14544,8 @@ ppc64_elf_relocate_section (bfd *output_bfd,
   if (tls_gd == 0)
     {
       /* Was an LD reloc.  */
-      if (toc_symndx)
- sec = local_sections[toc_symndx];
-      for (r_symndx = 0;
-   r_symndx < symtab_hdr->sh_info;
-   r_symndx++)
- if (local_sections[r_symndx] == sec)
-  break;
-      if (r_symndx >= symtab_hdr->sh_info)
- r_symndx = STN_UNDEF;
+      r_symndx = STN_UNDEF;
       rel->r_addend = htab->elf.tls_sec->vma + DTP_OFFSET;
-      if (r_symndx != STN_UNDEF)
- rel->r_addend -= (local_syms[r_symndx].st_value
-  + sec->output_offset
-  + sec->output_section->vma);
     }
   else if (toc_symndx != 0)
     {
@@ -14669,24 +14654,12 @@ ppc64_elf_relocate_section (bfd *output_bfd,
       if (ELF64_R_TYPE (rel[1].r_info) == R_PPC64_PLTCALL)
  bfd_put_32 (output_bfd, NOP, contents + offset + 4);
 
-      if (toc_symndx)
- sec = local_sections[toc_symndx];
-      for (r_symndx = 0;
-   r_symndx < symtab_hdr->sh_info;
-   r_symndx++)
- if (local_sections[r_symndx] == sec)
-  break;
-      if (r_symndx >= symtab_hdr->sh_info)
- r_symndx = STN_UNDEF;
-      rel->r_addend = htab->elf.tls_sec->vma + DTP_OFFSET;
-      if (r_symndx != STN_UNDEF)
- rel->r_addend -= (local_syms[r_symndx].st_value
-  + sec->output_offset
-  + sec->output_section->vma);
-
+      rel->r_offset = offset + d_offset;
+      r_symndx = STN_UNDEF;
       r_type = R_PPC64_TPREL16_LO;
       rel->r_info = ELF64_R_INFO (r_symndx, r_type);
-      rel->r_offset = offset + d_offset;
+      rel->r_addend = htab->elf.tls_sec->vma + DTP_OFFSET;
+
       /* Zap the reloc on the _tls_get_addr call too.  */
       BFD_ASSERT (offset == rel[1].r_offset);
       rel[1].r_info = ELF64_R_INFO (STN_UNDEF, R_PPC64_NONE);
Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-i686, branch master

gdb-buildbot
Buildername:
        Fedora-i686

Worker:
        fedora-x86-64-3

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/18/builds/335

Author:
        Alan Modra <[hidden email]>

Commit tested:
        71c4e95abe66ec9fc2c064268e3f9640a5b951d8

Subject of commit:
        [PowerPC64] Use STN_UNDEF internally for edited relocs

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-i686/71/71c4e95abe66ec9fc2c064268e3f9640a5b951d8/

*** Diff to previous build ***
==============================================
PASS -> KFAIL: gdb.threads/non-ldr-exit.exp: program exits normally
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-i686/71/71c4e95abe66ec9fc2c064268e3f9640a5b951d8//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-i686/71/71c4e95abe66ec9fc2c064268e3f9640a5b951d8//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-m32, branch master

gdb-buildbot
In reply to this post by gdb-buildbot
Buildername:
        Fedora-x86_64-m32

Worker:
        fedora-x86-64-1

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/17/builds/332

Author:
        Alan Modra <[hidden email]>

Commit tested:
        71c4e95abe66ec9fc2c064268e3f9640a5b951d8

Subject of commit:
        [PowerPC64] Use STN_UNDEF internally for edited relocs

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-m32/71/71c4e95abe66ec9fc2c064268e3f9640a5b951d8/

*** Diff to previous build ***
==============================================
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=1: inferior 1 exited
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=1: inferior 1 exited
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-m32/71/71c4e95abe66ec9fc2c064268e3f9640a5b951d8//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-m32/71/71c4e95abe66ec9fc2c064268e3f9640a5b951d8//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-m64, branch master

gdb-buildbot
In reply to this post by gdb-buildbot
Buildername:
        Fedora-x86_64-m64

Worker:
        fedora-x86-64-2

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/3/builds/357

Author:
        Alan Modra <[hidden email]>

Commit tested:
        71c4e95abe66ec9fc2c064268e3f9640a5b951d8

Subject of commit:
        [PowerPC64] Use STN_UNDEF internally for edited relocs

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-m64/71/71c4e95abe66ec9fc2c064268e3f9640a5b951d8/

*** Diff to previous build ***
==============================================
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=1: inferior 1 exited
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-m64/71/71c4e95abe66ec9fc2c064268e3f9640a5b951d8//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-m64/71/71c4e95abe66ec9fc2c064268e3f9640a5b951d8//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-native-extended-gdbserver-m32, branch master

gdb-buildbot
In reply to this post by gdb-buildbot
Buildername:
        Fedora-x86_64-native-extended-gdbserver-m32

Worker:
        fedora-x86-64-3

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/4/builds/332

Author:
        Alan Modra <[hidden email]>

Commit tested:
        71c4e95abe66ec9fc2c064268e3f9640a5b951d8

Subject of commit:
        [PowerPC64] Use STN_UNDEF internally for edited relocs

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m32/71/71c4e95abe66ec9fc2c064268e3f9640a5b951d8/

*** Diff to previous build ***
==============================================
PASS -> UNRESOLVED: gdb.threads/attach-into-signal.exp: threaded: attach
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=1: inferior 1 exited
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m32/71/71c4e95abe66ec9fc2c064268e3f9640a5b951d8//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m32/71/71c4e95abe66ec9fc2c064268e3f9640a5b951d8//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-native-extended-gdbserver-m64, branch master

gdb-buildbot
In reply to this post by gdb-buildbot
Buildername:
        Fedora-x86_64-native-extended-gdbserver-m64

Worker:
        fedora-x86-64-4

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/2/builds/334

Author:
        Alan Modra <[hidden email]>

Commit tested:
        71c4e95abe66ec9fc2c064268e3f9640a5b951d8

Subject of commit:
        [PowerPC64] Use STN_UNDEF internally for edited relocs

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m64/71/71c4e95abe66ec9fc2c064268e3f9640a5b951d8/

*** Diff to previous build ***
==============================================
PASS -> UNRESOLVED: gdb.threads/attach-into-signal.exp: threaded: attach
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=1: inferior 1 exited
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m64/71/71c4e95abe66ec9fc2c064268e3f9640a5b951d8//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m64/71/71c4e95abe66ec9fc2c064268e3f9640a5b951d8//xfail.table.gz>