From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTP id 2247667B6D for ; Fri, 20 Oct 2006 16:06:41 +1000 (EST) Subject: Re: [PATCH 4/5] powerpc: Support feature fixups in modules From: Benjamin Herrenschmidt To: Olof Johansson In-Reply-To: <20061020010147.3ef4694e@pb15> References: <1161308839.10524.111.camel@localhost.localdomain> <20061020010147.3ef4694e@pb15> Content-Type: text/plain Date: Fri, 20 Oct 2006 16:06:24 +1000 Message-Id: <1161324384.10524.152.camel@localhost.localdomain> Mime-Version: 1.0 Cc: linuxppc-dev list , Paul Mackerras List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Fri, 2006-10-20 at 01:01 -0500, Olof Johansson wrote: > On Fri, 20 Oct 2006 11:47:19 +1000 Benjamin Herrenschmidt wrote: > > > This patch adds support for feature fixups in modules. This involves > > adding support for R_PPC64_REL64 relocs to the 64 bits module loader. > > It also modifies modpost.c to ignore the powerpc fixup sections (or it > > would warn when used in .init.text). > > > > Signed-off-by: Benjamin Herrenschmidt > > Acked-by: Olof Johansson > > > Index: linux-cell/arch/powerpc/kernel/module_32.c > > =================================================================== > > --- linux-cell.orig/arch/powerpc/kernel/module_32.c 2006-10-13 16:00:26.000000000 +1000 > > +++ linux-cell/arch/powerpc/kernel/module_32.c 2006-10-13 16:59:36.000000000 +1000 > [...] > > +static const Elf_Shdr *find_section(const Elf_Ehdr *hdr, > > + const Elf_Shdr *sechdrs, > > + const char *name) > > +{ > > + char *secstrings; > > + unsigned int i; > > + > > + secstrings = (char *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; > > + for (i = 1; i < hdr->e_shnum; i++) > > + if (strcmp(secstrings+sechdrs[i].sh_name, name) == 0) > > + return &sechdrs[i]; > > + return NULL; > > +} > > + > > It would be nice if this could be put in some common location instead > of duplicated between the two files. It builds differently on 32 and 64 > bits due to the type defines, but both will never be used in the same > kernel. Or even made completely common, I'll look at it separately. Ben.