grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Use common linker script for all i386-pc systems


From: Christian Franke
Subject: Re: [PATCH] Use common linker script for all i386-pc systems
Date: Mon, 18 May 2009 23:13:32 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090403 SeaMonkey/1.1.16

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

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]