git: a04633cef81e - main - imgact_elf: Export __elfN(parse_notes)

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Fri, 10 Nov 2023 10:06:58 UTC
The branch main has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=a04633cef81e3b29da4eb214331bd472fc2e9238

commit a04633cef81e3b29da4eb214331bd472fc2e9238
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2023-11-01 15:18:12 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2023-11-10 09:57:45 +0000

    imgact_elf: Export __elfN(parse_notes)
    
    This is useful to check if a note is present and contains an expected
    value, e.g. to read NT_GNU_PROPERTY_TYPE_0 on arm64 to see if we should
    enable BTI.
    
    Reviewed by:    kib, markj
    Sponsored by:   Arm Ltd
    Differential Revision:  https://reviews.freebsd.org/D42439
---
 sys/kern/imgact_elf.c | 2 +-
 sys/sys/imgact_elf.h  | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index e03527f6a873..f361920e16d5 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -2704,7 +2704,7 @@ __elfN(note_procstat_auxv)(void *arg, struct sbuf *sb, size_t *sizep)
 	}
 }
 
-static bool
+bool
 __elfN(parse_notes)(struct image_params *imgp, Elf_Note *checknote,
     const char *note_vendor, const Elf_Phdr *pnote,
     bool (*cb)(const Elf_Note *, void *, bool *), void *cb_arg)
diff --git a/sys/sys/imgact_elf.h b/sys/sys/imgact_elf.h
index 7210fc2187a9..51e149476a28 100644
--- a/sys/sys/imgact_elf.h
+++ b/sys/sys/imgact_elf.h
@@ -123,6 +123,9 @@ void	__elfN(prepare_notes)(struct thread *, struct note_info_list *,
 void	__elfN(size_segments)(struct thread *, struct sseg_closure *, int);
 size_t	__elfN(register_note)(struct thread *, struct note_info_list *,
 	    int, outfunc_t, void *);
+bool	__elfN(parse_notes)(struct image_params *, Elf_Note *, const char *,
+	    const Elf_Phdr *, bool (*)(const Elf_Note *, void *, bool *),
+	    void *);
 
 /* Machine specific function to dump per-thread information. */
 void	__elfN(dump_thread)(struct thread *, void *, size_t *);