From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1ItA8m-0007F3-Kh for mharc-grub-devel@gnu.org; Fri, 16 Nov 2007 17:58:24 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ItA8k-0007Dp-6P for grub-devel@gnu.org; Fri, 16 Nov 2007 17:58:22 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ItA8f-00077o-UX for grub-devel@gnu.org; Fri, 16 Nov 2007 17:58:21 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ItA8f-00077l-OQ for grub-devel@gnu.org; Fri, 16 Nov 2007 17:58:17 -0500 Received: from mailout05.sul.t-online.de ([194.25.134.82] helo=mailout05.sul.t-online.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ItA8f-0000Ao-Ae for grub-devel@gnu.org; Fri, 16 Nov 2007 17:58:17 -0500 Received: from fwd28.aul.t-online.de by mailout05.sul.t-online.com with smtp id 1ItA8c-0006hq-05; Fri, 16 Nov 2007 23:58:14 +0100 Received: from [10.3.2.2] (VawZA0ZbYh-O9eCFaVvOmGWSvUsQQ6n+C-1D4Crb6GbSzEpu9oQyERjnTiI+3L8gSv@[217.235.208.193]) by fwd28.aul.t-online.de with esmtp id 1ItA8Y-0MGxc00; Fri, 16 Nov 2007 23:58:10 +0100 Message-ID: <473E2086.9040502@t-online.de> Date: Fri, 16 Nov 2007 23:58:14 +0100 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4 MIME-Version: 1.0 To: grub-devel@gnu.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ID: VawZA0ZbYh-O9eCFaVvOmGWSvUsQQ6n+C-1D4Crb6GbSzEpu9oQyERjnTiI+3L8gSv X-TOI-MSGID: 52b88b5f-5e10-42ee-a859-f4a8a98d6024 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: Building GRUB on platforms without ELF support 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, 16 Nov 2007 22:58:22 -0000 Building GRUB modules requires ELF support in gas and ld. For platforms where ELF is not the native format, ld may support ELF output. If not (like on Cywin) some conversion to ELF is necessary. In general, GNU objcopy allows conversion between object file formats. Unfortunately, objcopy (and BFD itself) does not include any support for the conversion of relocation formats (even conversion between ELF variants do not work). In particular, when converting PE (a COFF variant) to ELF, objcopy does not abort but silently produces bad PC-relative relocation offsets. In my first Cygwin patch, there is a hack to fix this in the GRUB ELF loader. For specific conversions, fixing this in objcopy itself is easy. But there is not much chance that such pragmatic patches will be accepted upstream. (http://sourceware.org/ml/binutils/2007-10/threads.html#00302) I have prepared a reduced (~680 LoC) version of objcopy with the PE->ELF fix added. To support build on non-ELF platforms, I would suggest to add this to the GRUB codebase. It can be later extended for other platforms if desired. Thanks for any comment. Christian