Add --kaslr support for s390x kernels configured with CONFIG_RANDOMIZE_BASE. Only kdumps or ELF dumps with vmcoreinfo are supported. Suggested-by: Gerald Schaefer <gerald.schaefer@xxxxxxxxxx> Signed-off-by: Mikhail Zaslonko <zaslonko@xxxxxxxxxxxxx> --- help.c | 2 +- main.c | 3 ++- symbols.c | 9 +++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/help.c b/help.c index ba15dec..47058ed 100644 --- a/help.c +++ b/help.c @@ -335,7 +335,7 @@ char *program_usage_info[] = { " and verification. The default count is 32768.", "", " --kaslr offset | auto", - " If an x86 or x86_64 kernel was configured with CONFIG_RANDOMIZE_BASE,", + " If x86, x86_64 or s390x kernel was configured with CONFIG_RANDOMIZE_BASE,", " the offset value is equal to the difference between the symbol values ", " compiled into the vmlinux file and their relocated KASLR value. If", " set to auto, the KASLR offset value will be automatically calculated.", diff --git a/main.c b/main.c index cd282cd..83ccd31 100644 --- a/main.c +++ b/main.c @@ -227,7 +227,8 @@ main(int argc, char **argv) } } else if (STREQ(long_options[option_index].name, "kaslr")) { if (!machine_type("X86_64") && - !machine_type("ARM64") && !machine_type("X86")) + !machine_type("ARM64") && !machine_type("X86") && + !machine_type("S390X")) error(INFO, "--kaslr not valid " "with this machine type.\n"); else if (STREQ(optarg, "auto")) diff --git a/symbols.c b/symbols.c index 77f45f9..1ed75fe 100644 --- a/symbols.c +++ b/symbols.c @@ -593,8 +593,8 @@ kaslr_init(void) { char *string; - if ((!machine_type("X86_64") && !machine_type("ARM64") && !machine_type("X86")) || - (kt->flags & RELOC_SET)) + if ((!machine_type("X86_64") && !machine_type("ARM64") && !machine_type("X86") && + !machine_type("S390X")) || (kt->flags & RELOC_SET)) return; /* @@ -751,7 +751,8 @@ store_symbols(bfd *abfd, int dynamic, void *minisyms, long symcount, fromend, size, store); } else if (!(kt->flags & RELOC_SET)) kt->flags |= RELOC_FORCE; - } else if (machine_type("X86_64") || machine_type("ARM64")) { + } else if (machine_type("X86_64") || machine_type("ARM64") || + machine_type("S390X")) { if ((kt->flags2 & RELOC_AUTO) && !(kt->flags & RELOC_SET)) derive_kaslr_offset(abfd, dynamic, from, fromend, size, store); @@ -823,7 +824,7 @@ store_sysmap_symbols(void) strerror(errno)); if (!machine_type("X86") && !machine_type("X86_64") && - !machine_type("ARM64")) + !machine_type("ARM64") && !machine_type("S390X")) kt->flags &= ~RELOC_SET; first = 0; -- 2.16.4 -- Crash-utility mailing list Crash-utility@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/crash-utility