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: Vladimir 'phcoder' Serbinenko
Subject: Re: [PATCH] Use common linker script for all i386-pc systems
Date: Mon, 18 May 2009 23:27:56 +0200

On Mon, May 18, 2009 at 11:13 PM, Christian Franke
<address@hidden> wrote:
> 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, ... ?
I will test it on Linux
>
> 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.
>
Could you instead first have a look at my apple cc patch so we can
integrate it first instead of having conflicting patches
>
> 'grub_start_addr'
AFAIK this one can be removed
> and '.globl start, _start' are also not used.
Please keep them. They are required for at least some compilers to
work. If you look at my apple cc patch you'll see I had to add
start/_start in some files
>
>
> --
> 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
>
> _______________________________________________
> Grub-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
>



-- 
Regards
Vladimir 'phcoder' Serbinenko




reply via email to

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