public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Andrew Fish <afish@apple.com>
To: valerij zaporogeci <vlrzprgts@gmail.com>
Cc: edk2-devel <edk2-devel@lists.01.org>
Subject: Re: TE relocations
Date: Wed, 05 Oct 2016 15:11:33 -0700	[thread overview]
Message-ID: <BEF79AF8-34E7-4036-9D6A-AD9F2B9E45E4@apple.com> (raw)
In-Reply-To: <CANPuzFz7Bs1or-znVUam=3N0sSDMsYjF6VGB0di4Si0SnpZdwg@mail.gmail.com>


> On Oct 5, 2016, at 2:45 PM, valerij zaporogeci <vlrzprgts@gmail.com> wrote:
> 
> Thank you very much, Andrew.
> The last question. Regarding that scheme you depicted, which entity
> will have ImageBase address when TE image is loaded in the memory? A
> 'conceptual' stripped Pe headers, or Te header?
> Which is placed (even conceptually) at ImageBase address?
> P <--- This? (would have been here if presented)
> P
> P
> PT <--- Or this? (really is put at ImageBase)
> ----
> SECTION_TABLE
> ---
> .text SECTION
> .data SECTION
> .reloc SECTION
> .debug SECTION
> 

The ImageBase is the same for PE/COFF and TE. 
In the code ImageAddress points to the start of T or P (well P can have a DOS header prepended etc). I think a lot of the code operates on ImageAddress and thus needs the adjustment. 

Thanks,

Andrew Fish

> Because looking at the AddressOfEntryPoint adjustment shows TE header
> is placed at ImageBase address. But then again all sections (and the
> addresses of referenced symbols) get shifted at the delta value
> (StrippedSize - SizeOf(TE_HEADER)). The same as AddressOfEntryPoint.
> If ImageBase points to non-existent Pe headers, before TE header, then
> everything is fine with adresses in sections, but AddressOfEntryPoint
> doesn't need to be adjusted as well contrary to what specification
> says.



  reply	other threads:[~2016-10-05 22:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-05 15:08 TE relocations valerij zaporogeci
2016-10-05 16:51 ` Andrew Fish
2016-10-05 19:24   ` valerij zaporogeci
2016-10-05 20:58     ` Andrew Fish
2016-10-05 21:45       ` valerij zaporogeci
2016-10-05 22:11         ` Andrew Fish [this message]
2016-10-05 23:25           ` valerij zaporogeci
2016-10-06  0:07             ` Andrew Fish
2016-10-06 13:01               ` valerij zaporogeci
2016-10-08  8:54               ` Gao, Liming

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-list 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=BEF79AF8-34E7-4036-9D6A-AD9F2B9E45E4@apple.com \
    --to=devel@edk2.groups.io \
    /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