https://sourceware.org/bugzilla/show_bug.cgi?id=22263
--- Comment #32 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Nelson Chu <nelsonc1...@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=20ef84ed2abb990da08d90e1c978f96d29f40606 commit 20ef84ed2abb990da08d90e1c978f96d29f40606 Author: Nelson Chu <nel...@rivosinc.com> Date: Fri May 26 18:05:34 2023 +0800 [PR ld/22263][PR ld/24676] RISC-V: Avoid spurious R_RISCV_NONE for TLS GD/IE. For TLS GD/IE, add the same condition with the relocate_section in the allocate_dynrelocs, to make sure we won't reserve redundant spaces for dynamic relocations since the conservative estimatation. After applying this patch, ld seems no longer generate the spurious R_RISCV_NONE for pr22263-1 test, and the test in pr24676. bfd/ PR ld/22263 PR ld/24676 * elfnn-riscv.c (RISCV_TLS_GD_IE_NEED_DYN_RELOC): New defined. Set NEED_RELOC to true if TLS GD/IE needs dynamic relocations, and INDX will be the dynamic index. (allocate_dynrelocs): Don't reserve extra spaces in the rela.got if RISCV_TLS_GD_IE_NEED_DYN_RELOC set need_reloc to false. This condition needs to be same as relocate_section. (relocate_section): Likewise, use the same condition as allocate_dynrelocs. -- You are receiving this mail because: You are on the CC list for the bug.