public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] About EDK2 supports Self Modifying Code
@ 2023-08-15  3:06 Chao Li
  2023-08-15  4:57 ` Andrew Fish via groups.io
  0 siblings, 1 reply; 18+ messages in thread
From: Chao Li @ 2023-08-15  3:06 UTC (permalink / raw)
  To: Liming Gao, Bob Feng, Yuwei Chen; +Cc: devel

[-- Attachment #1: Type: text/plain, Size: 1650 bytes --]

Hi Liming, Bob and Yuwei

There is a need that some code wants to supports Self-Modification, 
because some program behavior may not be determined during compilation, 
and I think this demand may be very popular.

The permise of Self-Modification is that the section has executable and 
writable permissions. Adding a new section and giving it executable and 
writable permissions is a better way, and the 'pragma seg_code' is 
recognized in Microsoft VS compiler but GCC doesn't. If use the GCC as 
the compiler, the '.section name flags' of GNU GAS are acceptable.

But there is a problem, if converting from elf to efi, the user-defined 
section with W+X or A+W+X will be droped, Elf64Convert.c will scan the 
file section permission of elf, if the section is A+X, it will be 
classified into the .text section, if the section is A+W , then it will 
be classified into the .data section, if the section is A+W+X or W+X, 
then it will be droped(Elf64Convert.c, line 272 to 325).

That is:

If using the VS compiler, the user-defined with executable and writable 
sections may be perserved, but GCC elf to efi conversion may not.


Hope hearback from you and discuss the necessity of 
SMC(Slef-Modifying-Code) and how to implement it.



Thanks,
Chao


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107759): https://edk2.groups.io/g/devel/message/107759
Mute This Topic: https://groups.io/mt/100751724/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 2951 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-08-25  4:02 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-15  3:06 [edk2-devel] About EDK2 supports Self Modifying Code Chao Li
2023-08-15  4:57 ` Andrew Fish via groups.io
2023-08-15  8:20   ` Chao Li
2023-08-15  8:28     ` Ard Biesheuvel
2023-08-15  8:54       ` Chao Li
2023-08-15 15:05         ` Andrew Fish via groups.io
2023-08-15 15:39           ` Pedro Falcato
2023-08-15 16:30             ` Andrew Fish via groups.io
2023-08-15 18:48               ` Ard Biesheuvel
2023-08-15 21:26                 ` Andrew Fish via groups.io
2023-08-17  3:38                   ` Chao Li
2023-08-15 15:35     ` Pedro Falcato
2023-08-17  2:30       ` Chao Li
2023-08-17 19:53         ` Michael D Kinney
2023-08-17 20:55           ` Andrew Fish via groups.io
2023-08-19  2:18             ` Chao Li
2023-08-19  4:29               ` Michael D Kinney
2023-08-25  4:02                 ` Chao Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox