https://sourceware.org/bugzilla/show_bug.cgi?id=18668
Bug ID: 18668 Summary: relocation truncated to fit: R_AARCH64_CALL26 (veneers not inserted) Product: binutils Version: 2.26 (HEAD) Status: NEW Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: david.abdurachmanov at gmail dot com Target Milestone: --- The issues was discovered in OpenLoops package, also this was raised on the internet earlier. IIUC, this works fine if ARM linker is used. OpenLoops generates DSO of ~150MB and -/+ 128 MB are not enough for direct calls. ld.bfd does not insert veneers in these cases. A smallest reproducer was posted on LLVM mailing-list: void foo (); int main () {foo();} $ gcc -Wl,--defsym=foo=0x80000000 -o main main.c /tmp/cc0zWsNY.o: In function `main': main.c:(.text+0x8): relocation truncated to fit: R_AARCH64_CALL26 against symbol `foo' defined in *ABS* section in main collect2: error: ld returned 1 exit status Note, that this works fine on ARMv7/AArch32 and veneer is inserted. Tested on Jetson TK1 + binutils 2.24 + GCC 4.8. Looking at AArch64 backend in aarch64_type_of_stub there is a check: 2287 if ((r_type == AARCH64_R (CALL26) || r_type == AARCH64_R (JUMP26)) 2288 && (branch_offset > AARCH64_MAX_FWD_BRANCH_OFFSET 2289 || branch_offset < AARCH64_MAX_BWD_BRANCH_OFFSET)) 2290 { 2291 stub_type = aarch64_stub_long_branch; 2292 } I guess, the mechanism for adding stub/veneer exist, but it's somehow it's not applied here. Binutils commit: d5131498a57d1789ff0fea2cfeb1af90802c8dad (Mon Jul 13 17:14:13 2015 +0100) ### OpenLoops failures ### process_obj/pplljjj/virtual_6_pplljjj_eexuuxggg_1_qp.os: In function `__ol_vamp_6_pplljjj_eexuuxggg_1_qp_MOD_vamp_6': virtual_6_pplljjj_eexuuxggg_1_qp.f90:(.text+0x22820): relocation truncated to fit: R_AARCH64_CALL26 against symbol `__ol_last_step_qp_MOD_check_last_aq_v' defined in .text section i n lib/libopenloops.so virtual_6_pplljjj_eexuuxggg_1_qp.f90:(.text+0x22f94): relocation truncated to fit: R_AARCH64_CALL26 against symbol `__ol_last_step_qp_MOD_check_last_aq_v' defined in .text section i n lib/libopenloops.so virtual_6_pplljjj_eexuuxggg_1_qp.f90:(.text+0x23228): relocation truncated to fit: R_AARCH64_CALL26 against symbol `__ol_vert_interface_qp_MOD_loop_av_q' defined in .text section in lib/libopenloops.so virtual_6_pplljjj_eexuuxggg_1_qp.f90:(.text+0x234d0): relocation truncated to fit: R_AARCH64_CALL26 against symbol `__ol_prop_interface_qp_MOD_loop_a_q' defined in .text section in lib/libopenloops.so virtual_6_pplljjj_eexuuxggg_1_qp.f90:(.text+0x23764): relocation truncated to fit: R_AARCH64_CALL26 against symbol `__ol_vert_interface_qp_MOD_loop_av_q' defined in .text section in lib/libopenloops.so virtual_6_pplljjj_eexuuxggg_1_qp.f90:(.text+0x23a0c): relocation truncated to fit: R_AARCH64_CALL26 against symbol `__ol_prop_interface_qp_MOD_loop_a_q' defined in .text section in lib/libopenloops.so virtual_6_pplljjj_eexuuxggg_1_qp.f90:(.text+0x23c34): relocation truncated to fit: R_AARCH64_CALL26 against symbol `__ol_last_step_qp_MOD_check_last_aq_v' defined in .text section i n lib/libopenloops.so virtual_6_pplljjj_eexuuxggg_1_qp.f90:(.text+0x24180): relocation truncated to fit: R_AARCH64_CALL26 against symbol `__ol_prop_interface_qp_MOD_loop_a_q' defined in .text section in lib/libopenloops.so virtual_6_pplljjj_eexuuxggg_1_qp.f90:(.text+0x24414): relocation truncated to fit: R_AARCH64_CALL26 against symbol `__ol_vert_interface_qp_MOD_loop_av_q' defined in .text section in lib/libopenloops.so virtual_6_pplljjj_eexuuxggg_1_qp.f90:(.text+0x246bc): relocation truncated to fit: R_AARCH64_CALL26 against symbol `__ol_prop_interface_qp_MOD_loop_a_q' defined in .text section in lib/libopenloops.so -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils