-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/link: ignore mapping symbols on riscv64 #73592
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
base: master
Are you sure you want to change the base?
Conversation
Specified in RISC-V ELF psABI[1], mapping symbols are symbols starting with "$d" or "$x" with STT_NOTYPE, STB_LOCAL and zero sizes, indicating boundaries between code and data in the same section. Let's simply ignore them as they're only markers instead of real symbols. This fixes linking errors like sym#63 ("$d"): ignoring symbol in section 4 (".riscv.attributes") (type 0) when using CGO together with Clang and internal linker, which are caused by unnecessary (but technically correct) mapping symbols created by LLVM for various sections. Fixes golang#73591 [1]: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/87aecf601722171c570120a46003be3c17ad3108/riscv-elf.adoc?plain=1#L1448
This PR (HEAD: a22540f) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/669675. Important tips:
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/669675. |
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/669675. |
Message from Yao Zi: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/669675. |
Message from Julian Zhu: Patch Set 3: Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/669675. |
Message from Go LUCI: Patch Set 3: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2025-05-03T11:17:53Z","revision":"7edef74737d6f258a39416fbe6f58441b6f50664"} Please don’t reply on this GitHub thread. Visit golang.org/cl/669675. |
Message from Julian Zhu: Patch Set 3: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/669675. |
Message from Go LUCI: Patch Set 3: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/669675. |
Message from Go LUCI: Patch Set 3: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/669675. |
Message from Meng Zhuo: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/669675. |
Message from Yao Zi: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/669675. |
Message from Meng Zhuo: Patch Set 3: Code-Review+2 (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/669675. |
Specified in RISC-V ELF psABI1, mapping symbols are symbols starting
with "$d" or "$x" with STT_NOTYPE, STB_LOCAL and zero sizes, indicating
boundaries between code and data in the same section.
Let's simply ignore them as they're only markers instead of real symbols.
This fixes linking errors like
when using CGO together with Clang and internal linker, which are caused
by unnecessary (but technically correct) mapping symbols created by LLVM
for various sections.
Fixes #73591