From: Kenneth Johansson <kenneth@southpole.se>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Question About how the CPU find the right string address in U-boot binary file ?
Date: Thu, 05 Jun 2008 11:53:15 +0200 [thread overview]
Message-ID: <1212659595.7271.14.camel@localhost.localdomain> (raw)
In-Reply-To: <6f6a960f0806041850l68abb1b3s31709aef8e76c70f@mail.gmail.com>
On Thu, 2008-06-05 at 09:50 +0800, wang baohua wrote:
> Dear Johansson,
> Thanks for your reply. Your reply is very clear, that's just my
> question. In fact, I am study a
> MIPS binary file, but I cannot find any resource, so I turn to PowerPC
> platform and try to get
> clear understand about the string loading process.
I'm not sure how similar MIPS is to ppc ABI.
> I want to ask according to your reply:
> 1. fff0358c: 80 7e 80 00 lwz r3,-32768(r30)
> Is the -32768 stand for " entry 0 in the .got table" ? Why such a
> translate in objdump?
It's not objectdump that do this it's the compiler that generate the
code like this. r30 is a pointer to the GOT table but the pointer is
located so that it's possible to use the full range of the 16 bit signed
offset. that is if the GOT table only have one entry the r30 value would
be pointing outside of the table but since it's accessed with a singed
offset it will still work.
> 2. I found the .got2 section in the U-boot.map, can you tell me how to
> calc the right string address (traps.o) ?
> .reloc 0xfff34000 0x1578
> *(.got)
> 0xfff34000 _GOT2_TABLE_ = .
> *(.got2)
> .got2 0xfff34000 0x24 cpu/mpc8260/start.o
> .got2 0xfff34024 0x4c cpu/mpc8260/libmpc8260.a(traps.o)
?? I thought this was obvious. to get the entry from the code take the
offset value used in the load and subtract -32768 to get the offset into
the .got2 section. at that address will be a 32 bit address that is the
address of the string.
> thanks!
next prev parent reply other threads:[~2008-06-05 9:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-04 4:04 [U-Boot-Users] Question About how the CPU find the right string address in U-boot binary file ? wang baohua
2008-06-04 12:49 ` Jerry Van Baren
2008-06-05 2:07 ` wang baohua
2008-06-04 14:51 ` Kenneth Johansson
[not found] ` <1212589540.6922.26.camel@localhost.localdomain>
[not found] ` <6f6a960f0806041850l68abb1b3s31709aef8e76c70f@mail.gmail.com>
2008-06-05 9:53 ` Kenneth Johansson [this message]
2008-06-05 12:31 ` Jerry Van Baren
[not found] ` <6f6a960f0806050517x2418e5c0m4dd88f251e2d93f4@mail.gmail.com>
2008-06-05 15:39 ` Kenneth Johansson
2008-06-05 16:00 ` Wolfgang Denk
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=1212659595.7271.14.camel@localhost.localdomain \
--to=kenneth@southpole.se \
--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.