stand: Fix __elfN(loadimage) return value

Caller functions expect __elfN(loadimage) to return a value of zero on
failure and the file size on success.

PR:		256390
Reviewed by:	markj
MFC after:	2 weeks
This commit is contained in:
Mark Johnston 2021-06-06 16:40:25 -04:00
parent fbeb4ccac9
commit 1ea87e2a70

View File

@ -893,7 +893,7 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, uint64_t off)
p_start = sym.st_value + ef->off;
if (__elfN(lookup_symbol)(ef, "__stop_set_modmetadata_set", &sym,
STT_NOTYPE) != 0)
return ENOENT;
return 0;
p_end = sym.st_value + ef->off;
if (__elfN(parse_modmetadata)(fp, ef, p_start, p_end) == 0)