Bug 1748802

Summary: unknown program header entry type 0x6474e553
Product: Red Hat Enterprise Linux 8 Reporter: Martin Cermak <mcermak>
Component: elfutilsAssignee: Mark Wielaard <mjw>
elfutils sub component: system-version QA Contact: Martin Cermak <mcermak>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: fweimer, mjw, mnewsome, nickc
Version: 8.1Keywords: Bugfix
Target Milestone: rc   
Target Release: 8.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: elfutils-0.178-2.el8 Doc Type: No Doc Update
Doc Text:
No Doc Update
Story Points: ---
Clone Of:
: 1785332 1788646 (view as bug list) Environment:
Last Closed: 2020-04-28 16:58:18 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: 1785332, 1788646    
Attachments:
Description Flags
test logs none

Description Martin Cermak 2019-09-04 08:14:44 UTC
It turns out that with gcc-toolset-9-binutils-2.32-15.el8, 3 elfutils tests (coming from gcc-toolset-9-elfutils-0.176-5.el8.x86_64) fail.  They are: run-strip-strmerge.sh run-elflint-self.sh run-reverse-sections-self.sh.

>>> How to reproduce the FAIL(s): Install gcc-toolset-9-gcc-9.1.1-2.3.el8.x86_64 and gcc-toolset-9-binutils-2.32-15.el8.x86_64, run a shell with gcc-toolset-9 enabled, `rpmbuild -bc <the spec file of gcc-toolset-9-elfutils-0.176-5.el8.src.rpm>`, `make check TESTS='run-strip-strmerge.sh run-elflint-self.sh run-reverse-sections-self.sh'`  The failures are:


FAIL: run-strip-strmerge.sh
===========================

elflint /root/rpmbuild/BUILD/elfutils-0.176/tests/elfstrmerge
program header entry 9: unknown program header entry type 0x6474e553
FAIL run-strip-strmerge.sh (exit status: 1)

FAIL: run-elflint-self.sh
=========================

program header entry 9: unknown program header entry type 0x6474e553
*** failure in /root/rpmbuild/BUILD/elfutils-0.176/src/elflint --quiet --gnu-ld /root/rpmbuild/BUILD/elfutils-0.176/src/addr2line
program header entry 10: unknown program header entry type 0x6474e553
*** failure in /root/rpmbuild/BUILD/elfutils-0.176/src/elflint --quiet --gnu-ld /root/rpmbuild/BUILD/elfutils-0.176/src/elfcmp
program header entry 10: unknown program header entry type 0x6474e553
*** failure in /root/rpmbuild/BUILD/elfutils-0.176/src/elflint --quiet --gnu-ld /root/rpmbuild/BUILD/elfutils-0.176/src/objdump
program header entry 9: unknown program header entry type 0x6474e553
*** failure in /root/rpmbuild/BUILD/elfutils-0.176/src/elflint --quiet --gnu-ld /root/rpmbuild/BUILD/elfutils-0.176/src/readelf
program header entry 8: unknown program header entry type 0x6474e553
*** failure in /root/rpmbuild/BUILD/elfutils-0.176/src/elflint --quiet --gnu-ld /root/rpmbuild/BUILD/elfutils-0.176/libelf/libelf.so
program header entry 8: unknown program header entry type 0x6474e553
*** failure in /root/rpmbuild/BUILD/elfutils-0.176/src/elflint --quiet --gnu-ld /root/rpmbuild/BUILD/elfutils-0.176/libdw/libdw.so
program header entry 7: unknown program header entry type 0x6474e553
*** failure in /root/rpmbuild/BUILD/elfutils-0.176/src/elflint --quiet --gnu-ld /root/rpmbuild/BUILD/elfutils-0.176/backends/libebl_i386.so
program header entry 7: unknown program header entry type 0x6474e553
*** failure in /root/rpmbuild/BUILD/elfutils-0.176/src/elflint --quiet --gnu-ld /root/rpmbuild/BUILD/elfutils-0.176/backends/libebl_x86_64.so
FAIL run-elflint-self.sh (exit status: 1)

FAIL: run-reverse-sections-self.sh
==================================


copy_elf: /root/rpmbuild/BUILD/elfutils-0.176/src/addr2line -> addr2line.rev (read,reverse)
setshstrndx: 38
Swapping offsets of section 29 and 30
Swapping offsets of section 31 and 32
Swapping offsets of section 33 and 34
Swapping offsets of section 37 and 38
program header entry 9: unknown program header entry type 0x6474e553
FAIL run-reverse-sections-self.sh (exit status: 1)
=======

>>> How to get a PASS: Still in the ^^ shell with gcc-toolset-9 enabled, uninstall gcc-toolset-9-binutils, repeat `rpmbuild -bc`, and repeat `make check`.

Comment 1 Martin Cermak 2019-09-04 08:16:32 UTC
Created attachment 1611400 [details]
test logs

Comment 3 Mark Wielaard 2019-09-04 10:30:24 UTC
Seems to be caused by a newer binutils which inserts a new ELF Program header 0x6474e553.
This seems to be:
 #define PT_GNU_PROPERTY    (PT_LOOS + 0x474e553) /* GNU property */
Which is a binutils local define.

Nick, what is the idea behind this?
I cannot find any documentation on it.
glibc elf.h doesn't define it.
I cannot find anything that uses it.

Comment 4 Nick Clifton 2019-09-04 11:11:27 UTC
(In reply to Mark Wielaard from comment #3)
Hi Mark,

>  #define PT_GNU_PROPERTY    (PT_LOOS + 0x474e553) /* GNU property */
> Nick, what is the idea behind this?

It is an H.J. special.  Do I need to say more ? :-)

> I cannot find any documentation on it.

Check out H.J.'s Linux extensions page:
  https://github.com/hjl-tools/linux-abi/wiki/Linux-Extensions-to-gABI

Specifically the draft ABI extensions in this document:
  https://github.com/hjl-tools/linux-abi/wiki/linux-abi-draft.pdf

> I cannot find anything that uses it.

The loader should be using it.  Or maybe I should say that the loader
will be using it in the future.

Cheers
  Nick

Comment 5 Mark Wielaard 2019-09-04 12:21:57 UTC
This only happens when something is linked with the DTS9 binutils ld linker. So it doesn't seem like a priority for 8.1. It is also "just" a testsuite failure.
The support for this new program header (and possible new section header type?) doesn't seem finalized. So moving to 8.2.
We can at least make eu-elflint recognize the new type, even if we don't/cannot process it yet.

Comment 10 errata-xmlrpc 2020-04-28 16:58:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2020:1872