diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2015-06-11 18:16:08 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2015-06-11 18:16:08 -0400 |
commit | 8eddda8072add075ebf56cf6d288bc1450d6b5f8 (patch) | |
tree | 373e2d36142a298a821f6643c097007aa38aa29f /net-libs/webkit-gtk/files/gir-paxctl-lt-wrapper | |
download | musl-8eddda8072add075ebf56cf6d288bc1450d6b5f8.tar.gz musl-8eddda8072add075ebf56cf6d288bc1450d6b5f8.tar.bz2 musl-8eddda8072add075ebf56cf6d288bc1450d6b5f8.zip |
Initial migration from hardened-dev::musl
Diffstat (limited to 'net-libs/webkit-gtk/files/gir-paxctl-lt-wrapper')
-rwxr-xr-x | net-libs/webkit-gtk/files/gir-paxctl-lt-wrapper | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/net-libs/webkit-gtk/files/gir-paxctl-lt-wrapper b/net-libs/webkit-gtk/files/gir-paxctl-lt-wrapper new file mode 100755 index 00000000..d4f270c2 --- /dev/null +++ b/net-libs/webkit-gtk/files/gir-paxctl-lt-wrapper @@ -0,0 +1,33 @@ +#!/bin/bash +# Wrapper for $(LIBTOOL) that performs PaX marking on the dumper binary +# generated by g-ir-scanner. +# PaX marking code stolen from pax-utils.eclass + +flags=${1//-}; shift + +echo ${LIBTOOL} "$@" +${LIBTOOL} "$@" + +retval=$? + +files=$(find . -path "*tmp-introspect*/.libs/*") + +if type -p paxctl > /dev/null; then + echo "PT PaX marking -${flags} ${files}" + for f in ${files}; do + # First, try modifying the existing PAX_FLAGS header + paxctl -q${flags} "${f}" && continue + # Second, try stealing the (unused under PaX) PT_GNU_STACK header + paxctl -qc${flags} "${f}" && continue + # Third, try pulling the base down a page, to create space and + # insert a PT_GNU_STACK header (works on ET_EXEC) + paxctl -qC${flags} "${f}" && continue + done +elif type -p scanelf > /dev/null; then + # Try scanelf, the Gentoo swiss-army knife ELF utility + # Currently this sets PT if it can, no option to control what it does. + echo "Fallback PaX marking -${flags} ${files}" + scanelf -Xxz ${flags} ${files} +fi + +exit ${retval} |