From patchwork Tue Apr 5 18:54:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 8754531 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9FD7EC0553 for ; Tue, 5 Apr 2016 18:54:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 069E92037E for ; Tue, 5 Apr 2016 18:54:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 38D0C20375 for ; Tue, 5 Apr 2016 18:54:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751291AbcDESy3 (ORCPT ); Tue, 5 Apr 2016 14:54:29 -0400 Received: from mout.gmx.net ([212.227.15.19]:57087 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751070AbcDESy2 (ORCPT ); Tue, 5 Apr 2016 14:54:28 -0400 Received: from [192.168.20.60] ([92.203.49.252]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0LvEZe-1bnuBC1Y9q-010P65; Tue, 05 Apr 2016 20:54:20 +0200 Subject: Re: kernel 4.6-rc unbootable due to module changes To: Mikulas Patocka References: Cc: linux-parisc@vger.kernel.org From: Helge Deller Message-ID: <570409DA.1060508@gmx.de> Date: Tue, 5 Apr 2016 20:54:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K0:z0qmb4J3zg67hfnHPobRm/ql027UXzmUvF51oKI9zhPdT7GGuwx eTl94o2/VVtzaReHhwWZPbF0fB6NHg5VjHcE8+WhJ4wI79Kr8+I1zXXFHgAPxUV9v7iBy3G j5CVwBz9tmn0mMiOHkxDO0GEe8VFsOjtSHfEsb/LwPH0rY/1j51mXyO0n4qGTltW1yF32fa byB7BEIwx+6sSuvisKGyQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:nEdBTzXuVOc=:SklIcWzAuBeAlGXiUjHEj0 XSOJrOk7SR2BJvUG0/le7tGsGOdO/bXgtMefQtC+R0BH65y1zWBaFjyiXizKbyuqnnVa3ZPE8 zwsPK1V8nNrK5bxTsPULuK71ScXXBbe9iX9oy50lpg/Oe/n4v16NxhbqAR6/ONLH0HJZiHduE 3HBHeBW4RmJoBUfC4mB6M5UlzDCQ9qti/QVL/otni2yro2AX30QUujV+CVqWTQc67WNrX6YS2 i9+qrfAtc+cLQRJS3Jo3xCVv0pgMLeMTCjL1h6kUw+2366yrgtUjNP9vfSn9eAE8U2Kxspd/3 VC5h75woMOZyak6tLga/NYYLWAmPQFW8LrI74PsqotjUilSWK8uCyE1F5HMT6uS0BpYMIKmKg rdTslFgvohbPtt9R2hxy+GuzsFPzCnK1DslJqpLO2KkBMFhLT/PNVorEJPp284E0RzNqgHAJt 34gByB3BTjP4dEuGkBDpHKxxvuhCiwj3Yx2n5LtN7O7+FdIdq1myG8+5+ExZHqkq/7V75Pf9r iwiFwFG+pgd/f7Q0nwCZZM881riSrfUNhm5dgWlujvG2/xOtwK86p0H8hqBFpkw8Ab4EhGAQm BX8iusGewSoVR/88shXLifLGEZuov9OHxtrKZ37fz1boI7oGEN8RqvkAZr8hDkKPTSbu6Nc8s Zc91WHyvGmuveXDp9Nb8KCdQeTPhQ2ka2Ot6N5XQqUdlr3fmbupfVT8E9Bem6p/PAVl1mJa6Z ag3PdpyFHA7xRGTFKq8/pFbdyNJroGLIvDNDUHs0jnAHC0GOSObO9YPqByc= Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_TVD_MIME_EPI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 05.04.2016 19:36, Mikulas Patocka wrote: > On Tue, 5 Apr 2016, Mikulas Patocka wrote: > >> Hi >> >> The patch "parisc: Use generic extable search and sort routines" makes the >> kernel unable to load any modules. It fails with: >> >> module unix: Unknown relocation: 9 >> modprobe: FATAL: Error inserting unix (/lib/modules/4.6.0-rc2/kernel/net/unix/unix.ko): Invalid module format >> >> When I revert the patch, the kernel 4.6-rc2 boots fine. >> >> Apparently, the function apply_relocate_add in arch/parisc/kernel/module.c >> doesn't handle the new relocation type. >> >> Mikulas > > BTW. I'm using hppa64 binutils 2.21 to build the kernel. It generates the > R_PARISC_PCREL32 relocation that the kernel module loader doesn't handle: Can you try attached patch (untested) ? Helge > RELOCATION RECORDS FOR [__ex_table]: > OFFSET TYPE VALUE > 0000000000000000 R_PARISC_PCREL32 .text.unix_ioctl+0x0000000000000064 > 0000000000000004 R_PARISC_PCREL32 fixup_put_user_skip_1+0x0000000000000008 > 0000000000000008 R_PARISC_PCREL32 .text.unix_ioctl+0x00000000000000a8 > 000000000000000c R_PARISC_PCREL32 fixup_put_user_skip_1+0x0000000000000008 > 0000000000000010 R_PARISC_PCREL32 .text.unix_ioctl+0x00000000000000b4 > 0000000000000014 R_PARISC_PCREL32 fixup_put_user_skip_1+0x0000000000000008 > 0000000000000018 R_PARISC_PCREL32 .text.unix_ioctl+0x00000000000000c0 > 000000000000001c R_PARISC_PCREL32 fixup_put_user_skip_1+0x0000000000000008 diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c index b9d75d9..f3bfd6a 100644 --- a/arch/parisc/kernel/module.c +++ b/arch/parisc/kernel/module.c @@ -660,6 +660,10 @@ int apply_relocate_add(Elf_Shdr *sechdrs, } *loc = (*loc & ~0x3ff1ffd) | reassemble_22(val); break; + case R_PARISC_PCREL32: + val -= (uint32_t) loc; + *loc = val; + break; default: printk(KERN_ERR "module %s: Unknown relocation: %u\n",