Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 653352

Summary: Stripping of files broken with >=sys-apps/file-5.33
Product: Portage Development Reporter: Arfrever Frehtes Taifersar Arahesis <arfrever.fta>
Component: CoreAssignee: Portage team <dev-portage>
Severity: normal CC: base-system, hendrik, mgorny
Priority: Normal Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: All   
See Also:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 651804    

Description Arfrever Frehtes Taifersar Arahesis 2018-04-17 01:35:37 UTC
sys-apps/file-5.33 changed output for ELF files, which results in no files (either executables or libraries) being stripped.

Example showing difference ("LSB shared object" versus "LSB pie executable"):

# file --version
magic file from /usr/share/misc/magic
# file /usr/bin/wpa_cli
/usr/bin/wpa_cli: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/, for GNU/Linux 4.0.0, not stripped

# file --version
magic file from /usr/share/misc/magic
# file /usr/bin/wpa_cli
/usr/bin/wpa_cli: ELF 64-bit LSB pie executable x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/, for GNU/Linux 4.0.0, not stripped
Comment 1 Arfrever Frehtes Taifersar Arahesis 2018-04-17 01:53:47 UTC
Relevant change in source code of sys-apps/file is probably:

--- file-5.32/magic/Magdir/elf
+++ file-5.33/magic/Magdir/elf
@@ -1,6 +1,6 @@
-# $File: elf,v 1.70 2016/06/02 12:36:30 christos Exp $
+# $File: elf,v 1.72 2018/02/24 19:50:04 christos Exp $
 # elf:  file(1) magic for ELF executables
 # We have to check the byte order flag to see what byte order all the
@@ -48,8 +48,9 @@
 !:mime application/x-object
 >16    leshort         2               executable,
 !:mime application/x-executable
->16    leshort         3               shared object,
-!:mime application/x-sharedlib
+>16    leshort         3               ${x?pie executable:shared object}
+!:mime application/x-${x?pie-executable:sharedlib}
 >16    leshort         4               core file
 !:mime application/x-coredump
 # Core file detection is not reliable.
Comment 2 Larry the Git Cow gentoo-dev 2018-04-17 02:14:37 UTC
The bug has been referenced in the following commit(s):

commit ae6d6aa22d074c04cd9caefe1ca02bf615bfd86f
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
AuthorDate: 2018-04-17 02:06:38 +0000
Commit:     Zac Medico <>
CommitDate: 2018-04-17 02:11:19 +0000

    estrip, install-qa-check.d/10ignored-flags: fix bug 653352
    Update detection of ELF files to work with >=sys-apps/file-5.33.

 bin/estrip                             | 3 ++-
 bin/install-qa-check.d/10ignored-flags | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)}
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-04-17 06:27:14 UTC
Would be nice to mask this to give people a while to upgrade their package managers.
Comment 4 Zac Medico gentoo-dev 2018-07-02 18:51:36 UTC
Fixed in portage-2.3.40-r1.