Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aarch64 armasm weirdness on AREA directive #37

Closed
Stammark opened this issue Jun 25, 2020 · 4 comments · Fixed by #38
Closed

Aarch64 armasm weirdness on AREA directive #37

Stammark opened this issue Jun 25, 2020 · 4 comments · Fixed by #38

Comments

@Stammark
Copy link

I'm raising this as an issue because I don't have the knowledge around the impact of this wrt the object file produced or the MSVC linker yet, but my current observation is that using:

AREA CODE, READONLY
in file psm/src/arch/aarch64_armasm.asm results in STATUS_ACCESS_VIOLATION errors at runtime when a function in that file is called.

whereas I don't get that error if I give a dummy area name, like:

AREA xx, CODE, READONLY

I've raised this below for the MS Visual Studio people because my guess is that the assembler should be reporting an error if no AREA name is given.
https://developercommunity.visualstudio.com/content/problem/1088946/armasm64-not-erroring-when-given-no-area-name-give.html

@nagisa
Copy link
Member

nagisa commented Jun 25, 2020

Much appreciated for letting the upstream know, and also for testing the assembly for this rare target. Please let me know how it goes, and if this issue is blocking you, I’m fine with giving a dummy area name, probably something matching the default code section name (.text), maybe?

@danielframpton
Copy link
Contributor

I think we should make the change to use AREA |.text|, CODE, READONLY

Currently CODE is being interpreted as the section name (it doesn't appear to be an optional parameter to the AREA directive). So we end up with a READONLY section called CODE. Because the section is not marked as executable we get an access violation when we call the function.

@nagisa
Copy link
Member

nagisa commented Jun 25, 2020

yeah works for me, want to make a PR? If not I’ll get to it myself later today, in a couple hours.

@nagisa
Copy link
Member

nagisa commented Jun 25, 2020

Will publish a new version of psm 0.1.10 as soon as CI completes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants