All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
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 13:14:53 +0100	[thread overview]
Message-ID: <20110110121453.67D51150A44@gemini.denx.de> (raw)
In-Reply-To: <AANLkTimgBjOSE8c+_6AsUon5KnNR1_UKNqc=Wf_UD2+J@mail.gmail.com>

Dear Minkyu Kang,

In message <AANLkTimgBjOSE8c+_6AsUon5KnNR1_UKNqc=Wf_UD2+J@mail.gmail.com> you wrote:
> 
> >> int (*test_func)(void);
> >
> > This results in a symbol in bss segment, right?
> >
> >> And then, set to NULL at arch_cpu_init()
> >
> > Such an assignment is illegal then. Bss has not been initalized before
> > relocation, and must not be accessed (neither read nor write).
> 
> Illegal? as a result, yes.

No, illegal as an action.  You MUST NOT access any symbols in BSS
before relocation (more precisely, before bss has been initialized).

And you MUST NOT write any symbols in data segment before relocation,
either.

In both cases, the result of such actions is undefined behaviour.

> But we do many things before the reloaction as arch init, board init and so on.

Of course, but as mentioned we must not read or write to symbols in
bss, and we must not write to symbols in data segment.

> 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.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Without followers, evil cannot spread.
	-- Spock, "And The Children Shall Lead", stardate 5029.5

  reply	other threads:[~2011-01-10 12:14 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 [this message]
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
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=20110110121453.67D51150A44@gemini.denx.de \
    --to=wd@denx.de \
    --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.