From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lpk0S-0007nl-Dw for qemu-devel@nongnu.org; Fri, 03 Apr 2009 10:04:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lpk0N-0007k5-A4 for qemu-devel@nongnu.org; Fri, 03 Apr 2009 10:04:27 -0400 Received: from [199.232.76.173] (port=41818 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lpk0N-0007jw-3p for qemu-devel@nongnu.org; Fri, 03 Apr 2009 10:04:23 -0400 Received: from nan.false.org ([208.75.86.248]:41229) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lpk0M-0002jN-KJ for qemu-devel@nongnu.org; Fri, 03 Apr 2009 10:04:22 -0400 Date: Fri, 3 Apr 2009 10:04:19 -0400 From: Daniel Jacobowitz Subject: Re: [Qemu-devel] [RFC] Introduce module API to QEMU Message-ID: <20090403140419.GA23421@caradoc.them.org> References: <1238724755-15929-1-git-send-email-aliguori@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1238724755-15929-1-git-send-email-aliguori@us.ibm.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori , Paul Brook On Thu, Apr 02, 2009 at 09:12:35PM -0500, Anthony Liguori wrote: > It uses __attribute__((section)) to make module_init/module_exit work. I looked > at making this work by using a parser to find and extract all of these things. > I'm not sure I know a good way to force the names to be unique via CPP but in > the very least, I came to the determination that I would need to use something > like perl or python which would introduce a new dependency to the build. FYI, I'm pretty sure this will not work in a Windows-hosted QEMU. There's a mandatory minimum alignment for PE/COFF sections and it will introduce unexpected padding between your array elements. I had to remove a similar trick from prelink when we ported it to Windows. Yes, this does raise the question of how __attribute__((constructor)) works. Maybe it's specific to new named sections? Maybe I'm just misremembering. Anyway, whatever you come up with, testing on Windows would be a good idea if you haven't already. -- Daniel Jacobowitz CodeSourcery