From: "Andrew Fish" <afish@apple.com>
To: Roman Kagan <rkagan@virtuozzo.com>,devel@edk2.groups.io
Subject: Re: [edk2-devel] static data in dxe_runtime modules
Date: Fri, 02 Aug 2019 16:54:35 -0700 [thread overview]
Message-ID: <26878.1564790075636681597@groups.io> (raw)
In-Reply-To: <20190801191621.GB14235@rkaganb.sw.ru>
[-- Attachment #1: Type: text/plain, Size: 1004 bytes --]
Roman,
Sorry for the top post, as my email client seems to have eating your email.
1) In C static scopes the visibility of the symbol from a compiler linker point of view, but the static and non-static globals are going to be stored in the same section of the image. On macOS clang the only difference is the static global does not also have a .globl assembly directive to make the label visible outside the scope of the module.
In general Runtime Drivers will gather data that is only available at boot time and store this data in globals, so you can't clear out part of the image on fix-up as that would break a lot of other stuff.
2) The corrrect answer would be to fixup any pointers needed at runtime via RuntimeCryptLibAddressChangeEvent(). On option would be to have an array of the addresses of the static variables and have RuntimeCryptLibAddressChangeEvent() walk that and fixup the Physical addresses to virtual addresses by calling EfiConvertPointer().
Thanks,
Andrew Fish
[-- Attachment #2: Type: text/html, Size: 1157 bytes --]
next prev parent reply other threads:[~2019-08-02 23:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-01 19:16 static data in dxe_runtime modules Roman Kagan
2019-08-02 23:54 ` Andrew Fish [this message]
2019-08-03 2:03 ` [edk2-devel] " Laszlo Ersek
2019-08-05 10:18 ` Roman Kagan
2019-08-07 17:29 ` Laszlo Ersek
2019-08-07 17:41 ` Andrew Fish
2019-08-08 17:39 ` Laszlo Ersek
2019-08-09 16:07 ` Roman Kagan
[not found] ` <15B94CD6CF07DEE2.13696@groups.io>
2019-08-12 18:43 ` Roman Kagan
2019-08-13 9:10 ` Laszlo Ersek
2019-08-13 11:23 ` Roman Kagan
2019-08-14 15:16 ` Laszlo Ersek
2019-08-14 16:26 ` Andrew Fish
2019-08-16 15:22 ` Laszlo Ersek
2019-08-16 17:00 ` Roman Kagan
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=26878.1564790075636681597@groups.io \
--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