Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/checkpoint-restore/criu.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Holzheu <holzheu@linux.vnet.ibm.com>2017-06-30 21:31:37 +0300
committerPavel Emelyanov <xemul@virtuozzo.com>2017-08-09 18:51:41 +0300
commit8b23923640caa575874dfff8a5d05ca60617b42f (patch)
tree8fba3b0adb1d491f7308c864d6101ddf94ccdef9 /compel/src
parent7ce8f56be27ca372f3ed028ab0cb655dcf0abd62 (diff)
s390:compel: Enable s390 in compel/
Add s390 parts to common code files. Patch history ------------- v2->v3: * Add: s390: Consolidate -msoft-float into Makefile.compel Reviewed-by: Alice Frosi <alice@linux.vnet.ibm.com> Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com> Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Diffstat (limited to 'compel/src')
-rw-r--r--compel/src/lib/handle-elf.c25
-rw-r--r--compel/src/main.c3
2 files changed, 28 insertions, 0 deletions
diff --git a/compel/src/lib/handle-elf.c b/compel/src/lib/handle-elf.c
index 41633e99c..bf94d93b6 100644
--- a/compel/src/lib/handle-elf.c
+++ b/compel/src/lib/handle-elf.c
@@ -542,6 +542,31 @@ int __handle_elf(void *mem, size_t size)
break;
#endif
+#ifdef ELF_S390
+ /*
+ * See also arch/s390/kernel/module.c/apply_rela():
+ * A PLT reads the GOT (global offest table). We can handle it like
+ * R_390_PC32DBL because we have linked statically.
+ */
+ case R_390_PLT32DBL: /* PC relative on a PLT (predure link table) */
+ pr_debug("\t\t\t\tR_390_PLT32DBL at 0x%-4lx val 0x%x\n", place, value32 + addend32);
+ *((int32_t *)where) = (value64 + addend64 - place) >> 1;
+ break;
+ case R_390_PC32DBL: /* PC relative on a symbol */
+ pr_debug("\t\t\t\tR_390_PC32DBL at 0x%-4lx val 0x%x\n", place, value32 + addend32);
+ *((int32_t *)where) = (value64 + addend64 - place) >> 1;
+ break;
+ case R_390_64: /* 64 bit absolute address */
+ pr_debug("\t\t\t\tR_390_64 at 0x%-4lx val 0x%lx\n", place, (long)value64);
+ pr_out(" { .offset = 0x%-8x, .type = COMPEL_TYPE_LONG, "
+ ".addend = %-8ld, .value = 0x%-16lx, }, /* R_390_64 */\n",
+ (unsigned int)place, (long)addend64, (long)value64);
+ break;
+ case R_390_PC64: /* 64 bit relative address */
+ *((int64_t *)where) = value64 + addend64 - place;
+ pr_debug("\t\t\t\tR_390_PC64 at 0x%-4lx val 0x%lx\n", place, (long)value64);
+ break;
+#endif
default:
pr_err("Unsupported relocation of type %lu\n",
(unsigned long)ELF_R_TYPE(r->rel.r_info));
diff --git a/compel/src/main.c b/compel/src/main.c
index 1171478cb..86d22abd3 100644
--- a/compel/src/main.c
+++ b/compel/src/main.c
@@ -52,6 +52,9 @@ static const flags_t flags = {
#elif defined CONFIG_PPC64
.arch = "ppc64",
.cflags = COMPEL_CFLAGS_PIE,
+#elif defined CONFIG_S390
+ .arch = "s390",
+ .cflags = COMPEL_CFLAGS_PIE,
#else
#error "CONFIG_<ARCH> not defined, or unsupported ARCH"
#endif