From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [PATCH 1/2] modules: add default loader hook implementations Date: Mon, 04 Jul 2011 14:04:37 +0930 Message-ID: <87oc1aslya.fsf@rustcorp.com.au> References: <201106281245.19457.arnd@arndb.de> <1309461732-2875-1-git-send-email-jonas@southpole.se> <1309496433.24186.25.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from ozlabs.org ([203.10.76.45]:58247 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751939Ab1GDFeL (ORCPT ); Mon, 4 Jul 2011 01:34:11 -0400 In-Reply-To: <1309496433.24186.25.camel@localhost> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Jonas Bonn , Linus Torvalds Cc: arnd@arndb.de, geert@linux-m68k.org, mingo@elte.hu, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, monstr@monstr.eu, cmetcalf@tilera.com, akpm@linux-foundation.org On Fri, 01 Jul 2011 07:00:33 +0200, Jonas Bonn wrote: > > On Thu, 2011-06-30 at 13:02 -0700, Linus Torvalds wrote: > > On Thu, Jun 30, 2011 at 12:22 PM, Jonas Bonn wrote: > > > > > > The module loader code allows architectures to hook into the code by > > > providing a small number of entry points that each arch must implement. > > > This patch provides __weakly linked generic implementations of these > > > entry points for architectures that don't need to do anything special. > > > > Hmm. I know we used to have problems with gcc versions (or maybe > > binutils) that had bugs wrt "weak" functions being declared in the > > same compilation unit they were used. They would either inline the > > weak function, or bind it early, and never let the linker see the > > weak/strong functions and do the right thing. > > > > I just don't remember if we disallowed those gcc/binutils versions and > > check for it, or whether we decided that __weak function smust be > > defined in a compilation unit separate from the user. > > > > Because you now added all the weak functions to the same file > > (module.c) that actually uses them. > > There was precedent for this. The function arch_mod_section_prepend was > already defined as __weak in kernel/module.c. > > And just looking around the kernel tree, there are lots of other files > that have their weak variants in the same file as the functions that > rely on them. 'git grep __weak' turns up a whole slew of them. OK, I've applied these. Thanks, Rusty.