From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-in5.apple.com (mail-out5.apple.com [17.151.62.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 85E511A1E1E for ; Wed, 5 Oct 2016 15:11:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1475705495; h=From:Sender:Reply-To:Subject:Date:Message-id:To:Cc:MIME-version:Content-type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-reply-to:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=cygX3ZBuUtu5P9RypiRPTo6ThUcHCLwTDKvQS5eBdaM=; b=I5KniZG2E2V+RkKTn8AOcadveCJ22xxDuyUagxlsng9nEDMpv6N9P2fkG+2EVI0P dOLVIHEaLyF4HUUSaS0cSV3QdsBc4YkJhbusLRbVE8j6imKKsPLPJQ19JPXL82PD nQMmBUXlX4fFq8yZW2a935MBXvueCGXVWGKRSHS4E/9wWK7DnKplyoTz9Pcecytq 2HkZFeIKlCiASa5Oy0qu6dca+d94fVNtCaaStJGUf/eFRjNsdivhXTR2QWpqXZNl 8/q3yotn7zVCG+kw7j1fInd1PfuCxXoUjq5mKmF3cA552fPXECsXnQfDdmP2auBa x5uK6a/F4nxjABiJAeEcuw==; Received: from relay6.apple.com (relay6.apple.com [17.128.113.90]) by mail-in5.apple.com (Apple Secure Mail Relay) with SMTP id A6.B9.07165.79A75F75; Wed, 5 Oct 2016 15:11:35 -0700 (PDT) X-AuditID: 11973e13-41e679a000001bfd-bb-57f57a9715e8 Received: from nwk-mmpp-sz13.apple.com (nwk-mmpp-sz13.apple.com [17.128.115.216]) by relay6.apple.com (Apple SCV relay) with SMTP id 04.92.23613.69A75F75; Wed, 5 Oct 2016 15:11:34 -0700 (PDT) MIME-version: 1.0 Received: from [17.153.37.250] by nwk-mmpp-sz13.apple.com (Oracle Communications Messaging Server 8.0.1.1.0 64bit (built Jun 15 2016)) with ESMTPSA id <0OEL00FJSHNA2620@nwk-mmpp-sz13.apple.com>; Wed, 05 Oct 2016 15:11:34 -0700 (PDT) Sender: afish@apple.com From: Andrew Fish Message-id: Date: Wed, 05 Oct 2016 15:11:33 -0700 In-reply-to: Cc: edk2-devel To: valerij zaporogeci References: <68CAE063-1A6B-493B-B728-B2991F018DC6@apple.com> <85365CC4-AEB9-41F3-9F71-A32A0AFF4588@apple.com> X-Mailer: Apple Mail (2.3226) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKLMWRmVeSWpSXmKPExsUi2FAYpTu96mu4wbo/zBZ7Dh1ltnj8r53Z gclj56y77B7ds/+xBDBFcdmkpOZklqUW6dslcGUceDyHpeDHAsaKhX/OMTUwzuxl7GLk5JAQ MJFY9fYScxcjF4eQwF5GiSPHzzDBJHZ0/GWCSBxilLj49hZYB6+AoMSPyfdYQGxmgTCJ5xNW M0IUvWOU6PrWzQaSEBYQl3h3ZhMziM0moCyxYv4H9i5GDqBmG4nbzQoQJUoSSxvnsYPYLAKq Es03FoPZnALBEm8mNLBCzNeQ+Lp6O1hcREBH4uD9i1CXHmOS6LsxixVkpoSArMTsX14gcQmB NWwSUy7+ZJ7AKDQLya2zkNwKYWtJfH/UChTnALLlJQ6el4UIa0o8u/eJHcLWlnjy7gLrAka2 VYxCuYmZObqZeaZ6iQUFOal6yfm5mxhB8TDdTngH4+lVVocYBTgYlXh4DTS+hguxJpYVV+Ye YpTmYFES5/V49ClcSCA9sSQ1OzW1ILUovqg0J7X4ECMTB6dUAyOvpp5FGvvR7+9YbsevlLdd KXZFxPK7VGbKCYZibX7dDw1Fmg8nfHJ8/+1X4ZXZdbETC/dOLmN8LnP0XNK6TzdnuD772fvz 9KLyx6LsiVf+3r4d88VlycmDumYXrYMb9dbkNHotCfjtJvjVhCN2/rpt+qaasrOrfl3Lslb+ 8FWQ6evFx78kNRmVWIozEg21mIuKEwHg1RmeaAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCLMWRmVeSWpSXmKPExsUi2FB8Q3da1ddwg759lhZ7Dh1ltnj8r53Z gclj56y77B7ds/+xBDBFcdmkpOZklqUW6dslcGUceDyHpeDHAsaKhX/OMTUwzuxl7GLk5JAQ MJHY0fGXCcIWk7hwbz1bFyMXh5DAIUaJi29vgRXxCghK/Jh8jwXEZhYIk3g+YTUjRNE7Romu b91sIAlhAXGJd2c2MYPYbALKEivmf2DvYuQAaraRuN2sAFGiJLG0cR47iM0ioCrRfGMxmM0p ECzxZkIDK8R8DYmvq7eDxUUEdCQO3r/IDLHrGJNE341ZrCAzJQRkJWb/8prAKDALyXmzkJwH YWtJfH/UChTnALLlJQ6el4UIa0o8u/eJHcLWlnjy7gLrAka2VYwCRak5iZVmeokFBTmpesn5 uZsYwWFdGLWDsWG51SFGAQ5GJR7eG6pfw4VYE8uKK3OBYcTBrCTC+7MCKMSbklhZlVqUH19U mpNafIhRmoNFSZx39+VP4UIC6YklqdmpqQWpRTBZJg5OqQbGyXVuz2ZH8swIcJrU7je9xVTw voycfHfNj0umutHbfWbVV1Z5KFcsshdhDHn0+PGFnUIv7JMaH66Rz+NNyVjILOC5fNPbZl2/ Kyvs8k6UPpyyo2HijiUnIvfPYC7afHjpK2Z3/gtPhHoDdt7cetv3tkS8nvsxa5vVOXE9ZwSe +idpfA8SMLyhxFKckWioxVxUnAgAc8wex2cCAAA= X-Content-Filtered-By: Mailman/MimeDel 2.1.21 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 22:11:35 -0000 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT > On Oct 5, 2016, at 2:45 PM, valerij zaporogeci 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.