[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[COMMITTED][POKE-ELF] elf-{32,64}.pk: expand constraint for sh_flags
From: |
Jose E. Marchesi |
Subject: |
[COMMITTED][POKE-ELF] elf-{32,64}.pk: expand constraint for sh_flags |
Date: |
Mon, 30 Jan 2023 23:11:56 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
---
elf-32.pk | 5 ++++-
elf-64.pk | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/elf-32.pk b/elf-32.pk
index 845f72d..0e84442 100644
--- a/elf-32.pk
+++ b/elf-32.pk
@@ -93,7 +93,10 @@ type Elf32_Shdr =
{
offset<Elf_Word,B> sh_name;
Elf_Word sh_type : elf_config.check_enum ("section-types", elf_mach,
sh_type);
- Elf_Word sh_flags : elf_config.check_enum ("section-flags", elf_mach,
sh_flags);
+ Elf_Word sh_flags : elf_config.check_enum ("section-flags", elf_mach,
sh_flags)
+ && (sh_flags & ELF_SHF_COMPRESSED
+ => (sh_type != ELF_SHT_NOBITS
+ && !(sh_flags & ELF_SHF_ALLOC)));
Elf32_Addr sh_addr;
Elf32_Off sh_offset;
offset<Elf_Word,B> sh_size;
diff --git a/elf-64.pk b/elf-64.pk
index 2ebf220..3e4eca8 100644
--- a/elf-64.pk
+++ b/elf-64.pk
@@ -142,7 +142,10 @@ type Elf64_Shdr =
{
offset<Elf_Word,B> sh_name;
Elf_Word sh_type : elf_config.check_enum ("section-types", elf_mach,
sh_type);
- Elf64_Xword sh_flags : elf_config.check_mask ("section-flags", elf_mach,
sh_flags);
+ Elf64_Xword sh_flags : elf_config.check_mask ("section-flags", elf_mach,
sh_flags)
+ && (sh_flags & ELF_SHF_COMPRESSED
+ => (sh_type != ELF_SHT_NOBITS
+ && !(sh_flags & ELF_SHF_ALLOC)));
Elf64_Addr sh_addr;
Elf64_Off sh_offset;
offset<Elf64_Xword,B> sh_size;
--
2.30.2
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [COMMITTED][POKE-ELF] elf-{32,64}.pk: expand constraint for sh_flags,
Jose E. Marchesi <=