Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934133AbbLRElA (ORCPT ); Thu, 17 Dec 2015 23:41:00 -0500 Received: from terminus.zytor.com ([198.137.202.10]:50171 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932748AbbLREk7 (ORCPT ); Thu, 17 Dec 2015 23:40:59 -0500 Subject: Re: [RFC v1 0/8] x86/init: Linux linker tables To: "Luis R. Rodriguez" References: <1450217797-19295-1-git-send-email-mcgrof@do-not-panic.com> <56731D32.4040900@zytor.com> <20151217234625.GM20409@wotan.suse.de> <56738AAF.2080601@zytor.com> Cc: "Luis R. Rodriguez" , tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, konrad.wilk@oracle.com, 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, x86@kernel.org, Michal Marek , xen-devel@lists.xensource.com, Michael Matz , linux-kernel@vger.kernel.org From: "H. Peter Anvin" Message-ID: <56738E29.3070605@zytor.com> Date: Thu, 17 Dec 2015 20:40:09 -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: <56738AAF.2080601@zytor.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: 1226 Lines: 40 On 12/17/15 20:25, H. Peter Anvin wrote: > > /* DECLARE_LINKTABLE_RO */ > extern const struct foo tablename[], tablename__end[]; > > /* DEFINE_LINKTABLE_RO */ > DECLARE_LINKTABLE_RO(struct foo, tablename); > > const struct > foo__attribute__((used,section(".rodata.tbl.tablename.0"))) tablename[0]; > > const struct > foo__attribute__((used,section(".rodata.tbl.tablename.999"))) > tablename__end[0]; > > /* LINKTABLE_RO */ > static const __typeof__(tablename) > __attribute__((used,section(".rodata.tbl.tablename.50"))) > __tbl_tablename_12345 > > /* LINKTABLE_SIZE */ > ((tablename__end) - (tablename)) > > ... and so on for all the possible sections where we may want tables. > Come to think of it, we could even eliminate the need for a DEFINE entirely if we made the start and end symbols static. However, this would generate an awful lot of identical-but-local symbols which probably would make the linker slower and definitely would bloat the debug data. -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/