:: commit e6a742e8d0c273406b1bebb86ed7c878523fec1a

mintsuki <mintsuki@protonmail.com> — 2024-06-04 01:09

parents: d694902642

lib/elf: Panic if ELF file contains DT_NEEDED tags

diff --git a/common/lib/elf.c b/common/lib/elf.c
index 623a2aa3..de589baf 100644
--- a/common/lib/elf.c
+++ b/common/lib/elf.c
@@ -313,6 +313,8 @@ static bool elf64_apply_relocations(uint8_t *elf, struct elf64_hdr *hdr, void *b
                 case DT_JMPREL:
                     dt_jmprel = dyn->d_un;
                     break;
+                case DT_NEEDED:
+                    panic(true, "elf: ELF file attempts to load a dynamically linked library");
             }
         }
 
tab: 248 wrap: offon