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 11:48:08 +0100	[thread overview]
Message-ID: <5118CC68.4040909@openwrt.org> (raw)
In-Reply-To: <1360442010-7520-7-git-send-email-daniel.schwierzeck@gmail.com>

2013.02.09. 21:33 keltez?ssel, daniel.schwierzeck at gmail.com ?rta:
> From: Gabor Juhos <juhosg@openwrt.org>
> 
> This section contain the table needed for dynamic
> relocation. Also provide symbols for the relocation
> code to access the table.
> 
> Discard all sections which are not needed in the final
> ELF binary and U-Boot image. Section .dynsym cannot be
> discarded or GNU ld crashes otherwise. This section
> will be stripped by GNU objcpy in a later patch.
> 
> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> ---
>  arch/mips/cpu/u-boot.lds | 24 +++++++++++++++++++++++-
>  1 file changed, 23 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/mips/cpu/u-boot.lds b/arch/mips/cpu/u-boot.lds
> index 4cd983a..cea9533 100644
> --- a/arch/mips/cpu/u-boot.lds
> +++ b/arch/mips/cpu/u-boot.lds
> @@ -70,7 +70,17 @@ SECTIONS
>  	. = ALIGN(4);
>  	__image_copy_end = .;
>  
> -	.bss : {
> +	.rel.dyn : {
> +		__rel_dyn_start = .;
> +		*(.rel.dyn)
> +		__rel_dyn_end = .;
> +	}
> +
> +	.dynsym : {
> +		*(.dynsym)
> +	}

This is not enough to avoid the binutils issue I have mentioned in the original
patch. The issue is present after applying this series.

The following example comes from the qemu_mips target compiled with the ELDK 5.3
toolchain:

> $ mips-linux-objdump --disassemble u-boot | grep bfc005[67]
> bfc00560:       00000000        nop
> bfc00564:       bfc31f74        cache   0x3,8052(s8)    <--- __rel_dyn_end

The offset of __rel_dyn_end:
0x0bfc31f74 - 0xbfc00000 = 0x31f74 = 204660

> bfc00568:       bfc30804        cache   0x3,2052(s8)
> bfc0056c:       bfc30804        cache   0x3,2052(s8)
> bfc00570:       bfc2fa70        cache   0x2,-1424(s8)
> bfc00574:       000001df        0x1df
> bfc00578 <in_ram>:
> bfc00578:       8d0bfffc        lw      t3,-4(t0)
> bfc0057c:       8d0cfff8        lw      t4,-8(t0)

> $ ls -l u-boot.bin
> -rw-r--r-- 1 juhosg root 204284 Feb 11 11:29 u-boot.bin

204660 - 204284 = 376 bytes are missing from the final u-boot.bin.

-Gabor

  reply	other threads:[~2013-02-11 10:48 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 [this message]
2013-02-11 13:32     ` Daniel Schwierzeck
2013-02-11 14:14       ` Gabor Juhos
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=5118CC68.4040909@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