core/elf: validate NOTE segment length

we have the PT_NOTE segment in the linker scripts,
but if we have no note sections we will end up with
a zero length segment. Handle this case by validating
the phdr length.

Reviewed-by: Glauber Costa <glommer@cloudius-systems.com>
Cc: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>