From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MZNHs-0002dH-Ji for mharc-grub-devel@gnu.org; Fri, 07 Aug 2009 07:07:04 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MZNHq-0002bK-AH for grub-devel@gnu.org; Fri, 07 Aug 2009 07:07:02 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MZNHl-0002VV-Aw for grub-devel@gnu.org; Fri, 07 Aug 2009 07:07:01 -0400 Received: from [199.232.76.173] (port=51186 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MZNHl-0002V0-64 for grub-devel@gnu.org; Fri, 07 Aug 2009 07:06:57 -0400 Received: from xvm-190-8.ghst.net ([217.70.190.8]:54229 helo=aybabtu.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MZNHk-0008Pk-FJ for grub-devel@gnu.org; Fri, 07 Aug 2009 07:06:56 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtp (Exim 4.69) (envelope-from ) id 1MZNHi-0004MO-Ut for grub-devel@gnu.org; Fri, 07 Aug 2009 13:06:55 +0200 Received: from rmh by thorin with local (Exim 4.69) (envelope-from ) id 1MZNHi-0001o3-9R for grub-devel@gnu.org; Fri, 07 Aug 2009 13:06:54 +0200 Date: Fri, 7 Aug 2009 13:06:54 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20090807110654.GC6695@thorin> References: <20090804205256.GE15811@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: [PATCH 1/2] Relocator framework X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Aug 2009 11:07:02 -0000 On Wed, Aug 05, 2009 at 12:18:17PM +0200, Vladimir 'phcoder' Serbinenko wrote: > >> +#ifdef __x86_64__ > >> +extern grub_uint64_t grub_relocator32_backward_src; > >> +#else > >> +extern grub_uint32_t grub_relocator32_backward_src; > >> +#endif > > > > You could make this a pointer, or grub_uintptr_t > > (the latter we don't yet have, it seems like a good excuse to > > add it if a pointer is not suitable :-)). > grub_addr_t would actually do the job. Ah yes, of course. > > Are you sure moving to movsl is a good idea?  Maybe the payload size is not > > 4-aligned. > > > On AFAIK x86 movsl works on unaligned addresses too. I'll recheck But maybe there's some corner case in which we would overwrite something if we copy 3 bytes more than necessary? I didn't check if this would be possible. > >> +#ifdef APPLE_CC > >> +     add $(cont0 - base), %eax > >> +#else > >> +     add $(cont0 - base), %rax > >> +#endif > > > > What's the issue at hand?  Apple assembler [1] can't add an inmediate to > > %rax ? > > > Apple linker can't handle 64-bit differences This seems like a bug. Can GNU binutils be used on MacOS to resolve this? If it's workable, I'd rather make binutils a build requirement than adding more of this (the other APPLE_CC ifdefs will probably need some review too, but there's no hurry about that). -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."