Bug 1523946

Summary: [ppc64] ld switch to relro breaks GDB
Product: Red Hat Enterprise Linux 7 Reporter: Jan Kratochvil <jan.kratochvil>
Component: binutilsAssignee: Nick Clifton <nickc>
Status: CLOSED WORKSFORME QA Contact: qe-baseos-tools-bugs
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: fweimer, jan.kratochvil, jridky, law, lmiksik, mcermak, mkolar, nickc, ohudlick
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: ppc64   
OS: Linux   
Whiteboard:
Fixed In Version: binutils-2.27-27.base.el7 Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-25 16:50:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1522798    

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 Bug 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