RISC-V: Don't report warnings when linking different privileged spec objects.

Since only the abandoned privileged spec v1.9.1 will have conflict csrs, to
keep the compatible we still report warnings when linking privileged spec
v1.9.1 objects with others.  But don't report warnings for other compatible
cases because it is actually a bit noisy and useless...

bfd/
	* elfnn-riscv.c (riscv_merge_attributes): Only report warnings when
	linking the abandoned privileged spec v1.9.1 object with others.
ld/
	* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-01.d: Removed.
	* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-02.d: Removed.
	* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-03.d: Removed.
	* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-04.d: Removed.
	* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-05.d: Removed.
	* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-06.d: Removed.
	* testsuite/ld-riscv-elf/ld-riscv-elf.exp: Updated.
This commit is contained in:
Nelson Chu 2024-10-08 12:35:43 +08:00
parent d7d71afa6a
commit cb45bd5948
8 changed files with 3 additions and 96 deletions

View File

@ -4071,20 +4071,9 @@ riscv_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
else if (in_priv_spec != PRIV_SPEC_CLASS_NONE
&& in_priv_spec != out_priv_spec)
{
_bfd_error_handler
(_("warning: %pB use privileged spec version %u.%u.%u but "
"the output use version %u.%u.%u"),
ibfd,
in_attr[Tag_a].i,
in_attr[Tag_b].i,
in_attr[Tag_c].i,
out_attr[Tag_a].i,
out_attr[Tag_b].i,
out_attr[Tag_c].i);
/* The privileged spec v1.9.1 can not be linked with others
since the conflicts, so we plan to drop it in a year or
two. */
/* The abandoned privileged spec v1.9.1 can not be linked with
others since the conflicts. Keep the check since compatible
issue. */
if (in_priv_spec == PRIV_SPEC_CLASS_1P9P1
|| out_priv_spec == PRIV_SPEC_CLASS_1P9P1)
{

View File

@ -1,12 +0,0 @@
#source: attr-merge-priv-spec-a.s
#source: attr-merge-priv-spec-c.s
#as:
#ld: -r
#warning: .*use privileged spec version 1.11.0 but the output use version 1.10.0
#readelf: -A
Attribute Section: riscv
File Attributes
Tag_RISCV_arch: [a-zA-Z0-9_\"].*
Tag_RISCV_priv_spec: 1
Tag_RISCV_priv_spec_minor: 11

View File

@ -1,12 +0,0 @@
#source: attr-merge-priv-spec-c.s
#source: attr-merge-priv-spec-a.s
#as:
#ld: -r
#warning: .*use privileged spec version 1.10.0 but the output use version 1.11.0
#readelf: -A
Attribute Section: riscv
File Attributes
Tag_RISCV_arch: [a-zA-Z0-9_\"].*
Tag_RISCV_priv_spec: 1
Tag_RISCV_priv_spec_minor: 11

View File

@ -1,13 +0,0 @@
#source: attr-merge-priv-spec-a.s
#source: attr-merge-priv-spec-d.s
#source: attr-merge-priv-spec-c.s
#as:
#ld: -r
#warning: .*use privileged spec version 1.11.0 but the output use version 1.10.0
#readelf: -A
Attribute Section: riscv
File Attributes
Tag_RISCV_arch: [a-zA-Z0-9_\"].*
Tag_RISCV_priv_spec: 1
Tag_RISCV_priv_spec_minor: 11

View File

@ -1,13 +0,0 @@
#source: attr-merge-priv-spec-d.s
#source: attr-merge-priv-spec-a.s
#source: attr-merge-priv-spec-c.s
#as:
#ld: -r
#warning: .*use privileged spec version 1.11.0 but the output use version 1.10.0
#readelf: -A
Attribute Section: riscv
File Attributes
Tag_RISCV_arch: [a-zA-Z0-9_\"].*
Tag_RISCV_priv_spec: 1
Tag_RISCV_priv_spec_minor: 11

View File

@ -1,13 +0,0 @@
#source: attr-merge-priv-spec-c.s
#source: attr-merge-priv-spec-d.s
#source: attr-merge-priv-spec-a.s
#as:
#ld: -r
#warning: .*use privileged spec version 1.10.0 but the output use version 1.11.0
#readelf: -A
Attribute Section: riscv
File Attributes
Tag_RISCV_arch: [a-zA-Z0-9_\"].*
Tag_RISCV_priv_spec: 1
Tag_RISCV_priv_spec_minor: 11

View File

@ -1,13 +0,0 @@
#source: attr-merge-priv-spec-d.s
#source: attr-merge-priv-spec-c.s
#source: attr-merge-priv-spec-a.s
#as:
#ld: -r
#warning: .*use privileged spec version 1.10.0 but the output use version 1.11.0
#readelf: -A
Attribute Section: riscv
File Attributes
Tag_RISCV_arch: [a-zA-Z0-9_\"].*
Tag_RISCV_priv_spec: 1
Tag_RISCV_priv_spec_minor: 11

View File

@ -165,12 +165,6 @@ if [istarget "riscv*-*-*"] {
run_dump_test "attr-merge-priv-spec-03"
run_dump_test "attr-merge-user-ext-01"
run_dump_test "attr-merge-stack-align-failed"
run_dump_test "attr-merge-priv-spec-failed-01"
run_dump_test "attr-merge-priv-spec-failed-02"
run_dump_test "attr-merge-priv-spec-failed-03"
run_dump_test "attr-merge-priv-spec-failed-04"
run_dump_test "attr-merge-priv-spec-failed-05"
run_dump_test "attr-merge-priv-spec-failed-06"
run_dump_test "attr-phdr"
run_dump_test "relax-max-align-gp"
run_dump_test "uleb128"