bpfloader: Add .kconfig to optionally pinned maps
Programs that use __kcfg values will have .kconfig sections that may not have a pinned map descriptor. Allow them to be loaded. Bug: 419635765 Test: manual. loaded program with .kconfig section. Change-Id: Ifbfbfd443e034da21cbf8e7d456e7ad23dcd34b5 Signed-off-by: Tiffany Yang <ynaffit@google.com>
This commit is contained in:
parent
809c5f5636
commit
a80b309391
1 changed files with 4 additions and 2 deletions
|
|
@ -234,6 +234,9 @@ const BPF_FILE_DESC_DEFAULT: BpfFileDesc = BpfFileDesc {
|
|||
progs: &[],
|
||||
};
|
||||
|
||||
// Sections like .rodata, .rodata.str1.1, etc. do not require pinning
|
||||
const OPTIONAL_SEC: &[&str] = &[".data", ".kconfig", ".rodata"];
|
||||
|
||||
const FILE_ARR: &[BpfFileDesc] = &[
|
||||
BpfFileDesc {
|
||||
filename: "/system/etc/bpf/cputimeinstate/timeInState.bpf",
|
||||
|
|
@ -565,8 +568,7 @@ fn libbpf_worker(file_desc: &BpfFileDesc) -> Result<(), anyhow::Error> {
|
|||
break;
|
||||
}
|
||||
}
|
||||
if !desc_found && (name.contains(".rodata") || name.contains(".data")) {
|
||||
// Skip required pinning map for .rodata, .rodata.str1.1, and .data sections.
|
||||
if !desc_found && OPTIONAL_SEC.iter().any(|§ion| name.contains(section)) {
|
||||
info!("Optional map descriptor for {name} not found, ignoring");
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue