https://sourceware.org/bugzilla/show_bug.cgi?id=24365
Bug ID: 24365
Summary: Crash due to RISC-V relocation
Product: binutils
Version: 2.32
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: binutils
Assignee: unassigned at sourceware dot org
Reporter: luismarques at lowrisc dot org
Target Milestone: ---
(Using the RISC-V GNU toolchain built from the commit
afcc8bc655d30cf6af054ac1d3f5f89d0627aa79 of
https://github.com/riscv/riscv-gnu-toolchain.git, commit
a9d9a104dde6a749f40ce5c4576a0042a7d52d1f of riscv-binutils)
$ cat gnurelocbug.s
.global test
test:
auipc t0, %pcrel_hi(test)
addi t0, t0, %pcrel_lo(test)
$ riscv32-unknown-elf-gcc gnurelocbug.s
collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core
dumped
compilation terminated.
$ gdb riscv32-unknown-elf-ld
(gdb) run gnurelocbug.o
Starting program: riscv32-unknown-elf-ld gnurelocbug.o
riscv32-unknown-elf-ld: warning: cannot find entry symbol _start; defaulting to
0000000000010054
Program received signal SIGSEGV, Segmentation fault.
riscv_elf_relocate_section (output_bfd=output_bfd@entry=0x5555556ae180,
info=0x5555556a7d00 <link_info>, input_bfd=input_bfd@entry=0x5555556cd770,
input_section=input_section@entry=0x5555556ce950, contents=0x5555556cc760
"\227\002", relocs=relocs@entry=0x5555556d11e0, local_syms=0x5555556d1c40,
local_sections=0x5555556e5810) at
riscv-gnu-toolchain/riscv-binutils/bfd/elfnn-riscv.c:2062
2062 if ((ELF_ST_TYPE (sym->st_info) == STT_SECTION) &&
rel->r_addend)
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-binutils