Created attachment 225510 [details] [PATCH] boot loader: Fix __elfN(loadimage) return value Caller functions expect __elfN(loadimage) to return a value of zero on failure and the file size on success. Returning ENOENT on failure does not seem correct to me.
Thanks, I'll commit this patch.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=1ea87e2a70c31454a8696ab2979d13d21c5575d2 commit 1ea87e2a70c31454a8696ab2979d13d21c5575d2 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2021-06-06 20:40:25 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2021-06-06 20:44:46 +0000 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 stand/common/load_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=7242b5c6d2165f7c6141e5edc878f36f3ab43e40 commit 7242b5c6d2165f7c6141e5edc878f36f3ab43e40 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2021-06-06 20:40:25 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2021-06-20 19:02:47 +0000 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 (cherry picked from commit 1ea87e2a70c31454a8696ab2979d13d21c5575d2) stand/common/load_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=765c6eb3953c0e9e95543bfb9e7352772ace030c commit 765c6eb3953c0e9e95543bfb9e7352772ace030c Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2021-06-06 20:40:25 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2021-06-20 19:00:54 +0000 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 (cherry picked from commit 1ea87e2a70c31454a8696ab2979d13d21c5575d2) stand/common/load_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks for the patch.