> On Oct 5, 2016, at 2:45 PM, valerij zaporogeci <vlrzpr...@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.

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to