Inter-compiler portability of asm between gdc and ldc2 (and dmd)

Stefan Koch uplink.coder at googlemail.com
Wed Jul 15 12:14:00 UTC 2020


On Wednesday, 15 July 2020 at 09:38:38 UTC, claptrap wrote:
> On Wednesday, 15 July 2020 at 07:34:08 UTC, Stefan Koch wrote:
>> On Wednesday, 15 July 2020 at 00:26:13 UTC, Cecil Ward wrote:
>>> [...]
>>
>> There is a workaround which I used and that involves runtime 
>> overhead on startup.
>> You just write the bytes that make up your function into an 
>> executable page of memory.
>> Set a function pointer to there, and you are done ;)
>
> Do you pull them out manually or is there a way to get the 
> start and end address of a function in a running program? So 
> could I make an exe that when run dumps the bytes of one of its 
> functions?

I dump em out using objdump.
I guess you could automate that.


More information about the Digitalmars-d mailing list