grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Use linker script to remove unnecessary sections


From: Christian Franke
Subject: Re: [PATCH] Use linker script to remove unnecessary sections
Date: Fri, 14 Dec 2007 19:01:02 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4

Bean wrote:
...
diff -u -p -r1.7 aclocal.m4
--- aclocal.m4  25 Nov 2007 02:01:30 -0000      1.7
+++ aclocal.m4  14 Dec 2007 11:51:14 -0000
@@ -57,7 +57,7 @@ else
 fi
 grub_cv_prog_objcopy_absolute=yes
 for link_addr in 2000 8000 7C00; do
-  if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} ${LDFLAGS} -nostdlib -Wl,-N
-Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec]); then :
+  if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-T
"-Wl,${srcdir}/ldscript" -Wl,-Ttext -Wl,$link_addr conftest.o -o
conftest.exec]); then :

Selecting the builtin "-N" script first has no effect if a custom script is specified later. Therefore, "-Wl,-N" is IMO no longer necessary.


Pavel Roskin wrote:
...
We may want to use architecture specific ld scripts, but that can be corrected in further patches.

See "[PATCH] Build on Cygwin" for a working example on how to select a platform specific linker script in configure.ac. This can be easily extended, e.g. test more specific scripts first:

 for f in \
   ${target_cpu}-${platform}-${target_os} \
   ${target_cpu}-${platform} \
   ${target_cpu}; do
   if test -f "${srcdir}/conf/$f-img-ld.sc"; then ...


Christian





reply via email to

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