public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Gabor Juhos <juhosg@openwrt.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1 6/7] MIPS: u-boot.lds: add relocation specific sections
Date: Mon, 11 Feb 2013 15:14:31 +0100	[thread overview]
Message-ID: <5118FCC7.8020706@openwrt.org> (raw)
In-Reply-To: <CACUy__WaVfrLsUom84=i_skv16JFdyaSyZaz0XYMzATOotT1XQ@mail.gmail.com>

> 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

  reply	other threads:[~2013-02-11 14:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-09 20:33 [U-Boot] [PATCH v1 0/7] MIPS: add dynamic relocation support daniel.schwierzeck at gmail.com
2013-02-09 20:33 ` [U-Boot] [PATCH v1 1/7] MIPS: u-boot.lds: merge all BSS sections and introduce symbols __bss_[start|end] daniel.schwierzeck at gmail.com
2013-02-09 20:33 ` [U-Boot] [PATCH v1 2/7] MIPS: u-boot.lds: introduce symbol __image_copy_end daniel.schwierzeck at gmail.com
2013-02-09 20:33 ` [U-Boot] [PATCH v1 3/7] MIPS: board.c: switch to new symbols __bss_end and __image_copy_end daniel.schwierzeck at gmail.com
2013-02-09 20:33 ` [U-Boot] [PATCH v1 4/7] MIPS: start.S: optimize BSS initialization daniel.schwierzeck at gmail.com
2013-02-09 20:33 ` [U-Boot] [PATCH v1 5/7] MIPS: start.S: use symbol __image_copy_end for U-Boot image relocation daniel.schwierzeck at gmail.com
2013-02-09 20:33 ` [U-Boot] [PATCH v1 6/7] MIPS: u-boot.lds: add relocation specific sections daniel.schwierzeck at gmail.com
2013-02-11 10:48   ` Gabor Juhos
2013-02-11 13:32     ` Daniel Schwierzeck
2013-02-11 14:14       ` Gabor Juhos [this message]
2013-02-11 14:29         ` Daniel Schwierzeck
2013-02-11 14:32   ` [U-Boot] [PATCH v2 " Daniel Schwierzeck
2013-02-11 14:56     ` Gabor Juhos
2013-02-09 20:33 ` [U-Boot] [PATCH v1 7/7] MIPS: add dynamic relocation support daniel.schwierzeck at gmail.com

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=5118FCC7.8020706@openwrt.org \
    --to=juhosg@openwrt.org \
    --cc=u-boot@lists.denx.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