binutils-gdb/ld/testsuite
Nelson Chu 8155b8539b RISC-V: Support STO_RISCV_VARIANT_CC and DT_RISCV_VARIANT_CC.
This is the original discussion,
https://github.com/riscv/riscv-elf-psabi-doc/pull/190

And here is the glibc part,
https://sourceware.org/pipermail/libc-alpha/2021-August/129931.html

For binutils part, we need to support a new direcitve: .variant_cc.
The function symbol marked by .variant_cc means it need to be resolved
directly without resolver for dynamic linker.  We also add a new dynamic
entry, STO_RISCV_VARIANT_CC, to indicate there are symbols with the
special attribute in the dynamic symbol table of the object.

I heard that llvm already have supported this in their mainline, so
I think it's time to commit this.

bfd/
	* elfnn-riscv.c (riscv_elf_link_hash_table): Added variant_cc
	flag. It is used to check if relocations for variant CC symbols
	may be present.
	(allocate_dynrelocs): If the symbol has STO_RISCV_VARIANT_CC
	flag, then raise the variant_cc flag of riscv_elf_link_hash_table.
	(riscv_elf_size_dynamic_sections): Added dynamic entry for
	variant_cc.
	(riscv_elf_merge_symbol_attribute): New function, used to merge
	non-visibility st_other attributes, including STO_RISCV_VARIANT_CC.
binutils/
	* readelf.c (get_riscv_dynamic_type): New function.
	(get_dynamic_type): Called get_riscv_dynamic_type for riscv targets.
	(get_riscv_symbol_other): New function.
	(get_symbol_other): Called get_riscv_symbol_other for riscv targets.
gas/
	* config/tc-riscv.c (s_variant_cc): Marked symbol that it follows a
	variant CC convention.
	(riscv_elf_copy_symbol_attributes): Same as elf_copy_symbol_attributes,
	but without copying st_other.  If a function symbol has special st_other
	value set via directives, then attaching an IFUNC resolver to that symbol
	should not override the st_other setting.
	(riscv_pseudo_table): Support variant_cc diretive.
	* config/tc-riscv.h (OBJ_COPY_SYMBOL_ATTRIBUTES): Defined.
	* testsuite/gas/riscv/variant_cc-set.d: New testcase.
	* testsuite/gas/riscv/variant_cc-set.s: Likewise.
	* testsuite/gas/riscv/variant_cc.d: Likewise.
	* testsuite/gas/riscv/variant_cc.s: Likewise.
include/
	* elf/riscv.h (DT_RISCV_VARIANT_CC): Defined to (DT_LOPROC + 1).
	(STO_RISCV_VARIANT_CC): Defined to 0x80.
ld/
	* testsuite/ld-riscv-elf/variant_cc-1.s: New testcase.
	* testsuite/ld-riscv-elf/variant_cc-2.s: Likewise.
	* testsuite/ld-riscv-elf/variant_cc-now.d: Likewise.
	* testsuite/ld-riscv-elf/variant_cc-r.d: Likewise.
	* testsuite/ld-riscv-elf/variant_cc-shared.d: Likewise.
	* testsuite/ld-riscv-elf/ld-riscv-elf.exp: Updated.
