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

support assembly references to package names #643

Merged
merged 1 commit into from
Jan 12, 2023

Conversation

mvdan
Copy link
Member

@mvdan mvdan commented Jan 12, 2023

(see commit message)

Fixes #619.

Go's package runtime/internal/atomic contains references to functions
which refer to the current package by its package name alone:

	src/runtime/internal/atomic/atomic_loong64.s:   JMP atomic·Load(SB)
	src/runtime/internal/atomic/atomic_loong64.s:   JMP atomic·Load64(SB)
	src/runtime/internal/atomic/atomic_loong64.s:   JMP atomic·Load64(SB)
	src/runtime/internal/atomic/atomic_mips64x.s:   JMP atomic·Load(SB)
	src/runtime/internal/atomic/atomic_mips64x.s:   JMP atomic·Load64(SB)
	src/runtime/internal/atomic/atomic_mips64x.s:   JMP atomic·Load64(SB)

We could only handle unqualified or fully qualified references, like:

	JMP ·Load64(SB)
	JMP runtime∕internal∕atomic·Load64(SB)

Apparently, all three forms are equally valid.
Add a test case and fix it.

I checked whether referencing an imported package by its name worked;
it does not seem to be the case.
This feature appears to be restricted to the current package alone.

While here, we only need goPkgPath when we need to call listPackage.

Fixes burrowers#619.
@mvdan mvdan requested review from lu4p and pagran January 12, 2023 16:30
@mvdan
Copy link
Member Author

mvdan commented Jan 12, 2023

FYI @klauspost

@klauspost
Copy link

Thanks a bunch!

@mvdan mvdan merged commit 5dd6b2d into burrowers:master Jan 12, 2023
@mvdan mvdan deleted the asm-pkg-name branch January 13, 2023 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

panic: runtime listed a std package we can't find: atomic
3 participants