-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[LLD][RISCV] Fix incorrect call relaxation when mixing +c and -c objects #73977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # REQUIRES: riscv | ||
| # RUN: rm -rf %t && split-file %s %t && cd %t | ||
| # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+c,+relax a.s -o a.o | ||
| # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=-c,+relax b.s -o b.o | ||
|
|
||
| # RUN: ld.lld a.o b.o --shared -o a | ||
| # RUN: llvm-objdump -d --no-show-raw-insn -M no-aliases a | FileCheck %s | ||
|
|
||
| ## This needs to be a *uncompressed* jal instruction since it came from the | ||
| ## source file which does not enable C | ||
| # CHECK-LABEL: <foo>: | ||
| # CHECK-NEXT: 1260: jal zero, 0x1260 <foo> | ||
| # CHECK-NEXT: 1264: addi zero, zero, 0 | ||
|
|
||
| # w/C | ||
|
||
| #--- a.s | ||
| .text | ||
| .attribute 4, 16 | ||
| .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" | ||
|
|
||
| # w/o C | ||
| #--- b.s | ||
| .text | ||
| .attribute 4, 16 | ||
| .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_zicsr2p0_zifencei2p0" | ||
| .p2align 5 | ||
| .type foo,@function | ||
| foo: | ||
| tail foo | ||
| nop | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Omit
1260:so that the test is less sensitive to address changes.jal zero, {{.*}} <foo>There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need the addresses to make the instruction size difference obvious. Is there a way to force the address so it's stable instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider
-Ttext=0x10000as manyriscv-relax-*files use.