Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933289AbbLQUjU (ORCPT ); Thu, 17 Dec 2015 15:39:20 -0500 Received: from terminus.zytor.com ([198.137.202.10]:46614 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932139AbbLQUjT (ORCPT ); Thu, 17 Dec 2015 15:39:19 -0500 Subject: Re: [RFC v1 0/8] x86/init: Linux linker tables To: "Luis R. Rodriguez" , tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, konrad.wilk@oracle.com References: <1450217797-19295-1-git-send-email-mcgrof@do-not-panic.com> Cc: rusty@rustcorp.com.au, luto@amacapital.net, boris.ostrovsky@oracle.com, mcb30@ipxe.org, jgross@suse.com, JBeulich@suse.com, joro@8bytes.org, ryabinin.a.a@gmail.com, andreyknvl@google.com, long.wanglong@huawei.com, qiuxishi@huawei.com, aryabinin@virtuozzo.com, mchehab@osg.samsung.com, valentinrothberg@gmail.com, peter.senna@gmail.com, mcgrof@suse.com, x86@kernel.org, xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org From: "H. Peter Anvin" X-Enigmail-Draft-Status: N1110 Message-ID: <56731D32.4040900@zytor.com> Date: Thu, 17 Dec 2015 12:38:10 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1450217797-19295-1-git-send-email-mcgrof@do-not-panic.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1502 Lines: 33 I think we can make this even more generic. In particular, I would love to see a solution for link tables that: a) can be used for any kind of data structures, not just function pointers (the latter is a specialization of the former); b) doesn't need any changes to the linker scripts once the initial enabling is done for any one architecture. Key to this is to be able to define tables by name only, which is really why SORT_BY_NAME() is used: the name sorts before the priority simply by putting the name before the class. Instead of .tbl.* naming of sections I think we should have the first component be the type of section (.rodata, .data, .init_rodata, .read_mostly etc.) which makes it easier to write a linker script that properly sorts it into the right section. The other thing is to take a clue from the implementation in iPXE, which uses priority levels 00 and 99 (or we could use non-integers which sort appropriately instead of using "real" levels) to contain the start and end symbols, which eliminates any need for linker script modifications to add new tables. Making this a generic facility we could eventually eliminate a bunch of ad hoc hacks we currently have. Oh, and the link table feature should NOT be x86-specific. -hpa -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/