2021-11-19 09:32:19 +08:00
..
config CC_FOR_TARGET et al 2021-09-03 16:26:09 +09:30
ld-aarch64 ld: Fix testsuite failures under --enable-textrel-check=error 2021-11-15 11:09:17 -08:00
ld-alpha Change the linker's heuristic for computing the entry point for binaries so that shared libraries default to an entry point of 0. 2021-09-21 13:21:41 +01:00
ld-arc arc: Fix got-weak linker test 2021-09-15 13:49:02 +03:00
ld-arm Change the linker's heuristic for computing the entry point for binaries so that shared libraries default to an entry point of 0. 2021-09-21 13:21:41 +01:00
ld-auto-import ld testsuite tidy 2021-09-03 16:26:21 +09:30
ld-avr
ld-bootstrap ld testsuite tidy 2021-09-03 16:26:21 +09:30
ld-bpf
ld-cdtest ld testsuite tidy 2021-09-03 16:26:21 +09:30
ld-checks
ld-cris
ld-crx
ld-csky
ld-ctf libctf, ld: handle nonrepresentable types better 2021-10-25 11:17:05 +01:00
ld-cygwin ld testsuite tidy 2021-09-03 16:26:21 +09:30
ld-d10v
ld-discard
ld-dynamic
ld-elf elf/x86: Issue an error on discarded output .plt section 2021-11-18 07:58:52 -08:00
ld-elfcomm ld testsuite tidy 2021-09-03 16:26:21 +09:30
ld-elfvers ld testsuite tidy 2021-09-03 16:26:21 +09:30
ld-elfvsb ld testsuite tidy 2021-09-03 16:26:21 +09:30
ld-elfweak ld testsuite tidy 2021-09-03 16:26:21 +09:30
ld-fastcall
ld-frv
ld-gc ld testsuite tidy 2021-09-03 16:26:21 +09:30
ld-h8300
ld-i386 Fix x86 "FAIL: TLS -fno-pic -shared" 2021-09-22 10:24:05 +09:30
ld-ia64 Change the linker's heuristic for computing the entry point for binaries so that shared libraries default to an entry point of 0. 2021-09-21 13:21:41 +01:00
ld-ifunc CC_FOR_TARGET et al 2021-09-03 16:26:09 +09:30
ld-libs
ld-linkonce
ld-loongarch-elf LoongArch ld support 2021-10-24 21:36:32 +10:30
ld-m68hc11
ld-m68k
ld-mep
ld-metag
ld-mips-elf
ld-misc
ld-mmix
ld-mn10300 CC_FOR_TARGET et al 2021-09-03 16:26:09 +09:30
ld-msp430-elf
ld-nds32
ld-nios2
ld-or1k
ld-pdp11
ld-pe ld testsuite tidy 2021-09-03 16:26:21 +09:30
ld-pie CC_FOR_TARGET et al 2021-09-03 16:26:09 +09:30
ld-plugin ld testsuite tidy 2021-09-03 16:26:21 +09:30
ld-powerpc PowerPC64 @notoc in non-power10 code 2021-11-15 12:20:13 +10:30
ld-pru
ld-riscv-elf RISC-V: Support STO_RISCV_VARIANT_CC and DT_RISCV_VARIANT_CC. 2021-11-19 09:32:19 +08:00
ld-s12z
ld-s390
ld-scripts ASSERT in empty output section with address 2021-10-28 10:51:03 +10:30
ld-selective CC_FOR_TARGET et al 2021-09-03 16:26:09 +09:30
ld-sh CC_FOR_TARGET et al 2021-09-03 16:26:09 +09:30
ld-shared ld: set correct flags for AIX shared tests 2021-11-10 14:43:24 +10:30
ld-size
ld-sparc Change the linker's heuristic for computing the entry point for binaries so that shared libraries default to an entry point of 0. 2021-09-21 13:21:41 +01:00
ld-spu
ld-srec LoongArch ld support 2021-10-24 21:36:32 +10:30
ld-tic6x Change the linker's heuristic for computing the entry point for binaries so that shared libraries default to an entry point of 0. 2021-09-21 13:21:41 +01:00
ld-tilegx
ld-tilepro
ld-undefined CC_FOR_TARGET et al 2021-09-03 16:26:09 +09:30
ld-unique LoongArch ld support 2021-10-24 21:36:32 +10:30
ld-v850
ld-vax-elf
ld-visium
ld-vxworks
ld-x86-64 Change the linker's heuristic for computing the entry point for binaries so that shared libraries default to an entry point of 0. 2021-09-21 13:21:41 +01:00
ld-xc16x
ld-xstormy16
ld-xtensa
ld-z8k
ld-z80
lib CC_FOR_TARGET et al 2021-09-03 16:26:09 +09: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