From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MWwpr-0002xq-QN for mharc-grub-devel@gnu.org; Fri, 31 Jul 2009 14:28:07 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MWwpq-0002wJ-0p for grub-devel@gnu.org; Fri, 31 Jul 2009 14:28:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MWwpl-0002uD-2U for grub-devel@gnu.org; Fri, 31 Jul 2009 14:28:05 -0400 Received: from [199.232.76.173] (port=49271 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWwpk-0002tw-Qw for grub-devel@gnu.org; Fri, 31 Jul 2009 14:28:00 -0400 Received: from mailout08.t-online.de ([194.25.134.20]:49338) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MWwpj-0007gV-HG for grub-devel@gnu.org; Fri, 31 Jul 2009 14:28:00 -0400 Received: from fwd06.aul.t-online.de by mailout08.t-online.de with smtp id 1MWwpg-0008Cq-00; Fri, 31 Jul 2009 20:27:56 +0200 Received: from [10.3.2.2] (Gv1peqZSghvkz+zeVCkCfeC3tf859Ok1KJmh1YIDO51d+UjDG-wbjCBqfw2yll6gZM@[217.235.219.102]) by fwd06.aul.t-online.de with esmtp id 1MWwpY-0RsoTo0; Fri, 31 Jul 2009 20:27:48 +0200 Message-ID: <4A7337AE.5020505@t-online.de> Date: Fri, 31 Jul 2009 20:27:58 +0200 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090403 SeaMonkey/1.1.16 MIME-Version: 1.0 To: The development of GRUB 2 References: <20090731144632.GA14036@thorin> In-Reply-To: <20090731144632.GA14036@thorin> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ID: Gv1peqZSghvkz+zeVCkCfeC3tf859Ok1KJmh1YIDO51d+UjDG-wbjCBqfw2yll6gZM X-TOI-MSGID: ec819b42-4c7c-4a4d-b6fd-f70770a76b13 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: grub-pe2elf 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, 31 Jul 2009 18:28:06 -0000 Hi Robert, Robert Millan wrote: > On a recent discussion on IRC, Bean pointed out that grub-pe2elf is essentially > a workaround for a bug in objcopy. > > It is essentially a limitation of BFD: The object format specific backends are apparently not implemented such that conversion between different relocation formats is supported. In particular, a relocation 'addend' (-4 in this case) is lost during conversion if source or target relocation format do not support it as separate field. Some conversions may work. PE -> ELF does not work, the problem is in both backends in this case. > Bean explained that this bug is quite obvious. It seems Christian sent them > a patch, but it hasn't been applied (I don't know if it was rejected, or just > ignored, Christian could you explain?). > > The patch was actually an ad-hoc approach to fix it in objcopy itself for the PE->ELF case only: http://sourceware.org/ml/binutils/2007-10/msg00302.html A generic solution which would have more chances to get accepted would require substantial work in BFD itself. Conversion between relocation formats is apparently rarely needed. A related bugzilla entry was reopened in 2005 and is idle since then: http://sourceware.org/bugzilla/show_bug.cgi?id=970 > Later in July 2008, Bean added grub-pe2elf to the repository. > > Yes, and I really appreciated this :-) > First of all, I'm worried that we have discussions to decide things and they > are later forgotten or ignored. Bean, please can you provide some explanation > on what happened? > > Also, I think this commit should be reverted (at least the part that adds > grub-pe2elf). I would regret this. Then you could also revert all my Cygwin related additions (some also included in Bean's r1726) because these no longer make much sense unless someone fixes BFD or maintains a ELF toolchain for Cygwin. > Nevertheless, it's not an obligation for us to support win32. As long as we > can do it sanely, I'm fine with it, but I don't want to see GRUB dragged into > a situation in which we need to preserve win32 support at all costs. > > $ find grub2 -type f -name '*.[ch]' | xargs cat | wc -l 128175 $ cat grub2/util/grub-pe2elf.c | wc -l 521 0.4% of the total LoC is IMO less than 'all costs' :-) -- Regards Christian Franke