[U-Boot] OMAP3: EVM: Linker errors across tool chain versions

Dirk Behme dirk.behme at googlemail.com
Tue Dec 14 16:42:24 CET 2010


On 12.12.2010 12:40, Albert ARIBAUD wrote:
> Le 12/12/2010 11:32, Dirk Behme a écrit :
>
>  >> 2. IIRC, the linker emits a warning, not an error. We can live some
>  >> time with a warning if it is documented and it is being worked on.
>  >
>  > With 2009q1-203 it's an error and 'omap3_evm' isn't built:
>  >
>  > arm-none-linux-gnueabi-ld: section .bss [8003f5e0 -> 8007e33f]
>  > overlaps section .rel.dyn [8003f5e0 -> 80044e6f]
>  >
>  >
>  > arm-none-linux-gnueabi-ld: section .dynsym [80044e70 -> 80044f0f]
>  > overlaps section .bss [8003f5e0 -> 8007e33f]
>  >
>  >
>  > arm-none-linux-gnueabi-ld: u-boot: section .bss vma 0x8003f5e0
>  > overlaps previous sections
>  > make: *** [u-boot] Error 1
>  >
>  > size: './u-boot': No such file
>
> Actually that's not exact. If you do a ./MAKEALL omap3_evm, yes, the
> build will fail. But (with 2010q1 at least, but I d'wager this works
> with 2009q3 as well) a 'make distclean; make omap3_evm_config; make'
> builds despite the linker message.
>
> Can you try this as a diagnostic measure?
>
> Also, you may want to try adding --no-check-sections to the linker
> flags -- again as a diagnostic measure only, not as a fix -- because a
> quick test shows me that the .bin is really different then.

I did a readelf analysis for 3 test cases (with 2009q1-203):

1) As reference, I built 'omap3_beagle' assuming that this is somehow 
the ELF file layout we want. Result [1].

2) Build 'omap3_evm' with the 'convert omap3_evm_version to int patch' 
from

http://lists.denx.de/pipermail/u-boot/2010-December/083524.html

applied. Result [2].

3) Build 'omap3_evm' without any code patches, but with the additional 
linker option  --no-check-sections. Result [3].

Looking at (1) and (2) both built fine and the resulting ELF files 
have 2 program headers.

In contrast to this, the resulting ELF file for (3) looks totally 
different with 3 program headers, an additional one just for .dynsym.

So (3) looks really like a tool chain issue to me. By whatever reason 
using 'omap3_evm_version' as a u8 somehow breaks the linking with some 
tool chains. Or at least outputs a warning and creates an ELF file 
with totally different section headers.

Comparing the resulting ELF file from 'omap3_beagle' (1) to the 
version with the int (2) it seems to me that this is what we want.

So I'd like to re-send the int conversion patch from

http://lists.denx.de/pipermail/u-boot/2010-December/083524.html

in a proper format again as a workaround for this issue.

Ok?

Thanks

Dirk

[1] omap3_beagle:
================

   ...
   Number of program headers:         2

Section Headers:
   [Nr] Name              Type            Addr     Off    Size   ES 
Flg Lk Inf Al
   ...
   [ 7] .rel.dyn          REL             800420c4 0420c4 005af0 08 
A  8   0  4
   [ 8] .dynsym           DYNSYM          80047bb4 047bb4 0000a0 10 
A  0   3  4
   [ 9] .bss              NOBITS          800420c4 000000 031bb4 00 
WA  0   0  8
   ...

Program Headers:
   Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
   LOAD           0x008000 0x80008000 0x80008000 0x3fc54 0x3fc54 RWE 
0x8000
   GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4


Section to Segment mapping:
   Segment Sections...
    00     .text .rodata .hash .data .got.plt .u_boot_cmd .rel.dyn 
.dynsym
    01

...

[2] omap3_evm (with 'convert omap3_evm_version to int patch'):
============

   ...
   Number of program headers:         2
   ...

Section Headers:
   [Nr] Name              Type            Addr     Off    Size   ES 
Flg Lk Inf Al
   ...
   [ 7] .rel.dyn          REL             8003f5e8 03f5e8 005890 08 
A  8   0  4
   [ 8] .dynsym           DYNSYM          80044e78 044e78 0000a0 10 
A  0   3  4
   [ 9] .bss              NOBITS          8003f5e8 000000 03ed60 00 
WA  0   0  8
   ...


Program Headers:
   Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
   LOAD           0x008000 0x80008000 0x80008000 0x3cf18 0x3cf18 RWE 
0x8000
   GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4

Section to Segment mapping:
   Segment Sections...
    00     .text .rodata .hash .data .got.plt .u_boot_cmd .rel.dyn 
.dynsym
    01

...

[3] omap3_evm (code unpatched, with --no-check-sections):
============

   ...
   Number of program headers:         3
   ...

Section Headers:
   [Nr] Name              Type            Addr     Off    Size   ES 
Flg Lk Inf Al
   ...
   [ 7] .rel.dyn          REL             8003f5e0 03f5e0 005890 08 
A  8   0  4
   [ 8] .dynsym           DYNSYM          80044e70 044e70 0000a0 10 
A  0   3  4
   [ 9] .bss              NOBITS          8003f5e0 044e70 03ed60 00 
WA  0   0  8
   ...

Program Headers:
   Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
   LOAD           0x008000 0x80008000 0x80008000 0x3ce70 0x7bbd0 RWE 
0x8000
   LOAD           0x044e70 0x80044e70 0x80044e70 0x000a0 0x000a0 R 
0x8000
   GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4

Section to Segment mapping:
   Segment Sections...
    00     .text .rodata .hash .data .got.plt .u_boot_cmd .rel.dyn .bss
    01     .dynsym
    02

...


More information about the U-Boot mailing list