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

push OFFSET symbol generates wrong code for Intel syntax on i686 #114759

Open
lhmouse opened this issue Nov 4, 2024 · 1 comment
Open

push OFFSET symbol generates wrong code for Intel syntax on i686 #114759

lhmouse opened this issue Nov 4, 2024 · 1 comment

Comments

@lhmouse
Copy link
Contributor

lhmouse commented Nov 4, 2024

https://godbolt.org/z/vfE68E3c9

; .att_syntax
; pushl $_foo

.intel_syntax noprefix
push OFFSET _foo

This generates a 16-bit push for i686-pc-linux and causes an error for i686-w64-mingw32:

<source>:5:1: error: unsupported relocation type
push OFFSET _foo

Expected behavior is that it should generate a 32-bit push that references _foo as an absolute address.

x86-64 is not affected.

@llvmbot
Copy link
Collaborator

llvmbot commented Nov 4, 2024

@llvm/issue-subscribers-backend-x86

Author: LIU Hao (lhmouse)

https://godbolt.org/z/vfE68E3c9 ```asm ; .att_syntax ; pushl $_foo

.intel_syntax noprefix
push OFFSET _foo


This generates a 16-bit push for i686-pc-linux and causes an error for i686-w64-mingw32:

&gt; \&lt;source\&gt;:5:1: error: unsupported relocation type
&gt; push OFFSET _foo

Expected behavior is that it should generate a 32-bit push that references `_foo` as an absolute address.

x86-64 is not affected.

</details>

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

3 participants