aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNelson Chu <nelson@rivosinc.com>2024-10-08 12:35:43 +0800
committerNelson Chu <nelson@rivosinc.com>2024-11-19 13:44:49 +0800
commitcb45bd59481353217ebf18d67c6b013ab2d2f263 (patch)
tree73df2bf7f812115eb8fa0890c0137e91a051dc54
parentd7d71afa6aa2db0e7d598af480ed7f14157104d1 (diff)
downloadbinutils-cb45bd59481353217ebf18d67c6b013ab2d2f263.zip
binutils-cb45bd59481353217ebf18d67c6b013ab2d2f263.tar.gz
binutils-cb45bd59481353217ebf18d67c6b013ab2d2f263.tar.bz2
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.
-rw-r--r--bfd/elfnn-riscv.c17
-rw-r--r--ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-01.d12
-rw-r--r--ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-02.d12
-rw-r--r--ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-03.d13
-rw-r--r--ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-04.d13
-rw-r--r--ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-05.d13
-rw-r--r--ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-06.d13
-rw-r--r--ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp6
8 files changed, 3 insertions, 96 deletions
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
index c8bf45f..3aba9c8 100644
--- a/bfd/elfnn-riscv.c
+++ b/bfd/elfnn-riscv.c
@@ -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)
{
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-01.d b/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-01.d
deleted file mode 100644
index 7f98707..0000000
--- a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-01.d
+++ /dev/null
@@ -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
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-02.d b/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-02.d
deleted file mode 100644
index f86ef10..0000000
--- a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-02.d
+++ /dev/null
@@ -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
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-03.d b/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-03.d
deleted file mode 100644
index cfbb233..0000000
--- a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-03.d
+++ /dev/null
@@ -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
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-04.d b/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-04.d
deleted file mode 100644
index 4332597..0000000
--- a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-04.d
+++ /dev/null
@@ -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
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-05.d b/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-05.d
deleted file mode 100644
index bb6573d..0000000
--- a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-05.d
+++ /dev/null
@@ -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
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-06.d b/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-06.d
deleted file mode 100644
index 9d97ff9..0000000
--- a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-06.d
+++ /dev/null
@@ -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
diff --git a/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp b/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp
index 0ee2025..7b1b2aa 100644
--- a/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp
+++ b/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp
@@ -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"