diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-02-18 22:52:44 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-02-18 22:54:11 +0100 |
commit | d71a4851e8a2ef52f6d806d65822290cdbae8804 (patch) | |
tree | e52597e69d0b90f7af724982bf47b4f6207948c4 /pkgs/build-support/setup-hooks/separate-debug-info.sh | |
parent | bf63de1613396a1a4d1f27fea73f125988d468a7 (diff) |
Don't try to apply patchelf to non-ELF binaries
Diffstat (limited to 'pkgs/build-support/setup-hooks/separate-debug-info.sh')
-rw-r--r-- | pkgs/build-support/setup-hooks/separate-debug-info.sh | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/pkgs/build-support/setup-hooks/separate-debug-info.sh b/pkgs/build-support/setup-hooks/separate-debug-info.sh index cf3d7b07a4997..37753d9ce406a 100644 --- a/pkgs/build-support/setup-hooks/separate-debug-info.sh +++ b/pkgs/build-support/setup-hooks/separate-debug-info.sh @@ -13,11 +13,7 @@ _separateDebugInfo() { # Find executables and dynamic libraries. local i magic while IFS= read -r -d $'\0' i; do - # Skip non-ELF files. - exec {fd}< "$i" - read -n 4 -u $fd magic - exec {fd}<&- - if ! [[ "$magic" =~ ELF ]]; then continue; fi + if ! isELF "$i"; then continue; fi # Extract the Build ID. FIXME: there's probably a cleaner way. local id="$(readelf -n "$i" | sed 's/.*Build ID: \([0-9a-f]*\).*/\1/; t; d')" @@ -34,7 +30,7 @@ _separateDebugInfo() { # Also a create a symlink <original-name>.debug. ln -sfn ".build-id/${id:0:2}/${id:2}.debug" "$dst/../$(basename "$i")" - done < <(find "$prefix" -type f -a \( -perm /0100 -o -name "*.so" -o -name "*.so.*" \) -print0) + done < <(find "$prefix" -type f -print0) } # - We might prefer to compress the debug info during link-time already, |