From: Keir Fraser Subject: Re: [patch] architecture-specific ELF header checking Date: Tue, 13 Jun 2006 16:42:39 +0100 Message-ID: References: <1150143142.9179.36.camel@basalt.austin.ibm.com> <1150211844.31548.10.camel@basalt.austin.ibm.com> Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1150211844.31548.10.camel@basalt.austin.ibm.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Hollis Blanchard Cc: xen-devel , xen-ia64-devel List-Id: xen-devel@lists.xenproject.org On 13 Jun 2006, at 16:17, Hollis Blanchard wrote: > I would like to minimize the amount of code modified by new > architectures. I think this is a worthy goal because it would avoid > patch conflicts and minimize the chances of accidentally breaking other > architectures. (I guess this is true of all modular code actually; it > would be nice if one could add a new scheduler just by adding a new > source file, without needing to modify other code.) > > In general we can use the build system to give us indirection, instead > of using conditionals in the code. For example, consider > xen/include/public/arch-*.h: just like the "asm" symlink, the build > system could create a symlink to the appropriate architecture's header > for us. I agree, but there's also a question of scope. Macros that are used only be elf-parsing code and that concern the details of elf-header-specific field enumerations arguably do not belong in a repository-global header file. For libxc we probably need per-arch subdirectories for arch-specific source files. There's all sorts of intermingled arch-specific code in tools/libxc right now. We could then have arch-specific implementations of xc_elf_check_header() or somesuch in tools/libxc/, like we do for Xen's domain0 elf-parsing code. That would be cleaner and give more per-arch flexibility. -- Keir