From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gabor Juhos Date: Mon, 11 Feb 2013 15:14:31 +0100 Subject: [U-Boot] [PATCH v1 6/7] MIPS: u-boot.lds: add relocation specific sections In-Reply-To: References: <1360442010-7520-1-git-send-email-daniel.schwierzeck@gmail.com> <1360442010-7520-7-git-send-email-daniel.schwierzeck@gmail.com> <5118CC68.4040909@openwrt.org> Message-ID: <5118FCC7.8020706@openwrt.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > 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