implement __d_dso_init for AArch64
I wanted to use inline assembler for this, but I haven't written an inline assembler for AArch64 yet.
With this, we might be able to start attempting to compile druntime.
Thanks for your pull request, @WalterBright!
Bugzilla references
Your PR doesn't reference any Bugzilla issue.
If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
Testing this PR locally
If you don't have a local development environment setup, you can use Digger to test this PR:
dub run digger -- build "master + dmd#21450"
ping @thewilsonator @dkorpel
I wanted to use inline assembler for this, but I haven't written an inline assembler for AArch64 yet.
Why inline assembler when the comments make it out to be trivial D code; and it is trivial D code that gdc+ldc have in their druntimes to implement this hook.
Good question! The reasons are:
- it's the only place that needs it
- the backend is not set up to reference symbols that delineate sections
- it's just a handful of lines of code
Good question! The reasons are:
- it's the only place that needs it
- the backend is not set up to reference symbols that delineate sections
- it's just a handful of lines of code
Fair point, its true that gdc and ldc support @section("minfo") void* __start_minfo;, which is a bit of an advantage.
https://gcc.gnu.org/onlinedocs/gcc-15.1.0/gdc/Common-Attributes.html#index-section-function-attribute
Thanks for the link. I'm reluctant to add such things without a demand for them, and dso_init for Elf is the only place I know of that needs it.
Thanks for the link. I'm reluctant to add such things without a demand for them, and dso_init for Elf is the only place I know of that needs it.
I find it quite useful when dealing with non-standard binary formats, but I can just use a more capable compiler backend for that.