Fix issue #789 and introduce new hook attribute 'binaries'.