Home
last modified time | relevance | path

Searched hist:ff7c2da6d14bf14166414eb263eabece3096c032 (Results 1 – 1 of 1) sorted by relevance

/optee_os/lib/libutils/ext/include/
H A Dasm.Sff7c2da6d14bf14166414eb263eabece3096c032 Wed Apr 03 03:24:12 UTC 2019 Jerome Forissier <jerome.forissier@linaro.org> Force alignment of assembler functions (FUNC and LOCAL_FUNC) to 4 bytes

The Clang assembler will not align all the functions containing arm32
code (as opposed to thumb) on 4-byte boundaries, contrary to GCC. For
example, with the current code, the syscall wrappers in libutee are
like so:

# GCC 8.2.1
$ arm-linux-gnueabihf-objdump -x utee_syscalls_a32.o | \
grep '\.text\.utee_.*\*\*' | head -3
3 .text.utee_panic 00000014 00000000 00000000 00000034 2**2
6 .text.utee_return 00000014 00000000 00000000 0000005c 2**2
9 .text.utee_log 00000014 00000000 00000000 00000078 2**2

# Clang 8.0.0
$ arm-linux-gnueabihf-objdump -x utee_syscalls_a32.o | \
grep '\.text\.utee_.*\*\*' | head -3
1 .text.utee_panic 00000014 00000000 00000000 00000034 2**0
4 .text.utee_return 00000014 00000000 00000000 0000005c 2**0
6 .text.utee_log 00000014 00000000 00000000 00000078 2**0

The bad alignment constraint can cause run time exceptions. Add a
".balign 4" to FUNC and LOCAL_FUNC to fix that.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>