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

(cherry picked from commit a04633cef81e3b29da4eb214331bd472fc2e9238)
This commit is contained in:
Andrew Turner 2023-11-01 15:18:12 +00:00
parent c424b19419
commit 403c7ef8e8
2 changed files with 4 additions and 1 deletions

View file

@ -2704,7 +2704,7 @@ __elfN(note_procstat_auxv)(void *arg, struct sbuf *sb, size_t *sizep)
}
#define MAX_NOTES_LOOP 4096
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)

View file

@ -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 *);