Summary: | ld riscv: undefined elf_backend_obj_attrs_handle_unknown causes segfault when merging .riscv.attributes | ||
---|---|---|---|
Product: | binutils | Reporter: | Fangrui Song <i> |
Component: | ld | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | NEW --- | ||
Severity: | normal | CC: | kito.cheng, nelson.chu, nelsonc1225, paulkirth |
Priority: | P2 | ||
Version: | 2.40 | ||
Target Milestone: | --- | ||
Host: | Target: | riscv64-*-* | |
Build: | Last reconfirmed: |
Description
Fangrui Song
2022-11-23 17:42:13 UTC
This issue is now preventing us from landing the psABI mandated attribute merging in LLVM for Atomics and the X3 register. https://github.com/llvm/llvm-project/pull/90266 It was first reported to us here: https://github.com/llvm/llvm-project/pull/84597#issuecomment-2079128332, after we had landed those changes. Is there someone on the binutils side we can work with to address this? Android and other platforms will require support for this in their toolchains to prevent mixing objects w/ incompatible Atomics ABIs or incompatible stack ABIs(e.g., Android ships with shadow call stack enabled, which uses the cp/X3 register). The master branch has been updated by Nelson Chu <nelsonc1225@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7bd696ef499176253bfca0c1d16c4b8164ae836d commit 7bd696ef499176253bfca0c1d16c4b8164ae836d Author: Nelson Chu <nelson@rivosinc.com> Date: Fri Jun 9 08:47:17 2023 +0800 RISC-V: PR29823, defined the missing elf_backend_obj_attrs_handle_unknown. bfd/ PR 29823 * elfnn-riscv.c (riscv_elf_obj_attrs_handle_unknown): New function. (elf_backend_obj_attrs_handle_unknown): Defined to riscv_elf_obj_attrs_handle_unknown. There may be a TODO that handle vendor elf attributes, According to the psabi, the vendor attribute number is from 32768, so need to use elf_other_obj_attributes_proc rather than elf_known_obj_attributes_proc to access, and may need to handle the merge rules in the riscv_elf_obj_attrs_handle_unknown. I had tried the similar support in the pr31179, even that we choose another way to fix problem there, maybe the proposed patch will help to support vendor attributes. |