gcx: error handling improvements and fixes.

Change-Id: I4255b5935d070e47d7f286c2bfadb74f93d275a8
Signed-off-by: Alexei Shlychkov <x0177296@ti.com>