linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.6.9-mm1 : compile error & question
@ 2004-10-24 22:00 Remi Colinet
  2004-10-25  7:17 ` Vivek Goyal
  0 siblings, 1 reply; 4+ messages in thread
From: Remi Colinet @ 2004-10-24 22:00 UTC (permalink / raw)
  To: linux-kernel

Hi,

I'am getting this error when compiling 2.6.9-mm1 :

 KSYM    .tmp_kallsyms3.S
 AS      .tmp_kallsyms3.o
 LD      vmlinux
 SYSMAP  System.map
 SYSMAP  .tmp_System.map
 AS      arch/i386/boot/setup.o
 LD      arch/i386/boot/setup
 AS      arch/i386/boot/compressed/head.o
 CC      arch/i386/boot/compressed/misc.o
 OBJCOPY arch/i386/boot/compressed/vmlinux.bin
BFD: Warning: Writing section `.bss' to huge (ie negative) file offset 
0xc05c6000.
objcopy: arch/i386/boot/compressed/vmlinux.bin: File truncated
make[2]: *** [arch/i386/boot/compressed/vmlinux.bin] Error 1
make[1]: *** [arch/i386/boot/compressed/vmlinux] Error 2
make: *** [bzImage] Error 2
[root@tigre01 im]# objdump -h ./vmlinux

./vmlinux:     file format elf32-i386

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
 0 .text         0037d80e  c0100000  00100000  00001000  2**12         
<-- something wrong here for LMA used to be 0xc010 000
                 CONTENTS, ALLOC, LOAD, READONLY, CODE
 1 __ex_table    000013b8  c047d810  0047d810  0037e810  2**2
                 CONTENTS, ALLOC, LOAD, READONLY, DATA
 2 .rodata       000a8309  c047ebe0  0047ebe0  0037fbe0  2**5
                 CONTENTS, ALLOC, LOAD, READONLY, DATA
...

23 .exit.text    00001a5b  c06ab430  006ab430  005ac430  2**4
                 CONTENTS, ALLOC, LOAD, READONLY, CODE
24 .init.ramfs   00000086  c06ad000  006ad000  005ae000  2**0
                 CONTENTS, ALLOC, LOAD, READONLY, DATA
25 .data.percpu  00018938  c06ad100  006ad100  005ae100  2**7
                 CONTENTS, ALLOC, LOAD, DATA
26 .bss          0006dfa0  c06c6000  c06c6000  005c7000  2**12     <-- 
somthing wrong with LMA for .bss.
                 CONTENTS, ALLOC, LOAD, DATA
27 .comment      0000c36f  00000000  00000000  00634fa0  2**0
                 CONTENTS, READONLY
28 .debug_line   0021497b  00000000  00000000  0064130f  2**0
...

This is very strange. The .text LMA of the vmlinux file is at 0x__0__010 
0000 whereas, it used to be at  0x__c__010 0000.  But then, the .bss LMA 
of the vmlinux file suddenly jump at 0x__c__06c 6000 instead of 
0x__0__06c 6000 which would have seemed more natural -0).  What can 
cause this offset? I have look for the .bss section content. It contains 
.bss data and .bss.page_aligned. The later seems to be the root of the 
.bss LMA offset.  .bss.page_aligned contains then empty_zero_page and 
the  swapper_pg_dir.

I finally succeded to compile the kernel, using  the following 
OBJCOPYFLAGS in arch/i386/Makefile.

OBJCOPYFLAGS    := -O binary --change-section-lma .bss-0xc0000000 -R 
.note -R .comment -S

I haven't yet tried to boot it.

Any idea to fix this objcopy error otherwise?
Why is the .text LMA set at 0x0010 0000 instead of 0xc010 0000 as it 
used to be?

Thanks
Remi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 2.6.9-mm1 : compile error & question
  2004-10-24 22:00 2.6.9-mm1 : compile error & question Remi Colinet
@ 2004-10-25  7:17 ` Vivek Goyal
  2004-10-25  9:15   ` remi.colinet
  0 siblings, 1 reply; 4+ messages in thread
From: Vivek Goyal @ 2004-10-25  7:17 UTC (permalink / raw)
  To: Remi Colinet
  Cc: linux-kernel, Andrew Morton, suparna bhattacharya, vara prasad,
	Hariprasad Nellitheertha

Hi Remi,

On Mon, 2004-10-25 at 03:30, Remi Colinet wrote:

> Sections:
> Idx Name          Size      VMA       LMA       File off  Algn
>  0 .text         0037d80e  c0100000  00100000  00001000  2**12         
> <-- something wrong here for LMA used to be 0xc010 000


This has been changed so that LMA (Load memory address) reflects the
physical address where sections shall be loaded. This is required to
make sure that a kexec boot can load a vmlinux image.



