dtc: Move some functions to util.[ch]

Now that we have a util.[ch] file shared between dtc and
convert-dtsv0, move some functions which are currently duplicated in
the two to util files.  Specifically we move the die(), xmalloc() and
xrealloc() functions.

While we're at it, add standard double-include protection to util.h

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 files changed