All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Franke <Christian.Franke@t-online.de>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] Use linker script to remove unnecessary sections
Date: Fri, 14 Dec 2007 19:01:02 +0100	[thread overview]
Message-ID: <4762C4DE.4020309@t-online.de> (raw)
In-Reply-To: <20071214111751.sg14rfb84koksws0@webmail.spamcop.net>

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	other threads:[~2007-12-14 18:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-14 12:11 [PATCH] Use linker script to remove unnecessary sections Bean
2007-12-14 16:17 ` Pavel Roskin
2007-12-14 18:01   ` Christian Franke [this message]
2007-12-16 11:17 ` Robert Millan
2007-12-16 16:29   ` Pavel Roskin
2007-12-16 16:39     ` Robert Millan
2007-12-16 21:21       ` Christian Franke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4762C4DE.4020309@t-online.de \
    --to=christian.franke@t-online.de \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.