소스 검색

Merge pull request #604 from marysaka/fix/section-kind-from-str

aya-obj: Fix ProgramSection::from_str for bss and rodata sections
Alessandro Decina 1 년 전
부모
커밋
3a9058e762
1개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 4
      aya-obj/src/obj.rs

+ 5 - 4
aya-obj/src/obj.rs

@@ -1093,11 +1093,12 @@ impl BpfSectionKind {
             BpfSectionKind::BtfMaps
         } else if name.starts_with(".text") {
             BpfSectionKind::Text
-        } else if name.starts_with(".bss")
-            || name.starts_with(".data")
-            || name.starts_with(".rodata")
-        {
+        } else if name.starts_with(".bss") {
+            BpfSectionKind::Bss
+        } else if name.starts_with(".data") {
             BpfSectionKind::Data
+        } else if name.starts_with(".rodata") {
+            BpfSectionKind::Rodata
         } else if name == ".BTF" {
             BpfSectionKind::Btf
         } else if name == ".BTF.ext" {