aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--04_dynld_nostd/dynld.c4
-rw-r--r--lib/include/elf.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/04_dynld_nostd/dynld.c b/04_dynld_nostd/dynld.c
index 02fbe9e..6e1bebf 100644
--- a/04_dynld_nostd/dynld.c
+++ b/04_dynld_nostd/dynld.c
@@ -139,6 +139,8 @@ static Dso get_prog_dso(const ExecInfo* info) {
} else if (phdr->type == PT_DYNAMIC) {
dynoff = phdr->vaddr;
}
+
+ ERROR_ON(phdr->type == PT_TLS, "Thread local storage not supported found PT_TLS!");
}
ERROR_ON(dynoff == 0, "PT_DYNAMIC entry missing in the user programs PHDR!");
@@ -311,6 +313,8 @@ static Dso map_dependency(const char* dependency) {
addr_end = p->vaddr + p->memsz;
}
}
+
+ ERROR_ON(phdr->type == PT_TLS, "Thread local storage not supported found PT_TLS!");
}
// Align start address to the next lower page boundary.
diff --git a/lib/include/elf.h b/lib/include/elf.h
index 7a2e597..0317859 100644
--- a/lib/include/elf.h
+++ b/lib/include/elf.h
@@ -60,6 +60,7 @@ typedef struct {
#define PT_NOTE 4 /* Location of auxiliary information */
#define PT_SHLIB 5 /* Reserved, but unspecified semantic */
#define PT_PHDR 6 /* Location & size of program headers itself */
+#define PT_TLS 7 /* Thread local storage */
#define PT_GNU_EH_FRAME 0x6474e550 /* [x86-64] stack unwinding tables */
#define PT_LOPROC 0x70000000