file 5.33 changed output for PIE executables: # file /bin/bash /bin/bash: ELF 64-bit LSB pie executable x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=59d7babe7e71d4cb6a1168b845a5df9392f175c2, stripped, too many notes (256) # file --mime /bin/bash /bin/bash: application/x-pie-executable; charset=binary It looks like the following scripts need adjustments: scripts/brp-strip scripts/brp-strip-shared scripts/find-debuginfo.sh Previously, ld.so was excluded from stripping, but this is no longer the case, causing valgrind to fail (bug 1570246). If you think that ld.so was not stripped in error, please provide a way to preserve the .symtab section again, so that we can build a fixed glibc. This needs fixing in Fedora 28 and rawhide.
I am not sure when brp-strip and brp-strip-shared are used, but for find-debuginfo.sh the fix is easy (although untested): diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh index a7c2db0..90a4494 100755 --- a/scripts/find-debuginfo.sh +++ b/scripts/find-debuginfo.sh @@ -235,6 +235,7 @@ strip_to_debug() $strip_g && case "$(file -bi "$2")" in application/x-sharedlib*) g=-g ;; application/x-executable*) g=-g ;; + application/x-pie-executable*) g=-g ;; esac eu-strip --remove-comment $r $g ${keep_remove_args} -f "$1" "$2" || exit chmod 444 "$1" || exit Note that instead of using find_debuginfo_args="-g" (or _find_debuginfo_opts), which runs [eu-]strip to only remove the .debug sections, but not other non-allocated sections, you could also use find_debuginfo_args="--keep-section .symtab" to explicitly keep the .symtab section (but still strip away everything else).
(In reply to Mark Wielaard from comment #1) > I am not sure when brp-strip and brp-strip-shared are used, but for > find-debuginfo.sh the fix is easy (although untested): > > diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh > index a7c2db0..90a4494 100755 > --- a/scripts/find-debuginfo.sh > +++ b/scripts/find-debuginfo.sh > @@ -235,6 +235,7 @@ strip_to_debug() > $strip_g && case "$(file -bi "$2")" in > application/x-sharedlib*) g=-g ;; > application/x-executable*) g=-g ;; > + application/x-pie-executable*) g=-g ;; > esac > eu-strip --remove-comment $r $g ${keep_remove_args} -f "$1" "$2" || exit > chmod 444 "$1" || exit I patched this manually into a buildroot, and can confirm that this change restores the .symtab section for ld.so, so valgrind works again. Thanks!
(In reply to Florian Weimer from comment #2) > I patched this manually into a buildroot, and can confirm that this change > restores the .symtab section for ld.so, so valgrind works again. Thanks! Thanks for testing. I posted the patch upstream: http://lists.rpm.org/pipermail/rpm-maint/2018-May/007976.html And added it to fedora rpm and did a build for rawhide (rpm-4.14.1-9.fc29) http://koji.fedoraproject.org/koji/buildinfo?buildID=1084068 If it works out, it should be trivial to add to f28.
glibc-2.27.9000-19.fc29.x86_64 unbreaks valgrind. However, that version was built against file-5.33-4.fc29 as well, so it is not clear which change actually fixed matters. 8-)
(In reply to Florian Weimer from comment #4) > glibc-2.27.9000-19.fc29.x86_64 unbreaks valgrind. However, that version was > built against file-5.33-4.fc29 as well, so it is not clear which change > actually fixed matters. 8-) Aha, I see file also added a countermeasure in file-5.33-4: - do not classify shared libraries as pie executables (#1581343) Good, then either this or that going into f28 would resolve things.
We already have an update for file-5.33-4.fc28 at Bodhi: https://bodhi.fedoraproject.org/updates/FEDORA-2018-d1425c85a7 Despite its karma is +3, it has not yet reached updates-testing, and I see no button to move it forward.
# rpm -q file file-5.33-4.fc28.x86_64 # file --mime /sbin/ldconfig /sbin/ldconfig: application/x-pie-executable; charset=binary # file --mime /bin/bash /bin/bash: application/x-pie-executable; charset=binary So the file update is definitely NOT sufficient to fix the find-debuginfo.sh issue. We need the patch from comment 1.
I have submitted a new update to fix the MIME output, too: https://bodhi.fedoraproject.org/updates/file-5.33-5.fc28 Sorry for the troubles!
rpm-4.14.1-9.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-1894f7892a
rpm-4.14.1-9.fc28 has been pushed to the Fedora 28 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-1894f7892a
rpm-4.14.1-9.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.