>                  CONTENTS, ALLOC, LOAD, DATA
> 26 .bss          0006dfa0  c06c6000  c06c6000  005c7000  2**12     <-- 
> somthing wrong with LMA for .bss.
>                  CONTENTS, ALLOC, LOAD, DATA
> 27 .comment      0000c36f  00000000  00000000  00634fa0  2**0
>                  CONTENTS, READONLY
> 28 .debug_line   0021497b  00000000  00000000  0064130f  2**0
> ...
> 
> This is very strange. The .text LMA of the vmlinux file is at 0x__0__010 
> 0000 whereas, it used to be at  0x__c__010 0000.  But then, the .bss LMA 
> of the vmlinux file suddenly jump at 0x__c__06c 6000 instead of 
> 0x__0__06c 6000 which would have seemed more natural -0).  What can 
> cause this offset? I have look for the .bss section content. It contains 
> .bss data and .bss.page_aligned. The later seems to be the root of the 
> .bss LMA offset.  .bss.page_aligned contains then empty_zero_page and 
> the  swapper_pg_dir.

This looks like a problem with the older binutils package. I had faced
similar problem on one of the machines but it was resolved as soon as I
switched to a newer binutils package.


> I finally succeded to compile the kernel, using  the following 
> OBJCOPYFLAGS in arch/i386/Makefile.
> 
> OBJCOPYFLAGS    := -O binary --change-section-lma .bss-0xc0000000 -R 
> .note -R .comment -S
> 
> I haven't yet tried to boot it.
> 
> Any idea to fix this objcopy error otherwise?

Switching to latest binutils package should help.

> Why is the .text LMA set at 0x0010 0000 instead of 0xc010 0000 as it 
> used to be?

To reflect the physical address where .text section shall be loaded. As
mentioned earlier, vmlinux booting using kexec requires this.

Thanks
Vivek




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 2.6.9-mm1 : compile error & question
  2004-10-25  7:17 ` Vivek Goyal
@ 2004-10-25  9:15   ` remi.colinet
  2004-10-25  9:51     ` Vivek Goyal
  0 siblings, 1 reply; 4+ messages in thread
From: remi.colinet @ 2004-10-25  9:15 UTC (permalink / raw)
  To: Vivek Goyal
  Cc: linux-kernel, Andrew Morton, suparna bhattacharya, vara prasad,
	Hariprasad Nellitheertha

Selon Vivek Goyal <vgoyal@in.ibm.com>:

> Hi Remi,
>
> On Mon, 2004-10-25 at 03:30, Remi Colinet wrote:
>
> > Sections:
> > Idx Name          Size      VMA       LMA       File off  Algn
> >  0 .text         0037d80e  c0100000  00100000  00001000  2**12
> > <-- something wrong here for LMA used to be 0xc010 000
>
>
> This has been changed so that LMA (Load memory address) reflects the
> physical address where sections shall be loaded. This is required to
> make sure that a kexec boot can load a vmlinux image.

Does it mean that the .text LMA start address is going to be definitively 0010
0000, even for those who disable kexec in their .config file?

>
>
>
> >                  CONTENTS, ALLOC, LOAD, DATA
> > 26 .bss          0006dfa0  c06c6000  c06c6000  005c7000  2**12     <--
> > somthing wrong with LMA for .bss.
> >                  CONTENTS, ALLOC, LOAD, DATA
> > 27 .comment      0000c36f  00000000  00000000  00634fa0  2**0
> >                  CONTENTS, READONLY
> > 28 .debug_line   0021497b  00000000  00000000  0064130f  2**0
> > ...
> >
> > This is very strange. The .text LMA of the vmlinux file is at 0x__0__010
> > 0000 whereas, it used to be at  0x__c__010 0000.  But then, the .bss LMA
> > of the vmlinux file suddenly jump at 0x__c__06c 6000 instead of
> > 0x__0__06c 6000 which would have seemed more natural -0).  What can
> > cause this offset? I have look for the .bss section content. It contains
> > .bss data and .bss.page_aligned. The later seems to be the root of the
> > .bss LMA offset.  .bss.page_aligned contains then empty_zero_page and
> > the  swapper_pg_dir.
>
> This looks like a problem with the older binutils package. I had faced
> similar problem on one of the machines but it was resolved as soon as I
> switched to a newer binutils package.

My distro is effectively becoming old (FC1). Going to upgrade it.

Thanks
Remi



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 2.6.9-mm1 : compile error & question
  2004-10-25  9:15   ` remi.colinet
@ 2004-10-25  9:51     ` Vivek Goyal
  0 siblings, 0 replies; 4+ messages in thread
From: Vivek Goyal @ 2004-10-25  9:51 UTC (permalink / raw)
  To: remi.colinet
  Cc: linux-kernel, Andrew Morton, suparna bhattacharya, vara prasad,
	Hariprasad Nellitheertha

Hi Remi,

On Mon, 2004-10-25 at 14:45, remi.colinet@free.fr wrote:

> Does it mean that the .text LMA start address is going to be definitively 0010
> 0000, even for those who disable kexec in their .config file?

Yes. 

> >
> > This looks like a problem with the older binutils package. I had faced
> > similar problem on one of the machines but it was resolved as soon as I
> > switched to a newer binutils package.
> 
> My distro is effectively becoming old (FC1). Going to upgrade it.

We are trying to find out why older versions of binutils create this
problem. Also looking into if compatibility can be ascertained between
this new patch and older version of binutils.

Thanks 
Vivek

> 
> Thanks
> Remi
> 
> 
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-10-25  9:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-24 22:00 2.6.9-mm1 : compile error & question Remi Colinet
2004-10-25  7:17 ` Vivek Goyal
2004-10-25  9:15   ` remi.colinet
2004-10-25  9:51     ` Vivek Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).