https://sourceware.org/bugzilla/show_bug.cgi?id=32910
Bug ID: 32910 Summary: Relocation error in riscv toolchain when building SPEC OMP 2012 with "-static" option Product: binutils Version: 2.41 Status: UNCONFIRMED Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: dashiellwill at 163 dot com Target Milestone: --- When I built SPEC OMP 2012 using the riscv toolchain and additionally using the "-static" option, I encountered the following error in the 357.bt331 case: relocation truncated to fit: R_RISCV_HI20 against symbol `global_' defined in COMMON section in bt.fppized.o The relevant code is located in "header.h", so I simplified the relevant code to get a small test case that can reproduce the error, as follows: program main double precision elapsed_time double precision grid_points double precision timeron integer my_array(65535,65535,2) common /global/ elapsed_time, grid_points, timeron common /fields/ my_array timeron = 2.0d0 end program It seems that this error is caused by the size of the COMMON section exceeding the range supported by R_RISCV_HI20 during static compilation, the error disappears when reducing the size of ‘my_array’ or not using the static compilation method -- You are receiving this mail because: You are on the CC list for the bug.