[U-Boot] [PATCH v1 6/7] MIPS: u-boot.lds: add relocation specific sections
Gabor Juhos
juhosg at openwrt.org
Mon Feb 11 15:14:31 CET 2013
> that's weird. Actually I checked after each patch if the *_end symbols
> match the U-Boot binary size. Now I checked again with different
> toolchains (gcc-4.[5,6,7], binutils-2.[21.53,22] and I have again that
> binutils issue.
>
> But all toolchains have one in common (tested with qemu_mips):
> __rel_dyn_end - __rel_dyn_start = 0x1770
> size from readelf = 0x15f8
>
> Another problem is that your .deadcode workaround does not work
> anymore for me. It does not matter how I arrange or drop the unneeded
> sections, the size of .rel.dyn remains at 0x1770. I'll try to find
> another solution.
Erm, the presence of the .deadcode section does not change the size of the
.rel.dyn section.
The ELF headers shows that there is a gap between the .rel.dyn and the .deadcode
section:
[ 6] .rel.dyn REL bfc30804 030864 0015f8 08 A 8 0 4
[ 7] .deadcode PROGBITS bfc31f74 031fd4 000004 00 WA 0 0 1
However objcopy will copy the .deadcode section into the final binary because it
is placed after the .rel.dyn section, and the gap will be filled with 0xff bytes.
As a result, the size of u-boot.bin will equal to (__rel_dyn_end - __start + 4),
and this ensures that it will contain the full .rel.dyn section.
$ ls -l u-boot.bin
-rw-r--r-- 1 juhosg root 204664 Feb 11 14:46 u-boot.bin
This is with the attached patch applied on top of the mips/reloc branch.
-Gabor
More information about the U-Boot
mailing list