-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/link: Linking in Windows gives "malformed pe file: unexpected flags 0xe0500020 for PE section .text" #9794
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
Comments
0xe0500020 means IMAGE_SCN_MEM_WRITE | IMAGE_SCN_MEM_READ
| IMAGE_SCN_MEM_EXECUTE | IMAGE_SCN_CNT_CODE,
which means _all.o has a writable .text section. We don't support this kind
of writable .text section.
Once #4069 is fixed, this issue should be gone too.
Why do you link the .lib file in LDFLAGS? I don't think it will work.
|
Thanks, @minux I link to the .lib because the .dll doesn't work. I tested with a test c program to be sure, and it compiles with the .lib in LD_FLAGS
vs
I'll keep my eye on that ticket |
Sadly, too late for Go 1.5. |
@rckclmbr I tried building your program:
How do I resolve this error? Alex |
@alexbrainman Look at the Dockerfile, particularly where it says "Install libspotify for win32", and adjust for windows. You may also need to change CFLAGS and LDFLAGS in main.go to the path you extracted libspotify to. I don't have a readily available windows install I can give you more exact instructions, let me know if that's not enough for you and I'll get you better instructions. |
I tried running your C example, but no luck. I copied some files into c_test directory and modified test.c:
What did I do wrong? Alex |
Closing out this bug, since it does not look actionable. |
Go version: 1.4
OS: Windows 8.1 64-bit
GOARCH: 386
Complete example:
https://github.com/rckclmbr/mingwtest
Compiling and linking a c program using mingw works fine, it's just the go linker that isn't working.
The text was updated successfully, but these errors were encountered: