Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755834AbcLNKN4 (ORCPT ); Wed, 14 Dec 2016 05:13:56 -0500 Received: from mx2.suse.de ([195.135.220.15]:50355 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755812AbcLNKNx (ORCPT ); Wed, 14 Dec 2016 05:13:53 -0500 Date: Wed, 14 Dec 2016 10:37:12 +0100 From: Michal Marek To: Dodji Seketeli Cc: Nicholas Piggin , Ian Campbell , Ben Hutchings , Linus Torvalds , Adam Borowski , Greg Kroah-Hartman , Linux Kbuild mailing list , Debian kernel maintainers , "linux-arch@vger.kernel.org" , Arnd Bergmann , Ingo Molnar , Linux Kernel Mailing List Subject: Re: [PATCH] x86/kbuild: enable modversions for symbols exported from asm Message-ID: <20161214093712.GA13721@sepie.suse.cz> References: <1480559754.16599.92.camel@decadent.org.uk> <20161201143928.07a08348@roar.ozlabs.ibm.com> <6e8cf20b-2d2f-ba1f-e02c-c757d5a25db7@suse.com> <20161209133308.0acbb57a@roar.ozlabs.ibm.com> <1481296893.4509.135.camel@hellion.org.uk> <20161210021529.4a6e684f@roar.ozlabs.ibm.com> <86vaus3eld.fsf@seketeli.org> <867f72vqec.fsf@seketeli.org> <20161214091539.GA9000@sepie.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161214091539.GA9000@sepie.suse.cz> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1435 Lines: 82 On 2016-12-14 10:15, Michal Marek wrote: > A minimal example would be > > t1.c: > struct s1; > struct s2 { > int i; > } > struct s3 { > struct s1 *ptr1; > struct s2 *ptr2; > } > void foo(struct s3*); > EXPORT_SYMBOL(foo); > > t2.c: > struct s1 { > int j; > } > struct s2; > struct s3 { > struct s1 *ptr1; > struct s2 *ptr2; > } > void foo(struct s3*); > EXPORT_SYMBOL(foo); Note that the above, if passed to genksyms verbatim, would result in genksyms treating all the types as internal. Here is a complete example including linemarkers: $ cat t1.i # 1 "t1.c" # 1 "" # 1 "" # 1 "t1.c" # 1 "t1.h" 1 # 1 "t.h" 1 struct s1; struct s2; struct s3 { struct s1 *ptr1; struct s2 *ptr2; }; # 2 "t1.h" 2 struct s2 { int i; }; # 2 "t1.c" 2 void foo(struct s3 *s) { } EXPORT_SYMBOL(foo); $ cat t2.i # 1 "t2.c" # 1 "" # 1 "" # 1 "t2.c" # 1 "t2.h" 1 # 1 "t.h" 1 struct s1; struct s2; struct s3 { struct s1 *ptr1; struct s2 *ptr2; }; # 2 "t2.h" 2 struct s1 { int j; }; # 2 "t2.c" 2 void foo(struct s3 *s) { } EXPORT_SYMBOL(foo); $ ./scripts/genksyms/genksyms -D __crc_foo = 0xf731cef8 ; $ ./scripts/genksyms/genksyms -D __crc_foo = 0xc925dae5 ; Michal