NixOS/patchelf — pull request #24 by jeremysanders (2014-06-07 07:28:21+00:00)
Title: Use libattr and libacl to copy permissions if available

This is a patch we ship in the Fedora RPM. It copies ACLs and other extended attributes to the modified executable. I'm not sure you want to apply as it is, because it adds some ifdefs directly to the code, though it is fairly clean.