various linaro and gcc 4.7 fixes thanks Vanja Zecevic

Change-Id: I1abcac4b083d4af52dfce55ce28c26e4add2081b