public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.aribaud@free.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH RFC] armv7: fixloop: don't fixup if location is NULL
Date: Mon, 10 Jan 2011 18:21:06 +0100	[thread overview]
Message-ID: <4D2B4002.2090408@free.fr> (raw)
In-Reply-To: <AANLkTinBromEck3PGLM74Eh-XCyhrZM=iGX6OXgpCGi0@mail.gmail.com>

Le 10/01/2011 15:04, Minkyu Kang a ?crit :

>>> How about lcd_setmem function?
>>> panel_info is located at bss area, but lcd_setmem access this structure.
>>> Is it illegal?
>>
>> This must not be done before relocation.
>
> No, please see 360 line of arch/arm/lib/board.c
> This function is called before relocation.

Then it cannot access panel_info, which is "not there yet" at the time 
lcd_setmem() executes.

You must either move the call to lcd_setmem() to after relocation, or 
find a way not to depend on BSS.

> And how about init_func_i2c()?
> This function is called twice, before the relocation and after relocation.
> When we use board_i2c_init function then, there is possibility that
> use symbols in bss because of this function is called after
> relocation.

If it is used both before and after relocation, then it has to respect 
the strictest case, which is before relocation, and not access BSS.

> If we ignore this exception, it will be a big constraint.
>
> btw, there are any side effects on my patch?
> I think.. It is just a little safety feature.

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.

> Thanks
> Minkyu Kang

Amicalement,
-- 
Albert.

  reply	other threads:[~2011-01-10 17:21 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 [this message]
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
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=4D2B4002.2090408@free.fr \
    --to=albert.aribaud@free.fr \
    --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