From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1428562AbcBSUan (ORCPT ); Fri, 19 Feb 2016 15:30:43 -0500 Received: from terminus.zytor.com ([198.137.202.10]:59429 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422953AbcBSUal (ORCPT ); Fri, 19 Feb 2016 15:30:41 -0500 Subject: Re: [RFC v2 2/7] tables.h: add linker table support To: "Luis R. Rodriguez" , tglx@linutronix.de, mingo@redhat.com, bp@alien8.de References: <1455889559-9428-1-git-send-email-mcgrof@kernel.org> <1455889559-9428-3-git-send-email-mcgrof@kernel.org> Cc: x86@kernel.org, linux-kernel@vger.kernel.org, luto@amacapital.net, boris.ostrovsky@oracle.com, rusty@rustcorp.com.au, david.vrabel@citrix.com, konrad.wilk@oracle.com, mcb30@ipxe.org, jgross@suse.com, ming.lei@canonical.com, gregkh@linuxfoundation.org, arnd@arndb.de, linux-arch@vger.kernel.org, linux@arm.linux.org.uk, benh@kernel.crashing.org, jbaron@akamai.com, ananth@in.ibm.com, anil.s.keshavamurthy@intel.com, davem@davemloft.net, masami.hiramatsu.pt@hitachi.com, andriy.shevchenko@linux.intel.com, dwmw2@infradead.org, xen-devel@lists.xensource.com From: "H. Peter Anvin" Message-ID: <56C77A53.6060708@zytor.com> Date: Fri, 19 Feb 2016 12:25:55 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <1455889559-9428-3-git-send-email-mcgrof@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/19/2016 05:45 AM, Luis R. Rodriguez wrote: > + > +/** > + * DOC: Regular linker linker table constructors > + * > + * Regular constructors are expected to be used for valid linker table entries. > + * Valid uses of weak entries other than the beginning and is currently > + * untested but should in theory work. > + */ > + > +/** > + * LINKTABLE_TEXT - Declares a linker table entry for execution > + * > + * @name: linker table name > + * @level: order level > + * > + * Declares a linker table to be used for execution. > + */ > +#define LINKTABLE_TEXT(name, level) \ > + __typeof__(name[0]) \ > + __attribute__((used, \ > + __aligned__(LINKTABLE_ALIGNMENT(name)), \ > + section(SECTION_TBL(SECTION_TEXT, name, level)))) I'm really confused by this. Text should obviously be readonly, but I'm not at all clear how this works here. The issue with linktables for text is kind of confusing if nothing else; Russel is right about that. It doesn't prevent us from doing something similar, but perhaps it ought to have a different name. For one thing, priority level is meaningless for text, since it is not a table that can be indexed into. -hpa