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

Unable to loading global variables in inline assembly with -fPIC #19126

Open
dlangBugzillaToGithub opened this issue May 19, 2016 · 1 comment

Comments

@dlangBugzillaToGithub
Copy link

ponce reported this on 2016-05-19T13:22:32Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=16045

CC List

  • basile-z

Description

Consider the following source file `asm_pic.d`:

    align(16) static immutable short[8] A = [ 1, 1, 1, 1, 3, 3, 3, 3 ];

    void main()
    {
        asm
        {                 
            pmullw XMM0, A;
        }
    }

LDC 1.0.0-b1 thinks it's compatible with PIC code.

```bash
$ ldc2 asm_pic.d # ok
$ ldc2 -relocation-model=pic asm_pic.d # ok
```

DMD disallows to load the constant in PIC code.


$ dmd asm_pic.d  # ok
$ dmd -fPIC asm_pic.d  # fail
asm_pic.d(7): Error: cannot directly load global variable 'A' with PIC code
@dlangBugzillaToGithub
Copy link
Author

aliloko commented on 2023-12-17T15:10:17Z

Well I don't have that issue anymore.

@thewilsonator thewilsonator removed the p5 label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants