buildid.c (1ac731c529cd4d6adbce134754b51ff7d822b145) buildid.c (443cbaf9e2fdbef7d7cae457434a6cb8a679441b)
1// SPDX-License-Identifier: GPL-2.0
2
3#include <linux/buildid.h>
4#include <linux/cache.h>
5#include <linux/elf.h>
6#include <linux/kernel.h>
7#include <linux/pagemap.h>
8

--- 160 unchanged lines hidden (view full) ---

169 *
170 * Return: 0 on success, -EINVAL otherwise
171 */
172int build_id_parse_buf(const void *buf, unsigned char *build_id, u32 buf_size)
173{
174 return parse_build_id_buf(build_id, NULL, buf, buf_size);
175}
176
1// SPDX-License-Identifier: GPL-2.0
2
3#include <linux/buildid.h>
4#include <linux/cache.h>
5#include <linux/elf.h>
6#include <linux/kernel.h>
7#include <linux/pagemap.h>
8

--- 160 unchanged lines hidden (view full) ---

169 *
170 * Return: 0 on success, -EINVAL otherwise
171 */
172int build_id_parse_buf(const void *buf, unsigned char *build_id, u32 buf_size)
173{
174 return parse_build_id_buf(build_id, NULL, buf, buf_size);
175}
176
177#if IS_ENABLED(CONFIG_STACKTRACE_BUILD_ID) || IS_ENABLED(CONFIG_CRASH_CORE)
177#if IS_ENABLED(CONFIG_STACKTRACE_BUILD_ID) || IS_ENABLED(CONFIG_VMCORE_INFO)
178unsigned char vmlinux_build_id[BUILD_ID_SIZE_MAX] __ro_after_init;
179
180/**
181 * init_vmlinux_build_id - Compute and stash the running kernel's build ID
182 */
183void __init init_vmlinux_build_id(void)
184{
185 extern const void __start_notes __weak;
186 extern const void __stop_notes __weak;
187 unsigned int size = &__stop_notes - &__start_notes;
188
189 build_id_parse_buf(&__start_notes, vmlinux_build_id, size);
190}
191#endif
178unsigned char vmlinux_build_id[BUILD_ID_SIZE_MAX] __ro_after_init;
179
180/**
181 * init_vmlinux_build_id - Compute and stash the running kernel's build ID
182 */
183void __init init_vmlinux_build_id(void)
184{
185 extern const void __start_notes __weak;
186 extern const void __stop_notes __weak;
187 unsigned int size = &__stop_notes - &__start_notes;
188
189 build_id_parse_buf(&__start_notes, vmlinux_build_id, size);
190}
191#endif