All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Bießmann" <andreas.devel@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH RFC] armv7: fixloop: don't fixup if location is NULL
Date: Tue, 11 Jan 2011 14:00:50 +0100	[thread overview]
Message-ID: <4D2C5482.9070800@gmail.com> (raw)
In-Reply-To: <AANLkTikj4LCUUukDKVCG8Shbi6ZHKU9vzGDz0fNG=87b@mail.gmail.com>

Dear Minkyu Kang,

Am 11.01.2011 11:57, schrieb Minkyu Kang:

>> Regardless of the patch, if your code writes to panel_info or any other BSS
>> variable before relocation it will trash the relocation tables that exist at
>> BSS location at this point.
>>
>> IOW, accessing BSS before relocation is forbidden, not just out of fancy,
>> but for a serious reason.
> 
> This patch is not for accessing BSS before relocation,
> it's for prevent exceptions.

The real error is writing to BSS before relocation. This leads to a
corrupted .rel.dyn section which is placed at the same address as .bss
at this moment (bss is overloaded to save space).

If you look in your ELF (e.g. readelf -R .rel.dyn u-boot) you may see,
that the .rel.dyn section does _not_ include a pointer to 0x0 with
relative relocation (0x17) as you showed in a previous post.
If you look in your u-boot.map you may find the function in question
(test_func() was it in your example) is placed in .bss section. Setting
the function pointer to 0 (e.g. test_func() = NULL, as described in
previous mail) before relocation will destroy your .rel.dyn section and
then you will see a zero in .rel.dyn section at some place ... please
investigate the ELF and do not step through the code to find those issues.

I may be wrong, please show it to us.

regards

Andreas Bie?mann

  parent reply	other threads:[~2011-01-11 13:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-27 10:27 [U-Boot] [PATCH RFC] armv7: fixloop: don't fixup if location is NULL Minkyu Kang
     [not found] ` <AANLkTikMdk3D99mEtpLP6ZDb+5WiorN3Qqm-84LkgN6p@mail.gmail.com>
2011-01-04  8:52   ` [U-Boot] [PATCH v2, RFC] armv7: fixloop: don't fixup if location is invalid on RAM Minkyu Kang
2011-01-04  9:49     ` Joakim Tjernlund
2011-01-04 10:04       ` Minkyu Kang
2011-01-04 10:31         ` Joakim Tjernlund
2011-01-04 11:02           ` Minkyu Kang
2011-01-04 16:23             ` Joakim Tjernlund
2011-01-04 17:02             ` Albert ARIBAUD
2011-01-05  5:27               ` Minkyu Kang
2011-01-08  7:43                 ` Albert ARIBAUD
2011-01-08 10:32 ` [U-Boot] [PATCH RFC] armv7: fixloop: don't fixup if location is NULL Andreas Bießmann
2011-01-08 10:49   ` Albert ARIBAUD
2011-01-08 12:18     ` Albert ARIBAUD
2011-01-08 16:44       ` Joakim Tjernlund
2011-01-08 16:51       ` Andreas Bießmann
2011-01-09  9:00         ` Albert ARIBAUD
2011-01-09 21:26           ` Andreas Bießmann
2011-01-10  7:31     ` Minkyu Kang
2011-01-10 10:20       ` Wolfgang Denk
2011-01-10 11:30         ` Minkyu Kang
2011-01-10 12:14           ` Wolfgang Denk
2011-01-10 14:04             ` Minkyu Kang
2011-01-10 17:21               ` Albert ARIBAUD
2011-01-11 10:57                 ` Minkyu Kang
2011-01-11 11:03                   ` Wolfgang Denk
2011-01-11 11:13                     ` Minkyu Kang
2011-01-11 11:23                       ` Wolfgang Denk
2011-01-11 13:00                   ` Andreas Bießmann [this message]
2011-01-11 13:07                     ` Andreas Bießmann

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=4D2C5482.9070800@gmail.com \
    --to=andreas.devel@googlemail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.