From 37f558d5a3e922f02d526c08bfc91594b79dcb10 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Fri, 1 Aug 2014 09:29:24 +0200 Subject: [PATCH] Let runtime_loader ignore RT_RELRO program headers. * The new libstdc++.so contains program headers of type PT_RELRO (for making segments read-only after relocation). While the actual feature has not been implemented, the runtime_loader should now silently accept (and ignore) those program headers. --- headers/private/system/elf_common.h | 1 + src/system/runtime_loader/elf_load_image.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/headers/private/system/elf_common.h b/headers/private/system/elf_common.h index fbd202fe6b..194d1ca427 100644 --- a/headers/private/system/elf_common.h +++ b/headers/private/system/elf_common.h @@ -141,6 +141,7 @@ #define PT_PHDR 6 #define PT_TLS 7 #define PT_STACK 0x6474e551 +#define PT_RELRO 0x6474e552 #define PT_LOPROC 0x70000000 #define PT_HIPROC 0x7fffffff diff --git a/src/system/runtime_loader/elf_load_image.cpp b/src/system/runtime_loader/elf_load_image.cpp index 8b698e98a2..011094839a 100644 --- a/src/system/runtime_loader/elf_load_image.cpp +++ b/src/system/runtime_loader/elf_load_image.cpp @@ -75,6 +75,9 @@ count_regions(const char* imagePath, char const* buff, int phnum, int phentsize) case PT_PHDR: // we don't use it break; + case PT_RELRO: + // not implemented yet, but can be ignored + break; case PT_STACK: // we don't use it break; @@ -196,6 +199,9 @@ parse_program_headers(image_t* image, char* buff, int phnum, int phentsize) case PT_PHDR: // we don't use it break; + case PT_RELRO: + // not implemented yet, but can be ignored + break; case PT_STACK: // we don't use it break;