openhwgroup / corev-binutils-gdb

GNU General Public License v2.0
9 stars 26 forks source link

fix several Zcmt issues #56

Closed linsinan1995 closed 1 year ago

linsinan1995 commented 1 year ago

Info for this PR

TODO: change log and other documentation will be added during the review.

1. Commits are for fixing #55

632204fbe87d7d5b6c0f9ee26b319aab952a6332: fix issue #55. After this fix, the condition branch will use a temp symbol instead of a constant during the branch relaxation in GAS.

db8e3588d28d319c6571cd4e868e5b95ed346176: a testcase for 632204fbe87d7d5b6c0f9ee26b319aab952a6332.

2. Commits are added to help test this PR

c22f48ec16ec89a86bcb30a6361da634c629a0cc: add a RISC-V specific option --zcmt-force-table-jump to force generating zcmt table jump instructions, which helps write test cases. Also, it relates to issue #44.

55d1396cab760901c0f5888f9b369f6b0a39d61a: change an unused test case to a test case for --zcmt-force-table-jump option.

b3e53393bfc71d665f509c2f876e00220a2c4829: adding R_RISCV_RELAX to jump instructions when ZCMT is used. Since ZCMT codegen will be done through linker relaxation, this change will help ZCMT to fit into the relaxation routine to avoid some ugly hacks and also fits the ABI proposal.

88f3581c718763d49705ceb6180118c60396be6d: fix issue #48. I add this commit here since this implementation bug blocks the progress of fixing issue #55.

Test result

        === libctf Summary ===

# of expected passes        4
# of unsupported tests      2

        === binutils Summary ===

# of expected passes        207
# of expected failures      1
# of untested testcases     15
# of unsupported tests      13

        === gas Summary ===

# of expected passes        1234
# of expected failures      23
# of unsupported tests      9

        === ld Summary ===

# of expected passes        437
# of expected failures      13
# of untested testcases     22
# of unsupported tests      200

============================================================================
Testsuite summary for package-unused version-unused
============================================================================
# TOTAL: 33
# PASS:  33
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
jeremybennett commented 1 year ago

Reviewed by the CORE-V GNU tools team. Good to merge. Thanks @linsinan1995 for the contribution.

linsinan1995 commented 1 year ago

Also, issues #55 #48 #44 can be closed.