diff options
author | Nelson Chu <nelson.chu@sifive.com> | 2020-08-19 11:49:24 +0800 |
---|---|---|
committer | Nelson Chu <nelson.chu@sifive.com> | 2020-09-03 11:12:02 +0800 |
commit | 9184ef8a92371746d0f36580adf2ad6845f1ced3 (patch) | |
tree | 90ba667de441c9cb945525db043b0e802b4b174c | |
parent | 32f0ce4db98eb1e8e1cc326d3a22ef0c436ae6fe (diff) | |
download | gdb-9184ef8a92371746d0f36580adf2ad6845f1ced3.zip gdb-9184ef8a92371746d0f36580adf2ad6845f1ced3.tar.gz gdb-9184ef8a92371746d0f36580adf2ad6845f1ced3.tar.bz2 |
RISC-V: Minor cleanup and typos when merging elf attributes.
bfd/
* elfnn-riscv.c (riscv_i_or_e_p): Minor cleanup for warnings/errors.
(riscv_merge_std_ext): Likewise.
(riscv_merge_arch_attr_info): Likewise.
(riscv_merge_attributes): Likewise and fix comment typos.
ld/
* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-01.d: Remove
the useless `warnings` keywords.
* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-02.d: Likewise.
* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-03.d: Likewise.
* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-04.d: Likewise.
* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-05.d: Likewise.
* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-06.d: Likewise.
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/elfnn-riscv.c | 24 | ||||
-rw-r--r-- | ld/ChangeLog | 10 | ||||
-rw-r--r-- | ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-01.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-02.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-03.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-04.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-05.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-06.d | 4 |
9 files changed, 41 insertions, 24 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 3bf4d29..2dc5b54 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,12 @@ 2020-09-03 Nelson Chu <nelson.chu@sifive.com> + * elfnn-riscv.c (riscv_i_or_e_p): Minor cleanup for warnings/errors. + (riscv_merge_std_ext): Likewise. + (riscv_merge_arch_attr_info): Likewise. + (riscv_merge_attributes): Likewise and fix comment typos. + +2020-09-03 Nelson Chu <nelson.chu@sifive.com> + * elfnn-riscv.c (riscv_version_mismatch): Change the return type from void to bfd_boolean. Report warnings rather than errors when the ISA versions are mis-matched. Afterwards, remember to diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c index 83d4e63..c088278 100644 --- a/bfd/elfnn-riscv.c +++ b/bfd/elfnn-riscv.c @@ -2667,8 +2667,8 @@ riscv_i_or_e_p (bfd *ibfd, && (strcasecmp (subset->name, "i") != 0)) { _bfd_error_handler - (_("error: %pB: corrupted ISA string '%s'. " - "First letter should be 'i' or 'e' but got '%s'."), + (_("error: %pB: corrupted ISA string '%s'. " + "First letter should be 'i' or 'e' but got '%s'"), ibfd, arch, subset->name); return FALSE; } @@ -2711,7 +2711,7 @@ riscv_merge_std_ext (bfd *ibfd, { /* TODO: We might allow merge 'i' with 'e'. */ _bfd_error_handler - (_("error: %pB: Mis-matched ISA string to merge '%s' and '%s'."), + (_("error: %pB: mis-matched ISA string to merge '%s' and '%s'"), ibfd, in->name, out->name); return FALSE; } @@ -2897,7 +2897,7 @@ riscv_merge_arch_attr_info (bfd *ibfd, char *in_arch, char *out_arch) { _bfd_error_handler (_("error: %pB: ISA string of input (%s) doesn't match " - "output (%s)."), ibfd, in_arch, out_arch); + "output (%s)"), ibfd, in_arch, out_arch); return NULL; } @@ -2917,15 +2917,15 @@ riscv_merge_arch_attr_info (bfd *ibfd, char *in_arch, char *out_arch) { _bfd_error_handler (_("error: %pB: XLEN of input (%u) doesn't match " - "output (%u)."), ibfd, xlen_in, xlen_out); + "output (%u)"), ibfd, xlen_in, xlen_out); return NULL; } if (xlen_in != ARCH_SIZE) { _bfd_error_handler - (_("error: %pB: Unsupported XLEN (%u), you might be " - "using wrong emulation."), ibfd, xlen_in); + (_("error: %pB: unsupported XLEN (%u), you might be " + "using wrong emulation"), ibfd, xlen_in); return NULL; } @@ -3039,7 +3039,7 @@ riscv_merge_attributes (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler (_("warning: %pB use privilege spec version %u.%u.%u but " - "the output use version %u.%u.%u."), + "the output use version %u.%u.%u"), ibfd, in_attr[Tag_a].i, in_attr[Tag_b].i, @@ -3048,7 +3048,7 @@ riscv_merge_attributes (bfd *ibfd, struct bfd_link_info *info) out_attr[Tag_b].i, out_attr[Tag_c].i); - /* The priv spec v1.9.1 can be linked with other spec + /* The priv spec v1.9.1 can not be linked with other spec versions since the conflicts. We plan to drop the v1.9.1 in a year or two, so this confict should be removed in the future. */ @@ -3057,10 +3057,10 @@ riscv_merge_attributes (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler (_("warning: privilege spec version 1.9.1 can not be " - "linked with other spec versions.")); + "linked with other spec versions")); } - /* Update the output priv attributes to the newest. */ + /* Update the output priv spec to the newest one. */ if (in_priv_spec > out_priv_spec) { out_attr[Tag_a].i = in_attr[Tag_a].i; @@ -3085,7 +3085,7 @@ riscv_merge_attributes (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler (_("error: %pB use %u-byte stack aligned but the output " - "use %u-byte stack aligned."), + "use %u-byte stack aligned"), ibfd, in_attr[i].i, out_attr[i].i); result = FALSE; } diff --git a/ld/ChangeLog b/ld/ChangeLog index 185f37b..261390a 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,15 @@ 2020-09-03 Nelson Chu <nelson.chu@sifive.com> + * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-01.d: Remove + the useless `warnings` keywords. + * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-02.d: Likewise. + * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-03.d: Likewise. + * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-04.d: Likewise. + * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-05.d: Likewise. + * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-06.d: Likewise. + +2020-09-03 Nelson Chu <nelson.chu@sifive.com> + * testsuite/ld-riscv-elf/attr-merge-arch-failed-01.d: Update the message from error to warning. * testsuite/ld-riscv-elf/attr-merge-arch-failed-02.d: New testcases. 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 index 0d5d6dc..f3e2f2a 100644 --- 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 @@ -2,8 +2,8 @@ #source: attr-merge-priv-spec-c.s #as: #ld: -r -#warning: .*warning: .*use privilege spec version 1.11.0 but the output use version 1.9.1. -#warning: .*warning: .*privilege spec version 1.9.1 can not be linked with other spec versions. +#warning: .*use privilege spec version 1.11.0 but the output use version 1.9.1 +#warning: .*privilege spec version 1.9.1 can not be linked with other spec versions #readelf: -A Attribute Section: riscv 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 index f0f75b2..9e98809 100644 --- 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 @@ -2,8 +2,8 @@ #source: attr-merge-priv-spec-a.s #as: #ld: -r -#warning: .*warning: .*use privilege spec version 1.9.1 but the output use version 1.11.0. -#warning: .*warning: .*privilege spec version 1.9.1 can not be linked with other spec versions. +#warning: .*use privilege spec version 1.9.1 but the output use version 1.11.0 +#warning: .*privilege spec version 1.9.1 can not be linked with other spec versions #readelf: -A Attribute Section: riscv 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 index af51552..05dffda 100644 --- 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 @@ -3,8 +3,8 @@ #source: attr-merge-priv-spec-c.s #as: #ld: -r -#warning: .*warning: .*use privilege spec version 1.11.0 but the output use version 1.9.1. -#warning: .*warning: .*privilege spec version 1.9.1 can not be linked with other spec versions. +#warning: .*use privilege spec version 1.11.0 but the output use version 1.9.1 +#warning: .*privilege spec version 1.9.1 can not be linked with other spec versions #readelf: -A Attribute Section: riscv 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 index 2328807..ff10f3f 100644 --- 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 @@ -3,8 +3,8 @@ #source: attr-merge-priv-spec-c.s #as: #ld: -r -#warning: .*warning: .*use privilege spec version 1.11.0 but the output use version 1.9.1. -#warning: .*warning: .*privilege spec version 1.9.1 can not be linked with other spec versions. +#warning: .*use privilege spec version 1.11.0 but the output use version 1.9.1 +#warning: .*privilege spec version 1.9.1 can not be linked with other spec versions #readelf: -A Attribute Section: riscv 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 index cabaab6..7c1cc56 100644 --- 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 @@ -3,8 +3,8 @@ #source: attr-merge-priv-spec-a.s #as: #ld: -r -#warning: .*warning: .*use privilege spec version 1.9.1 but the output use version 1.11.0. -#warning: .*warning: .*privilege spec version 1.9.1 can not be linked with other spec versions. +#warning: .*use privilege spec version 1.9.1 but the output use version 1.11.0 +#warning: .*privilege spec version 1.9.1 can not be linked with other spec versions #readelf: -A Attribute Section: riscv 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 index e774748..1a81538f 100644 --- 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 @@ -3,8 +3,8 @@ #source: attr-merge-priv-spec-a.s #as: #ld: -r -#warning: .*warning: .*use privilege spec version 1.9.1 but the output use version 1.11.0. -#warning: .*warning: .*privilege spec version 1.9.1 can not be linked with other spec versions. +#warning: .*use privilege spec version 1.9.1 but the output use version 1.11.0 +#warning: .*privilege spec version 1.9.1 can not be linked with other spec versions #readelf: -A Attribute Section: riscv |