binutils-gdb/ld/testsuite
Tatsuyuki Ishi 0ac6b8701f RISC-V: Fix local GOT and reloc size calculation for TLS.
The previous code did not account correctly for two cases:
* A TLS symbol can be referenced with multiple TLS types (although rare),
  in which case it only allocated the maximum slot size among the types,
  instead of the sum.
* TLS relocations are only needed for DLLs, unlike normal symbols which
  requires relocations for all PIE code.

Modify the logic to account for the two cases, so this fixes the redundant
dynamic R_RISCV_NONE in .rela.dyn when using --no-pie for TLS GD and IE.

Passed the gcc/binutils regressions of riscv-gnu-toolchain.

bfd/
    * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Handle relocation
    sizing for TLS and non-TLS symbols differently, with the former
    requiring relocs on DLL while the latter requiring on PIE.
    Allocate GOT slots and relocation slots for each TLS type separately,
    accounting for the possibility of a TLS variable getting referenced by
    multiple symbols.
ld/
    * testsuite/ld-riscv-elf/ld-riscv-elf.exp: Updated.
    * testsuite/ld-riscv-elf/tls*: New testcase for TLS GD and IE, with
    symbols referred by both types and global and local symbols.
2024-02-21 14:58:43 +08:00
..
config Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-aarch64 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-alpha Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-arc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-arm Re: elf_backend_finish_dynamic_symbol returning false 2024-02-15 21:28:07 +10:30
ld-auto-import Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-avr Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-bootstrap Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-bpf Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-cdtest Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-checks Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-cris Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-crx Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-csky Trailing spaces in objdump -r header 2022-05-31 11:25:09 +09:30
ld-ctf Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-cygwin Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-d10v Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-discard Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-dynamic Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-elf elf: Rename is_standard_elf to uses_elf_em 2024-01-26 07:32:03 -08:00
ld-elfcomm Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-elfvers Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-elfweak Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-fastcall Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-frv Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-gc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-h8300 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-i386 x86: Don't check R_386_NONE nor R_X86_64_NONE 2024-01-09 06:39:42 -08:00
ld-ia64 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-ifunc ld: Adjust x86 and x86-64 tests for -z mark-plt 2024-01-06 07:10:15 -08:00
ld-kvx Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-libs Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-linkonce Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-loongarch-elf LoongArch: ld: Add support for TLS LE symbol with addend 2024-01-26 16:49:09 +08:00
ld-m68hc11 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-m68k Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-mep Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-metag Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-mips-elf Re: elf_backend_finish_dynamic_symbol returning false 2024-02-15 21:28:07 +10:30
ld-misc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-mmix Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-mn10300 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-msp430-elf Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-nds32 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-nios2 Trailing spaces in objdump -r header 2022-05-31 11:25:09 +09:30
ld-or1k Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-pdp11 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-pe Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-pie Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-plugin Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-powerpc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-pru Trailing spaces in objdump -r header 2022-05-31 11:25:09 +09:30
ld-riscv-elf RISC-V: Fix local GOT and reloc size calculation for TLS. 2024-02-21 14:58:43 +08:00
ld-s12z Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-s390 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-scripts Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-selective Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-sframe Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-sh Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-shared Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-size Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-sparc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-spu Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-srec Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-tic6x Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-tilegx Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-tilepro Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-undefined Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-unique Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-v850 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-vax-elf Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-visium Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-vsb Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-vxworks Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-x86-64 x86-64: Add R_X86_64_CODE_6_GOTTPOFF 2024-02-08 03:45:43 -08:00
ld-xstormy16 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-xtensa Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-z8k Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-z80 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
lib Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-9303