[CRIU] [PATCH 15/16] pie: piegen -- Add PIE_SIZE helper

Cyrill Gorcunov gorcunov at openvz.org
Thu Jun 4 14:04:16 PDT 2015


To hide @nr_gotpcrel

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 pie/pie-relocs.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pie/pie-relocs.h b/pie/pie-relocs.h
index f1e36b6ff691..96f2bc9f2044 100644
--- a/pie/pie-relocs.h
+++ b/pie/pie-relocs.h
@@ -7,8 +7,10 @@
 #include "config.h"
 
 #if defined(CONFIG_X86_64) || defined(CONFIG_X86_32) || defined(CONFIG_PPC64)
+#define PIE_SIZE(__blob_name)	(round_up(sizeof(__blob_name) + nr_gotpcrel * sizeof(long), PAGE_SIZE))
 extern __maybe_unused void elf_relocs_apply(void *mem, void *vbase, size_t size, elf_reloc_t *elf_relocs, size_t nr_relocs);
 #else
+#define PIE_SIZE(__blob_name)	(round_up(sizeof(__blob_name), PAGE_SIZE))
 static always_inline void elf_relocs_apply(void *mem, void *vbase, size_t size, elf_reloc_t *elf_relocs, size_t nr_relocs) { }
 #endif
 
-- 
2.4.2



More information about the CRIU mailing list