Bug 1523946 - [ppc64] ld switch to relro breaks GDB
Summary: [ppc64] ld switch to relro breaks GDB
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: binutils
Version: 7.5
Hardware: ppc64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Nick Clifton
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks: Red Hat1522798
TreeView+ depends on / blocked
 
Reported: 2017-12-09 11:15 UTC by Jan Kratochvil
Modified: 2020-02-25 16:50 UTC (History)
9 users (show)

Fixed In Version: binutils-2.27-27.base.el7
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2020-02-25 16:50:58 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Sourceware 22576 0 P2 RESOLVED ppc64_skip_trampoline_code uses wrong r2 for EXEC_REVERSE 2020-02-24 12:25:57 UTC

Description Jan Kratochvil 2017-12-09 11:15:02 UTC
Description of problem:
RHEL-7.5 binutils has been rebased:
  RHBA-2017:30118-01 binutils bug fix and enhancement update
  https://errata.devel.redhat.com/advisory/30118
  binutils-2.25.1-31.base.el7.ppc64 -> binutils-2.27-21.base.el7.ppc64

The rebase includes upstream commit:
647e4d46495f2bfb0950fd1066c8a660173cca40 is the first bad commit
commit 647e4d46495f2bfb0950fd1066c8a660173cca40
Author: H.J. Lu <hjl.tools>
Date:   Wed Jun 22 05:37:24 2016 -0700
    ld: Add a linker configure option --enable-relro

Which made relro the default on various targets incl. ppc64.
binutils.spec now even contains explicit override for all arches:
+# Default to read-only-relocations (relro) in shared binaries.
+%define default_relro 1

I haven't seen any request for relro in the Bugs listed for the binutils errata, was there?  Other binary tools were not ready for relro when it became default upstream in 2016-06 as RHEL-7.0 is from 2014.

Still even trunk GDB cannot handle ppc64 relro properly as I have filed now:
  ppc64: gdbarch_skip_trampoline_code fails for relro
  https://sourceware.org/bugzilla/show_bug.cgi?id=22576

I believe the default relro setting should remain the same as in RHEL-7.4.

Version-Release number of selected component (if applicable):
PASS: binutils-2.25.1-31.base.el7.ppc64
FAIL: binutils-2.27-21.base.el7.ppc64

How reproducible:
Always.

Steps to Reproduce:
1. GDB: runtest gdb.reverse/solib-precsave.exp

Actual results:
FAIL: gdb.reverse/solib-precsave.exp: reverse-step back to main one
FAIL: gdb.reverse/solib-precsave.exp: reverse-step into solib function two
FAIL: gdb.reverse/solib-precsave.exp: reverse-step within solib function two
FAIL: gdb.reverse/solib-precsave.exp: reverse-step back to main two
FAIL: gdb.reverse/solib-precsave.exp: run until end part two
FAIL: gdb.reverse/solib-precsave.exp: reverse-next over solib function one

Expected results:
Testfile reports PASS.

Additional info:

Comment 2 Nick Clifton 2017-12-12 17:09:18 UTC
Hi Jan,

  This was a snafu.  When I reviewed the patches for the RHEL binutils I noticed
  that we had a patch to enable relro by default.  Since there is now a configure
  option that does the same thing, there was no need for the patch.  So I removed
  it and added the code to the binutils.spec file.  Unfortunately I totally
  forgot about the PowerPC64's problems.  Especially since relro is enabled by
  default for PowerPC64 in the FSF binutils sources.

  Anyway I have checked in a patch to not enable relro by default for the
  PowerPC64, so please try out: binutils-2.27-22.base.el7

Cheers
  Nick

Comment 3 Jan Kratochvil 2017-12-12 17:30:51 UTC
Thanks, confirming binutils-2.27-22.base.el7.ppc64 does fix the GDB Red HatBug 1522798 regression.  I did not do more regression testing, up to QA.

Comment 5 Nick Clifton 2018-01-11 18:11:28 UTC
After some internal discussion it has been decided that this BZ is wrong.
RELRO support for PowerPC is enabled in RHEL 7.4 and it should continue
to be enabled in RHEL 7.5.  (The GDB problem was a separate bug that has
now been fixed).  So I am reverting the patch previously applied for this
BZ.  The binutils-2.27-27.base.el7 rpm now contains this change.

Comment 11 Fedora Update System 2018-03-08 14:21:10 UTC
binutils-2.29-13.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-1e994c659e

Comment 12 Fedora Update System 2018-03-08 16:24:34 UTC
binutils-2.29-13.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-1e994c659e

Comment 13 Nick Clifton 2020-02-25 16:50:58 UTC
reclosed


Note You need to log in before you can comment on or make changes to this bug.