From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0CC951A1EF3 for ; Wed, 5 Oct 2016 14:45:07 -0700 (PDT) Received: by mail-io0-x22f.google.com with SMTP id r30so590869ioi.1 for ; Wed, 05 Oct 2016 14:45:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=PTD40rKhUlbem02/Sb/aQeWNmc7VOSeAZG0mKnJ2HV4=; b=tG/aqO1oBSq6hL52JeqDKJV/BeZR+iA6ygIMeE+YfhnS/wQwJnGauqCsZei/R3RlKE aSJrsO7oQCVdZBO9XFI2lhu77epnWPwMQKa1He6P6XgaDzkI5r6+DHh/LcFF4B2eoYpX jrpLhnIBYZCadNeQF1Uagut8IZPNVbIZzXb2uMHYZFFYBUEax9mFf37Zvi4cqBmd9qvW rN/SRO/hY900/W4k4t4Wf1aWfjm2+IWPztnsd7YtSeWWDkadZSTve0Bx2sdQG9h4fJBO WUmAD5Pal7kLoLv1wUdajB5DNgkzc3Z6z+Myke+hcY9Y+/qRXArpdX0T/3qPPb5qcaoz 7OVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=PTD40rKhUlbem02/Sb/aQeWNmc7VOSeAZG0mKnJ2HV4=; b=FYVNyO3vE8faw5n1hAdg8Tuv22PzqgxBk01c2meGBP/FWbYcMtZ2IyoXuXBSL+/UIL Xitysf3XZhAdz7RyRHSSUXtn4DXKu5Ql0V1NHD419OcR8J3C6hb8zdKN6uXoHOyDrObn K7omB+5Xt02bvZmz/nulS819plR7Ob443TWXO3XYIW2uKTKvuo2SQax1iNpzCWIbyDhy O2+f8oOJnxari1Mw+ag0U99Bt08R26iIp78d9kwGBP9j3mZHccNniSiVX+LBI7vSWXwP 9hXTS/4zMs8TmqI6+mmtY7x8lf3eYqXX0r03/BclENpGxEjRSu4xqUioY+osm6NQ4RLw bhHg== X-Gm-Message-State: AA6/9RmNC7ZUEm/7V+JkcZKuh9dtDr11/98QwSSbqKEXXXGujh8x7NkwrjQz9hA9xr+UigNWSpBKz9FNNDX/1w== X-Received: by 10.107.173.136 with SMTP id m8mr11650473ioo.188.1475703906427; Wed, 05 Oct 2016 14:45:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.203.132 with HTTP; Wed, 5 Oct 2016 14:45:05 -0700 (PDT) In-Reply-To: <85365CC4-AEB9-41F3-9F71-A32A0AFF4588@apple.com> References: <68CAE063-1A6B-493B-B728-B2991F018DC6@apple.com> <85365CC4-AEB9-41F3-9F71-A32A0AFF4588@apple.com> From: valerij zaporogeci Date: Thu, 6 Oct 2016 00:45:05 +0300 Message-ID: To: Andrew Fish Cc: edk2-devel Subject: Re: TE relocations X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Oct 2016 21:45:07 -0000 Content-Type: text/plain; charset=UTF-8 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 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.