3
0
Fork 0
forked from mirrors/nixpkgs

autoPatchelfHook: Patch PIC exes/libs as well

If there is a shared object or executable that's using
position-independent code, the file's mime type is
"application/x-pie-executable", so until this change its dependencies
wouldn't be patched.

This simply adds the mime type to the search loop.

Signed-off-by: aszlig <aszlig@nix.build>
This commit is contained in:
aszlig 2018-06-08 00:21:33 +02:00
parent 673628e10c
commit ff5cecf821
No known key found for this signature in database
GPG key ID: 684089CE67EBB691

View file

@ -15,6 +15,7 @@ findElfs() {
while [ -n "$1" ]; do
mimeType="$(file -b -N --mime-type "$1")"
if [ "$mimeType" = application/x-executable \
-o "$mimeType" = application/x-pie-executable \
-o "$mimeType" = application/x-sharedlib ]; then
echo "$1"
fi