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

cmd/link: invalid relocation: R_DWARFSECREF when building as c-shared on windows/arm64 #47791

Open
zx2c4 opened this issue Aug 18, 2021 · 3 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows
Milestone

Comments

@zx2c4
Copy link
Contributor

zx2c4 commented Aug 18, 2021

When building a c-shared project without -w -s on windows/arm64:

sym 8813: invalid relocation: R_DWARFSECREF .debug_info+0x1f070f
sym 8813: unsupported obj reloc R_DWARFSECREF/4 to go.info.net.IPMask.Size$abstract
sym 8813: invalid relocation: R_DWARFSECREF .debug_info+0x1f0722
sym 8813: unsupported obj reloc R_DWARFSECREF/4 to go.info.net.IPMask.Size$abstract
sym 8813: invalid relocation: R_DWARFSECREF .debug_info+0x1f072a
sym 8813: unsupported obj reloc R_DWARFSECREF/4 to go.info.net.IPMask.Size$abstract
sym 8813: invalid relocation: R_DWARFSECREF .debug_info+0x1f0735
sym 8813: unsupported obj reloc R_DWARFSECREF/4 to go.info.net.IPMask.Size$abstract
sym 8813: invalid relocation: R_DWARFSECREF .debug_info+0x1f070f
sym 8813: unsupported obj reloc R_DWARFSECREF/4 to go.info.net.IPMask.Size$abstract
sym 8813: invalid relocation: R_DWARFSECREF .debug_info+0x1f0722
sym 8813: unsupported obj reloc R_DWARFSECREF/4 to go.info.net.IPMask.Size$abstract
sym 8813: invalid relocation: R_DWARFSECREF .debug_info+0x1f072a
sym 8813: unsupported obj reloc R_DWARFSECREF/4 to go.info.net.IPMask.Size$abstract
sym 8813: invalid relocation: R_DWARFSECREF .debug_info+0x1f0735
sym 8813: unsupported obj reloc R_DWARFSECREF/4 to go.info.net.IPMask.Size$abstract
sym 8818: invalid relocation: R_DWARFSECREF .debug_info+0x200c09
sym 8818: unsupported obj reloc R_DWARFSECREF/4 to go.info.golang.zx2c4.com/wireguard/windows/conf.(*IPCidr).Bits$abstract
sym 8818: invalid relocation: R_DWARFSECREF .debug_info+0x200c09
sym 8818: unsupported obj reloc R_DWARFSECREF/4 to go.info.golang.zx2c4.com/wireguard/windows/conf.(*IPCidr).Bits$abstract
sym 8818: invalid relocation: R_DWARFSECREF .debug_info+0x200c09

Code in question is: https://git.zx2c4.com/wireguard-windows/tree/embeddable-dll-service

I won't be at a real desk for another few weeks, unfortunately, so debugging this one will have to wait. But in case anyone else wants to jump in, the above is what I'm seeing.

@mknyszek mknyszek changed the title windows/arm64: c-shared: invalid relocation: R_DWARFSECREF cmd/link: invalid relocation: R_DWARFSECREF when building as c-shared on windows/arm64 Aug 18, 2021
@mknyszek
Copy link
Contributor

CC @cherrymui @thanm

@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 18, 2021
@mknyszek mknyszek added this to the Backlog milestone Aug 18, 2021
@thanm
Copy link
Contributor

thanm commented Aug 18, 2021

I can take a look, but I also have very limited availability this week (I am mostly on vacation). Hopefully it can wait for a bit.

@zx2c4
Copy link
Contributor Author

zx2c4 commented Aug 18, 2021

Looks like 0x1f0722 is between 1<<20 and 1<<21. So it skips the signext21 check, but hits the first if clause in offsetLabelName.

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
@mknyszek mknyszek moved this to Triage Backlog in Go Compiler / Runtime Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows
Projects
Status: Triage Backlog
Development

No branches or pull requests

5 participants