Brought over non-linaro changes.