Add GCC library functions

GCC might generate implicit calls to standard functions, for example
memcpy when copying a struct. Implement these functions upfront, to
ensure that GCC never uses some optimized version, which could do
unaligned device memory accesses. We only implement memcpy and memset
for the moment. The others (memmove, memcmp, ...) can be added in the
future if required.

We also add flags "-ffunction-sections", "-fdata-sections" to GCC, and
"--gc-sections" to ld, in order to avoid linking those functions into
the final image when they aren't used.

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
3 files changed