binutils-gdb/include
Nelson Chu 39ff0b8123 RISC-V: Report warning when linking the objects with different priv specs.
We do know some conflicts among different privileged specs.  For linker,
the safest approach is that don't allow the object linked with others which
may cause conflicts.  But this may cause inconvenience since not all objects
with conflicting priv specs are linked will cause problems.  But it is hard
to know the detailed conflict cases for linker, so we probably need a option
to tell linker that we do know there are no conflicts, or we are willing to
take risks to link the objects with conflicted priv specs.  But the option
is still under discussion.

Therefore, we can report warnings rather than errors when linking the objects
with conflicted priv specs.  This not only makes the linker more flexible,
but also warns people that the conflicts may happen.  We also need to update
the output priv spec version once the input priv spec is newer.

	bfd/
	* elfxx-riscv.c (struct priv_spec_t priv_specs[]): Move them from
	opcodes/riscv-opc.c to bfd/elfxx-riscv.c, since we need it in linker.
	(riscv_get_priv_spec_class): Likewise.
	(riscv_get_priv_spec_name): Likewise.
	(riscv_get_priv_spec_class_from_numbers): New function, convert
	the version numbers into string, then call riscv_get_priv_spec_class
	to get the priv spec class.
	* elfxx-riscv.h (riscv_get_priv_spec_class): Move forward declaration
	from include/opcode/riscv.h to bfd/elfxx-riscv.h.
	(riscv_get_priv_spec_name): Likewise.
	(riscv_get_priv_spec_class_from_numbers): New forward declaration.
	(opcode/riscv.h): Include it in the header rather than elfxx-riscv.c.
	* elfnn-riscv.c (riscv_merge_attributes):  Get the priv spec classes
	of input and output objects form their priv spec attributes by
	riscv_get_priv_spec_class_from_numbers.  Report warning rather than
	errors when linking objects with differnet priv spec versions.  We do
	know v1.9.1 may have conflicts to other versions, so report the
	warning, too.  After that, update the output priv spec version to the
	newest one so far.

	gas/
	* config/tc-riscv.c (buf_size, buf): Remove the unused variables.
	(riscv_set_default_priv_spec): Get the priv spec version from the
	priv spec attributes by riscv_get_priv_spec_class_from_numbers.

	include/
	* opcode/riscv.h (riscv_get_priv_spec_class): Move the function
	forward declarations to bfd/elfxx-riscv.h.
	(riscv_get_priv_spec_name): Likewise.

	opcodes/
	* riscv-opc.c: Move the structures and functions to bfd/elfxx-riscv.c.
	* riscv-dis.c: Include elfxx-riscv.h.

	ld/
	* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-01.d: Updated.
	* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-02.d: Updated.
	* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-03.d: Updated.
	* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-04.d: Updated.
	* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-05.d: Updated.
	* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-06.d: Updated.
2020-06-22 10:01:14 +08:00
..
aout Fixes for the magic number used in PDP11 AOUT binaries. 2020-04-14 14:41:27 +01:00
cgen Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
coff coff-go32-exe: support variable-length stubs 2020-04-02 14:31:43 +01:00
elf xtensa: allow runtime ABI selection 2020-06-15 13:01:30 -07:00
gdb Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
mach-o Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
opcode RISC-V: Report warning when linking the objects with different priv specs. 2020-06-22 10:01:14 +08:00
som ubsan: som: left shift of 1 by 31 places 2020-03-10 17:58:02 +10:30
vms Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
COPYING
COPYING3
ChangeLog RISC-V: Report warning when linking the objects with different priv specs. 2020-06-22 10:01:14 +08:00
ChangeLog-0415 binutils ChangeLog rotation 2016-01-01 22:59:17 +10:30
ChangeLog-2016 ChangeLog rotation 2017-01-02 13:55:05 +10:30
ChangeLog-2017 ChangeLog rotation 2018-01-03 17:49:42 +10:30
ChangeLog-2018 ChangeLog rotation 2019-01-01 21:25:40 +10:30
ChangeLog-2019 ChangeLog rotation 2020-01-01 18:12:08 +10:30
ChangeLog-9103 Add copyright notices 2012-12-10 12:48:03 +00:00
MAINTAINERS Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
alloca-conf.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ansidecl.h Update libiberty sources with changes in the gcc mainline. 2020-01-17 14:13:22 +00:00
bfdlink.h gold, ld: Implement -z start-stop-visibility=... option. 2020-06-15 11:45:02 -07:00
binary-io.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
bout.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ctf-api.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ctf.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
demangle.h Update libiberty sources with changes in the gcc mainline. 2020-01-17 14:13:22 +00:00
diagnostics.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
dis-asm.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
dwarf2.def Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
dwarf2.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
dyn-string.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
environ.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
fibheap.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
filenames.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
floatformat.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
fnmatch.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
fopen-bin.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
fopen-same.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
fopen-vms.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
gcc-c-fe.def Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
gcc-c-interface.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
gcc-cp-fe.def Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
gcc-cp-interface.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
gcc-interface.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
getopt.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
hashtab.h Merge upstream GCC changes for include/ and libiberty/ directories 2020-02-25 17:04:42 +00:00
hp-symtab.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
leb128.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
libiberty.h Update libiberty sources with changes in the gcc mainline. 2020-01-17 14:13:22 +00:00
longlong.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
lto-symtab.h include: Sync lto-symtab.h and plugin-api.h with GCC 2020-03-21 03:39:18 -07:00
md5.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
oasys.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
objalloc.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
obstack.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
os9k.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
partition.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
plugin-api.h include: Sync plugin-api.h with GCC 2020-04-01 02:36:11 -07:00
progress.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
safe-ctype.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
sha1.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
simple-object.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
sort.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
splay-tree.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
symcat.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
timeval-utils.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
vtv-change-permission.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
xregex.h merge from gcc 2011-07-25 17:11:48 +00:00
xregex2.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
xtensa-config.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
xtensa-isa-internal.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
xtensa-isa.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30