From: Christian Franke <Christian.Franke@t-online.de>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] Use common linker script for all i386-pc systems
Date: Mon, 18 May 2009 23:13:32 +0200 [thread overview]
Message-ID: <4A11CF7C.8090303@t-online.de> (raw)
In-Reply-To: <d7ead6de0905170313n52cc457cr47897be47db68b19@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1032 bytes --]
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
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1277 bytes --]
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
next prev parent reply other threads:[~2009-05-18 21:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-17 5:33 [PATCH] Use common linker script for all i386-pc systems Pavel Roskin
2009-05-17 10:13 ` Vladimir 'phcoder' Serbinenko
2009-05-18 21:13 ` Christian Franke [this message]
2009-05-18 21:27 ` Vladimir 'phcoder' Serbinenko
2009-05-19 20:13 ` Pavel Roskin
2009-05-19 21:15 ` Pavel Roskin
2009-08-18 18:10 ` Pavel Roskin
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=4A11CF7C.8090303@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.