-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[X86][MC] Support R_X86_64_CODE_4_GOTPC32_TLSDESC #116908
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 all 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 |
---|---|---|
|
@@ -17,3 +17,15 @@ | |
leaq a@tlsdesc(%rip), %rax | ||
call *a@tlscall(%rax) | ||
addq %fs:0, %rax | ||
|
||
# PRINT: leaq a@tlsdesc(%rip), %r16 | ||
# PRINT-NEXT: callq *a@tlscall(%r16) | ||
|
||
# CHECK: 12: leaq (%rip), %r16 # 0x1a <{{.*}}> | ||
# CHECK-NEXT: 0000000000000016: R_X86_64_CODE_4_GOTPC32_TLSDESC a-0x4 | ||
# CHECK-NEXT: 1a: callq *(%r16) | ||
# CHECK-NEXT: 000000000000001a: R_X86_64_TLSDESC_CALL a | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. |
||
|
||
leaq a@tlsdesc(%rip), %r16 | ||
call *a@tlscall(%r16) | ||
addq %fs:0, %r16 |
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.
We don't need
LEA64r
before REX2?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.
Sorry. I don't understand. We need to check LEA64r with REX2 prefix and add R_X86_64_CODE_4_GOTPC32_TLSDESC relocation for it.
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.
My question is: Why we don't need to check LEA64r when REX prefix was added? Is LEA64r special to REX2?
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.
It's not special to REX2. Here we need to distinguish REX2 prefix and others and set corresponding relocation type (R_X86_64_CODE_4_GOTPC32_TLSDESC) if it's REX2 prefix. For REX prefix, we didn't have to distinguish it and others in the past.
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.
Got it.