Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\stackmap.c Create Date:2022-07-28 13:26:13
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Parse build id from the note segment. This logic can be shared between* 32-bit and 64-bit system, because Elf32_Nhdr and Elf64_Nhdr are* identical.

Proto:static inline int stack_map_parse_build_id(void *page_addr, unsigned char *build_id, void *note_start, Elf32_Word note_size)

Type:int

Parameter:

TypeParameterName
void *page_addr
unsigned char *build_id
void *note_start
Elf32_Wordnote_size
163  note_offs = 0
166  If note_start < page_addr || note_start + note_size < note_start Then Return -EINVAL
170  If note_start + note_size > page_addr + PAGE_SIZE Then Return -EINVAL
173  When note_offs + sizeof(Elf32_Nhdr) < note_size cycle
174  nhdr = note_start + note_offs
176  If n_type == BPF_BUILD_ID && Name size == size of "GNU" && Content size > 0 && Content size <= BPF_BUILD_ID_SIZE Then
186  Return 0
188  new_offs = note_offs + sizeof(Elf32_Nhdr) + @a is a power of 2 value (Name size , 4) + @a is a power of 2 value (Content size , 4)
190  If new_offs <= note_offs Then Break
192  note_offs = new_offs
194  Return -EINVAL
Caller
NameDescribe
stack_map_get_build_id_32Parse build ID from 32-bit ELF
stack_map_get_build_id_64Parse build ID from 64-bit ELF