From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 03 Aug 2009 20:45:04 +0200 (CEST) Received: from smtp2.caviumnetworks.com ([209.113.159.134]:9248 "EHLO smtp2.caviumnetworks.com" rhost-flags-OK-OK-OK-OK) by ftp.linux-mips.org with ESMTP id S1493346AbZHCSo6 (ORCPT ); Mon, 3 Aug 2009 20:44:58 +0200 Received: from maexch1.caveonetworks.com (Not Verified[192.168.14.20]) by smtp2.caviumnetworks.com with MailMarshal (v6,5,4,7535) id ; Mon, 03 Aug 2009 14:44:36 -0400 Received: from caexch01.caveonetworks.com ([192.168.16.9]) by maexch1.caveonetworks.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 3 Aug 2009 14:44:56 -0400 Received: from dd1.caveonetworks.com ([64.169.86.201]) by caexch01.caveonetworks.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Mon, 3 Aug 2009 11:44:55 -0700 Message-ID: <4A773026.3030002@caviumnetworks.com> Date: Mon, 03 Aug 2009 11:44:54 -0700 From: David Daney User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: David VomLehn CC: Ralf Baechle , GCC Help Mailing List , Linux MIPS Mailing List Subject: Re: Relocation problem with MIPS kernel modules References: <20090730184923.GA27030@cuplxvomd02.corp.sa.net> <20090803092030.GB30431@linux-mips.org> <20090803181958.GA7009@cuplxvomd02.corp.sa.net> In-Reply-To: <20090803181958.GA7009@cuplxvomd02.corp.sa.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 03 Aug 2009 18:44:55.0028 (UTC) FILETIME=[7E39B340:01CA146A] Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 23820 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: ddaney@caviumnetworks.com Precedence: bulk X-list: linux-mips David VomLehn wrote: > On Mon, Aug 03, 2009 at 10:20:30AM +0100, Ralf Baechle wrote: >> On Thu, Jul 30, 2009 at 11:49:23AM -0700, David VomLehn wrote: >> >>> To: GCC Help Mailing List , >>> Linux MIPS Mailing List >>> Subject: Relocation problem with MIPS kernel modules >>> Content-Type: text/plain; charset=us-ascii >>> >>> I have a MIPS loadable kernel module that, when I try to insmod it, causes the >>> kernel to emit the message: >>> >>> module xyz: dangerous relocation > ... >>> According to the MIPS ABI, for what it's worth, "Each relocation type of >>> R_MIPS_HI16 must have an associated R_MIPS_LO16 entry immediately following >>> it in the list of relocations." So, what's actually getting generated by >>> gcc and linker differs from the closest thing we have to an ABI of record for >>> MIPS processors. >> The GNU tools as an extension over the MIPS ABI allows an arbitrary number of >> R_MIPS_HI16 relocations to be followed by a R_MIPS_LO16 symbol. All >> relocations of this sequence must use the same symbol, of course. This is >> a very old extension; I think it predates the Linux/MIPS port. > > Perhaps a foolish question, but is this documented anywhere? What more documentation do you need? It's obvious if you read bfd/elf{32,64,xx}-mips.c :-). David Daney