public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Andreas Bießmann" <andreas.devel@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH RFC 3/3] arm920t: do not relocate NULL pointer
Date: Tue, 30 Nov 2010 12:48:41 +0100	[thread overview]
Message-ID: <4CF4E499.7050501@gmail.com> (raw)
In-Reply-To: <OF5BB91FC8.AF55EDE6-ONC12577EB.0034C9CF-C12577EB.003538E3@transmode.se>

Dear Joakim Tjernlund,
Dear Albert ARIBAUD,

Am 30.11.2010 10:41, schrieb Joakim Tjernlund:
> Albert ARIBAUD <albert@aribaud.net> wrote on 2010/11/30 10:02:45:
>>
>> Le 30/11/2010 09:47, Joakim Tjernlund a ?crit :
>>>>
>>>> Le 30/11/2010 08:06, Andreas Bie?mann a ?crit :
>>>>> Signed-off-by: Andreas Bie?mann<andreas.devel@googlemail.com>
>>>>
>>>>> +   cmp   r1, #0         /* symbol == NULL ? */
>>>>> +   beq   fixnext
>>>>
>>>> Nak. Don't hide a null pointer. NULL pointers are *not* relocated, since
>>>> they are a constant. If a NULL ends up in relocation tables, that is
>>>> because of a corruption *or* because it was to be relocated, and should
>>>> thus never be ignored.
>>>
>>> Depends, if the same routine is used for relocating fixups you need
>>> this test. Undefined weaks will generate a NULL fixup entry.
>>
>> Understood.
> 
> note that I don't know how this routine is used so if just
> relocates the GOT you don't need to test for NULL.
> 
>>
>> Weren't there an effort to not use weak symbols any more?
> 
> ehh, not what I am aware of. Just that we should not use(ATM)
> undefined weaks.

Ok, I did forget to investigate that as mentioned in
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/88024/focus=88324

Here are the results:

Currently arm920/at91 devices have one undefined weak symbol in .dynsym:

---8<---
Symbol table '.dynsym' contains 11 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND <corrupt>
     1: 10000000     0 SECTION LOCAL  DEFAULT    1 <corrupt>
     2: 10028a28     0 SECTION LOCAL  DEFAULT    6 <corrupt>
     3: 10029ff8     0 NOTYPE  GLOBAL DEFAULT    9 <corrupt>
     4: 100299f4     0 NOTYPE  GLOBAL DEFAULT  ABS <corrupt>
     5: 00000000     0 NOTYPE  WEAK   DEFAULT  UND <corrupt>
     6: 10029ff8     0 NOTYPE  GLOBAL DEFAULT  ABS <corrupt>
     7: 10029ff8     0 NOTYPE  GLOBAL DEFAULT   11 <corrupt>
     8: 1002edf0     0 NOTYPE  GLOBAL DEFAULT   10 <corrupt>
     9: 100701c0     0 NOTYPE  GLOBAL DEFAULT   11 <corrupt>
    10: 1002edf0     0 NOTYPE  GLOBAL DEFAULT    9 <corrupt>
--->8---

---8<---
Hex dump of section '.dynsym':
  0x1002edf0 00000000 00000000 00000000 00000000 ................
  0x1002ee00 00000000 00000010 00000000 03000100 ................
  0x1002ee10 00000000 288a0210 00000000 03000600 ....(...........
  0x1002ee20 25000000 f89f0210 00000000 10000900 %...............
  0x1002ee30 01000000 f4990210 00000000 1000f1ff ................
  0x1002ee40 5e000000 00000000 00000000 20000000 ^........... ...
  0x1002ee50 14000000 f89f0210 00000000 1000f1ff ................
  0x1002ee60 52000000 f89f0210 00000000 10000b00 R...............
  0x1002ee70 43000000 f0ed0210 00000000 10000a00 C...............
  0x1002ee80 20000000 c0010710 00000000 10000b00  ...............
  0x1002ee90 35000000 f0ed0210 00000000 10000900 5...............
--->8---

So there are two options here.

First is to apply '[PATCH v2 1/2] arm920t/at91/reset.c: fix weak
reset_board()' second (and safer) is to apply (maybe modified) '[PATCH
RFC 3/3] arm920t: do not relocate NULL pointer'.

which one is preferred? Or should we do both?

regards

Andreas Bie?mann

  reply	other threads:[~2010-11-30 11:48 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-29 19:58 [U-Boot] Try to fix Board eb_cpux9k2 Jens Scharsig
2010-11-30  7:06 ` [U-Boot] [PATCH RFC 0/3] chenages to arm relocation Andreas Bießmann
2010-11-30  7:06   ` [U-Boot] [PATCH RFC 1/3] arm920t: do not set register useless Andreas Bießmann
2010-11-30  8:07     ` Albert ARIBAUD
2010-11-30  8:28       ` Andreas Bießmann
2010-11-30  9:25         ` Albert ARIBAUD
2010-11-30  7:06   ` [U-Boot] [PATCH RFC 2/3] arm920t: do not use r8 for relocation Andreas Bießmann
2010-11-30  8:22     ` Albert ARIBAUD
2010-11-30  8:35       ` Andreas Bießmann
2010-11-30  8:58         ` Albert ARIBAUD
2010-11-30  7:06   ` [U-Boot] [PATCH RFC 3/3] arm920t: do not relocate NULL pointer Andreas Bießmann
2010-11-30  8:32     ` Albert ARIBAUD
2010-11-30  8:47       ` Joakim Tjernlund
2010-11-30  8:50         ` Andreas Bießmann
2010-11-30  9:02         ` Albert ARIBAUD
2010-11-30  9:41           ` Joakim Tjernlund
2010-11-30 11:48             ` Andreas Bießmann [this message]
2010-11-30 11:56               ` Joakim Tjernlund
2010-11-30  8:37 ` [U-Boot] Try to fix Board eb_cpux9k2 Albert ARIBAUD
2010-12-02 20:27   ` Jens Scharsig
2010-12-02 20:49     ` Albert ARIBAUD
2010-12-01  6:44 ` Albert ARIBAUD

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=4CF4E499.7050501@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox