From e6a742e8d0c273406b1bebb86ed7c878523fec1a Mon Sep 17 00:00:00 2001 From: mintsuki Date: Tue, 4 Jun 2024 03:09:08 +0200 Subject: [PATCH] lib/elf: Panic if ELF file contains DT_NEEDED tags --- common/lib/elf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/lib/elf.c b/common/lib/elf.c index 623a2aa32..de589baf3 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"); } }