mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Kevin Du Huanpeng <u74147@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [Makefile bug] make barebox.s : dead loop
Date: Wed, 4 Dec 2013 22:17:13 +0800	[thread overview]
Message-ID: <CANvTkNbJJPEhWdx+Pc1ufk+8rQc4Xzq5pBb02E3axtFLCRnhSA@mail.gmail.com> (raw)
In-Reply-To: <20131203112515.GK24559@pengutronix.de>

Hi, I tested it. works.
1. save the patch to file named x86.patch
2. git apply x86.patch
3. export ARCH=x86
4. make generic_defconfig
5. make
[ no error]
6. make barebox.s
7. endless loop again.
- - - - - -
  CHK     include/generated/compile.h
  CHK     include/generated/version.h
  CHK     include/generated/utsrelease.h
  CHK     include/generated/compile.h
^Cmake[23]: *** [barebox.s] Interrupt
make[22]: *** [barebox.s] Interrupt
make[21]: *** [barebox.s] Interrupt
make[20]: *** [barebox.s] Interrupt
make[19]: *** [barebox.s] Interrupt
make[18]: *** [barebox.s] Interrupt
make[17]: *** [barebox.s] Interrupt
make[16]: *** [barebox.s] Interrupt
make[15]: *** [barebox.s] Interrupt
make[14]: *** [barebox.s] Interrupt
make[13]: *** [barebox.s] Interrupt
make[12]: *** [barebox.s] Interrupt
make[11]: *** [barebox.s] Interrupt
make[10]: *** [barebox.s] Interrupt
- - - -
8. edit Makefile
ifdef CONFIG_X86
-barebox.S : barebox
+barebox.S barebox.s: barebox
ifdef CONFIG_X86_HDBOOT
9. [no error]

2013/12/3 Sascha Hauer <s.hauer@pengutronix.de>:
> Hi Kevin,
>
> On Mon, Dec 02, 2013 at 08:27:39PM +0800, Kevin Du Huanpeng wrote:
>>
>>   LD      arch/x86/boot/built-in.o
>>   GEN     .version
>>   CHK     include/generated/compile.h
>>   UPD     include/generated/compile.h
>>   CC      common/version.o
>>   LD      common/built-in.o
>>   LD      barebox
>> ld: section .eh_frame loaded at [000000000001605c,000000000001f01b]
>> overlaps section .barebox_initcalls loaded at
>> [000000000001605c,00000000000160b7]
>> make: *** [barebox] Error 1
>> dev@bogon:~/wr720n/bug.dis/x86$
>
> Same here. Could you try the following patch? It resolves this for me
> and the resulting image works with qemu.
>
> Sascha
>
> 8<-------------------------------------------------------
>
> From 5be365b6b36372466f88815b97d38bc203c6e183 Mon Sep 17 00:00:00 2001
> From: Sascha Hauer <s.hauer@pengutronix.de>
> Date: Tue, 3 Dec 2013 12:20:56 +0100
> Subject: [PATCH] x86: Fix linker script
>
> Do not load sections to specific addresses. This fixes linking which otherwise
> fails with newer toolchains with:
>
> /opt/OSELAS.Toolchain-2012.12.1/i586-unknown-linux-gnu/gcc-4.7.2-glibc-2.16.0-binutils-2.22-kernel-3.6-sanitized/bin/i586-unknown-linux-gnu-ld: section .eh_frame loaded at [0000000000015fb4,000000000001b0bf] overlaps section .barebox_initcalls loaded at [0000000000015fb4,000000000001600f]
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  arch/x86/lib/barebox.lds.S | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/arch/x86/lib/barebox.lds.S b/arch/x86/lib/barebox.lds.S
> index 05d0f77..83e991c 100644
> --- a/arch/x86/lib/barebox.lds.S
> +++ b/arch/x86/lib/barebox.lds.S
> @@ -137,7 +137,7 @@ SECTIONS
>  #endif
>
>         /* the main barebox part (32 bit) */
> -       .text : AT ( LOADADDR(.bootstrapping) + SIZEOF(.bootstrapping) ) {
> +       .text :  {
>                 /* do not align here! It may fails with the LOADADDR! */
>                 _stext = .;
>                 _text = .;
> @@ -154,38 +154,38 @@ SECTIONS
>         BAREBOX_BARE_INIT_SIZE
>
>         _sdata = .;
> -       .data : AT ( LOADADDR(.text) + SIZEOF(.text) ) {
> +       .data :  {
>                 *(.data*)
>                 . = ALIGN(4);
>         } > barebox
>
> -       .got : AT ( LOADADDR(.data) + SIZEOF (.data) ) {
> +       .got :  {
>                 *(.got*)
>                 . = ALIGN(4);
>         } > barebox
>
> -       .barebox_cmd : AT ( LOADADDR(.got) + SIZEOF (.got) ) {
> +       .barebox_cmd : {
>                 __barebox_cmd_start = .;
>                 BAREBOX_CMDS
>                 __barebox_cmd_end = .;
>                 . = ALIGN(4);
>         } > barebox
>
> -       .barebox_magicvars : AT ( LOADADDR(.barebox_cmd) + SIZEOF (.barebox_cmd) ) {
> +       .barebox_magicvars : {
>                 __barebox_magicvar_start = .;
>                 BAREBOX_MAGICVARS
>                 __barebox_magicvar_end = .;
>                 . = ALIGN(4);
>         } > barebox
>
> -       .barebox_initcalls : AT ( LOADADDR(.barebox_magicvars) + SIZEOF (.barebox_magicvars) ) {
> +       .barebox_initcalls : {
>                 __barebox_initcalls_start = .;
>                 INITCALLS
>                 __barebox_initcalls_end = .;
>                 . = ALIGN(4);
>         } > barebox
>
> -       .__usymtab : AT ( LOADADDR(.barebox_initcalls) + SIZEOF (.barebox_initcalls) ) {
> +       .__usymtab : {
>                 __usymtab_start = .;
>                 BAREBOX_SYMS
>                 __usymtab_end = .;
> --
> 1.8.4.3
>
> --
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2013-12-04 14:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-02  8:22 Kevin Du Huanpeng
2013-12-02  8:36 ` Kevin Du Huanpeng
2013-12-02  9:13   ` Sascha Hauer
2013-12-02 12:27     ` Kevin Du Huanpeng
2013-12-03 11:25       ` Sascha Hauer
2013-12-04 14:17         ` Kevin Du Huanpeng [this message]

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=CANvTkNbJJPEhWdx+Pc1ufk+8rQc4Xzq5pBb02E3axtFLCRnhSA@mail.gmail.com \
    --to=u74147@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox