public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Robert Deliën" <robert.delien@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Bug in MIPS linker scripts?
Date: Thu, 14 Dec 2006 17:52:21 +0100	[thread overview]
Message-ID: <000c01c71fa0$38e775f0$dfdd9182@code1.emi.philips.com> (raw)

Hi,

I believe I have found a nasty bug in my target's linker script. And since
all MIPS targets use copies of more-or-less the same linker script, I think
all MIPS targets suffer from this bug.

It's alignment dependent whether the bug will cause a problem or not. The
symptoms can vary from hang-ups in find_cmd for any command to a hang-up if
the first command in the command table is used (usually bdinfo).

The cause of this problem is the 'Update GOT' part in the function relocate
in cpu/mips/start.S. Depending on alignment, this update part will update a
number of entries too many, corrupting whatever is next in memory: The
command table.

The cause of the problem is a misalignment between the _gp linker variable
and the actual '.'. This is what's in board/mipstarget/u-boot.lds now:

	. = ALIGN(4);
	.sdata  : { *(.sdata) }

	_gp = ALIGN(16);

	__got_start = .;
	.got  : { *(.got) }
	__got_end = .;

	.sdata  : { *(.sdata) }

	__u_boot_cmd_start = .;

And this is what it's supposed to be:
	. = ALIGN(4);
	.sdata  : { *(.sdata) }

	. = ALIGN(16);
	_gp = .;
 
	__got_start = .;
	.got  : { *(.got) }
	__got_end = .;

	.sdata  : { *(.sdata) }

	__u_boot_cmd_start = .;

Who can give me any comments?

With kind regards,

	Robert.

                 reply	other threads:[~2006-12-14 16:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='000c01c71fa0$38e775f0$dfdd9182@code1.emi.philips.com' \
    --to=robert.delien@nxp.com \
    --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