From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1M6A9f-0003E3-LD for mharc-grub-devel@gnu.org; Mon, 18 May 2009 17:13:51 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M6A9d-0003Dk-O6 for grub-devel@gnu.org; Mon, 18 May 2009 17:13:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M6A9Z-0003CA-1U for grub-devel@gnu.org; Mon, 18 May 2009 17:13:49 -0400 Received: from [199.232.76.173] (port=60550 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M6A9Y-0003C7-Sr for grub-devel@gnu.org; Mon, 18 May 2009 17:13:44 -0400 Received: from mailout09.t-online.de ([194.25.134.84]:33339) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M6A9Y-0002gA-Bx for grub-devel@gnu.org; Mon, 18 May 2009 17:13:44 -0400 Received: from fwd07.aul.t-online.de by mailout09.sul.t-online.de with smtp id 1M6A9V-0001iA-01; Mon, 18 May 2009 23:13:41 +0200 Received: from [10.3.2.2] (Sx+2z8ZVghi2ZjrJMDCKAFSwK2hADkMit6JfkmAkopogg42MaD5kcVgAXagF1uMQNW@[217.235.238.137]) by fwd07.aul.t-online.de with esmtp id 1M6A9L-1nCdFo0; Mon, 18 May 2009 23:13:31 +0200 Message-ID: <4A11CF7C.8090303@t-online.de> Date: Mon, 18 May 2009 23:13:32 +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: <20090517053338.32177.43678.stgit@ct.roinet.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------000808020809000900050209" X-ID: Sx+2z8ZVghi2ZjrJMDCKAFSwK2hADkMit6JfkmAkopogg42MaD5kcVgAXagF1uMQNW X-TOI-MSGID: 7a4b0583-21e6-4074-b4cb-e8ccb5be343e X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: [PATCH] Use common linker script for all i386-pc systems 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: Mon, 18 May 2009 21:13:49 -0000 This is a multi-part message in MIME format. --------------000808020809000900050209 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Vladimir 'phcoder' Serbinenko wrote: > Hello. > > On Sun, May 17, 2009 at 7:33 AM, Pavel Roskin <...> wrote: > >> This allows us to remove checks for the linker symbols for the beginning >> and the end of the .bss section. Instead, we use the names from the >> linker script. Another benefit is a better unification of the build >> system. >> >> > > Good idea. Patch works on Cygwin. Does it work on Linux, FreeBSD, ... ? The variable TARGET_IMG_LDFLAGS_AC can also be removed, see attached patch. The linker script is actually identical to the script from my first Cygwin patch. It can be further simplified if desired. >> @@ -0,0 +1,53 @@ >> +/* Linker script to create grub .img files on Cygwin. */ >> > This comment is out of sync > >> VARIABLE(grub_end_addr) >> - .long END_SYMBOL >> + .long __bss_end__ >> > This variable isn't used at all. In my Apple's CC patch I just remove it > > 'grub_start_addr' and '.globl start, _start' are also not used. -- Christian Franke --------------000808020809000900050209 Content-Type: text/plain; name="patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch.txt" diff --git a/configure.ac b/configure.ac index a048828..e799a79 100644 --- a/configure.ac +++ b/configure.ac @@ -212,15 +212,13 @@ AC_MSG_CHECKING([for option to link raw image]) if test -f "${srcdir}/conf/${target_cpu}-${platform}.lds"; then TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}.lds" TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}" - TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/${target_cpu}-${platform}.lds" else TARGET_IMG_LDSCRIPT= TARGET_IMG_LDFLAGS='-Wl,-N' - TARGET_IMG_LDFLAGS_AC='-Wl,-N' fi AC_SUBST(TARGET_IMG_LDSCRIPT) AC_SUBST(TARGET_IMG_LDFLAGS) -AC_MSG_RESULT([$TARGET_IMG_LDFLAGS_AC]) +AC_MSG_RESULT([$TARGET_IMG_LDFLAGS]) # For platforms where ELF is not the default link format. AC_MSG_CHECKING([for command to convert module to ELF format]) @@ -379,11 +377,6 @@ grub_PROG_OBJCOPY_ABSOLUTE grub_PROG_LD_BUILD_ID_NONE grub_ASM_USCORE if test "x$target_cpu" = xi386; then - if test ! -z "$TARGET_IMG_LDSCRIPT"; then - # Check symbols provided by linker script. - CFLAGS="$TARGET_CFLAGS -nostdlib $TARGET_IMG_LDFLAGS_AC -Wl,-Ttext,8000,--defsym,___main=0x8100" - fi - CFLAGS="$TARGET_CFLAGS" grub_I386_ASM_PREFIX_REQUIREMENT grub_I386_ASM_ADDR32 grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK --------------000808020809000900050209--