From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ma1-aaemail-dr-lapp01.apple.com (ma1-aaemail-dr-lapp01.apple.com [17.171.2.60]) by mx.groups.io with SMTP id smtpd.web11.14132.1589669005363914433 for ; Sat, 16 May 2020 15:43:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=DZ5+xFxU; spf=pass (domain: apple.com, ip: 17.171.2.60, mailfrom: afish@apple.com) Received: from pps.filterd (ma1-aaemail-dr-lapp01.apple.com [127.0.0.1]) by ma1-aaemail-dr-lapp01.apple.com (8.16.0.42/8.16.0.42) with SMTP id 04GMevkc052496 for ; Sat, 16 May 2020 15:43:23 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=from : content-type : content-transfer-encoding : mime-version : subject : message-id : date : to; s=20180706; bh=gXlE+hcUv1yN1myBquBK/lKEGVCLNqA0/BMuBndATW0=; b=DZ5+xFxUuGYiry8WHZq09pOFayV70dSf5QtEt2Rl5SgTyHjPArlDE67rhKHr11iQJvnf z0I554RWmwKSdDg8VnSCTVDh4phvRiHGgCx2r2VYRlyIM10DT/sN6bGHZVr0l3vH0Epe zU1RMCYVx90joO3wtVfkNMdZs90D4krl/O5Nrtc8x717N8NoOmaNYki7Fgda87Fo7jqO hfaAnexeZXmvxrd1p1wsC78nQhJMl/pAUwAscR5F9ShlwEBsVeMf1zN8aca9Sf3RHpZg pyYgSr1ZydOtpsG8JcxrW+NZP5L2/4QXGvPn7sACbY73On+8aC5NXQA1Vf/BU6iloAaF Fg== Received: from rn-mailsvcp-mta-lapp01.rno.apple.com (rn-mailsvcp-mta-lapp01.rno.apple.com [10.225.203.149]) by ma1-aaemail-dr-lapp01.apple.com with ESMTP id 312eu1pxcj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sat, 16 May 2020 15:43:23 -0700 Received: from rn-mailsvcp-mmp-lapp04.rno.apple.com (rn-mailsvcp-mmp-lapp04.rno.apple.com [17.179.253.17]) by rn-mailsvcp-mta-lapp01.rno.apple.com (Oracle Communications Messaging Server 8.1.0.5.20200312 64bit (built Mar 12 2020)) with ESMTPS id <0QAG00SMP4GB5H70@rn-mailsvcp-mta-lapp01.rno.apple.com> for devel@edk2.groups.io; Sat, 16 May 2020 15:43:23 -0700 (PDT) Received: from process_milters-daemon.rn-mailsvcp-mmp-lapp04.rno.apple.com by rn-mailsvcp-mmp-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.5.20200312 64bit (built Mar 12 2020)) id <0QAG00S0048ADT00@rn-mailsvcp-mmp-lapp04.rno.apple.com> for devel@edk2.groups.io; Sat, 16 May 2020 15:43:23 -0700 (PDT) X-Va-A: X-Va-T-CD: e0acb9dc03d22e4581b62f3d752335f3 X-Va-E-CD: de35f1d1a3979928f57451d1a3d3800f X-Va-R-CD: 7f5b9678b0a565e6b6a3e6a7c24b87e5 X-Va-CD: 0 X-Va-ID: 9aed3acf-506f-407a-b223-8a97a3b1b583 X-V-A: X-V-T-CD: e0acb9dc03d22e4581b62f3d752335f3 X-V-E-CD: de35f1d1a3979928f57451d1a3d3800f X-V-R-CD: 7f5b9678b0a565e6b6a3e6a7c24b87e5 X-V-CD: 0 X-V-ID: 91e4c70d-fecf-4425-8c88-b1bb287addf1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.676 definitions=2020-05-16_13:2020-05-15,2020-05-16 signatures=0 Received: from [17.235.36.144] (unknown [17.235.36.144]) by rn-mailsvcp-mmp-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.5.20200312 64bit (built Mar 12 2020)) with ESMTPSA id <0QAG007HM4GA1E00@rn-mailsvcp-mmp-lapp04.rno.apple.com> for devel@edk2.groups.io; Sat, 16 May 2020 15:43:23 -0700 (PDT) From: "Andrew Fish" MIME-version: 1.0 (Mac OS X Mail 13.0 \(3594.4.17\)) Subject: Hii PE/COFF resource section. Message-id: <1CEFBD01-06D7-4973-9C90-AB7E0BA2CB2F@apple.com> Date: Sat, 16 May 2020 15:43:21 -0700 To: edk2-devel-groups-io X-Mailer: Apple Mail (2.3594.4.17) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.676 definitions=2020-05-16_13:2020-05-15,2020-05-16 signatures=0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: quoted-printable I finally bit the bullet and tried to figure out how to ge Hii resource = sections working with Xcode (any tool chain that does not have a = resource compiler). I have some crazy ideas that look like they might work but I'm seeing = something strange in the code that extracts the HII resource section = [1]. =46rom what I'm seeing it seems to imply that = ResourceDirectoryEntry->u2.OffsetToData is an image relative offset, but = ResourceDirectoryEntry->u2.s.OffsetToDirectory seems relative to the = section? That seems like of strange. Is that how it works? My hack is 2 fold.=20 1) In [Hii-Binary-Package.UEFI_HII] I create an empty = $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.lib. The $(RC) usually creates a lib = with the resource section, but given libs in Xcode are mach-O Images = that is not super helpful. If the magic libs are constructed then $(RC) = aware linkers can do the magic.=20 2) I updated the Xcode rule for [Dynamic-Library-File] to pass --rc = $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc to $(GENFW)". If that file does not = exist it then no-op, if the file exists append the .rc to the end of the = image, point the resource directory entry, and grow the last section. = For Xcode this is always the .debug section.=20 [1] = https://github.com/tianocore/edk2/blob/master/MdePkg/Library/BasePeCoffLib= /BasePeCoff.c#L1521 Thanks, Andrew Fish