-
Notifications
You must be signed in to change notification settings - Fork 56
Use GOT for CHERI-RISC-V and align modifiers and relocations with RISC-V #766
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
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
fb2bbc2
[ELF] Consistently use gotEntrySize for GOT entries
jrtc27 00fc57c
[ELF][RISCV] Use .got rather than .captable for CHERI-RISC-V
jrtc27 7b2cf69
[ELF][NFC] Drop unwarranted XXX comments
jrtc27 8d9cd7a
[ELF] Make .captable explicitly MIPS-specific
jrtc27 8ce9c69
[ELF][RISCV] Don't set sizeRel
jrtc27 2abb876
[ELF][RISCV] Don't set cheriCapCallRel
jrtc27 5c149ec
[RISCV] Drop CHERI-RISC-V-specific assembly modifiers and relocations
jrtc27 b03d33e
[BinaryFormat][RISCV] Mark no-longer used CHERI relocations deprecated
jrtc27 2a25bc4
[BinaryFormat][RISCV] Ditch R_RISCV_CHERI_CAPABILITY_CALL in comment
jrtc27 25025c9
[BinaryFormat][RISCV] Delete R_RISCV_CHERI_SIZE
jrtc27 2634fad
[ELF][CHERI] Support creating new capability relocations against sect…
jrtc27 4e91e6e
[ELF][RISCV] Stop using CSub for capability subtraction
jrtc27 7341340
[ELF][RISCV] Support .got.plt with lazy binding for CHERI-RISC-V
jrtc27 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| # REQUIRES: riscv | ||
| # RUN: echo '.globl b; b:' | %riscv32_cheri_purecap_llvm-mc -filetype=obj - -o %t1.o | ||
| # RUN: ld.lld -shared %t1.o -soname=t1.so -o %t1.so | ||
|
|
||
| # RUN: %riscv32_cheri_purecap_llvm-mc -filetype=obj -position-independent %s -o %t.o | ||
| # RUN: ld.lld %t.o %t1.so -o %t | ||
| # RUN: llvm-readelf -S %t | FileCheck --check-prefix=SEC32 %s | ||
| # RUN: llvm-readobj -r --cap-relocs %t | FileCheck --check-prefix=RELOC32 %s | ||
| # RUN: llvm-nm %t | FileCheck --check-prefix=NM32 %s | ||
| # RUN: llvm-readobj -x .got %t | FileCheck --check-prefix=HEX32 %s | ||
| # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck --check-prefix=DIS32 %s | ||
|
|
||
| # RUN: echo '.globl b; b:' | %riscv64_cheri_purecap_llvm-mc -filetype=obj - -o %t1.o | ||
| # RUN: ld.lld -shared %t1.o -soname=t1.so -o %t1.so | ||
|
|
||
| # RUN: %riscv64_cheri_purecap_llvm-mc -filetype=obj -position-independent %s -o %t.o | ||
| # RUN: ld.lld %t.o %t1.so -o %t | ||
| # RUN: llvm-readelf -S %t | FileCheck --check-prefix=SEC64 %s | ||
| # RUN: llvm-readobj -r --cap-relocs %t | FileCheck --check-prefix=RELOC64 %s | ||
| # RUN: llvm-nm %t | FileCheck --check-prefix=NM64 %s | ||
| # RUN: llvm-readobj -x .got %t | FileCheck --check-prefix=HEX64 %s | ||
| # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck --check-prefix=DIS64 %s | ||
|
|
||
| # SEC32: .got PROGBITS 00012230 000230 000018 | ||
| # SEC64: .got PROGBITS 00000000000123a0 0003a0 000030 | ||
|
|
||
| # RELOC32: .rela.dyn { | ||
| # RELOC32-NEXT: 0x12238 R_RISCV_CHERI_CAPABILITY b 0x0 | ||
| # RELOC32-NEXT: } | ||
| # RELOC32: CHERI __cap_relocs [ | ||
| # RELOC32-NEXT: 0x012240 Base: 0x13248 (a+0) Length: 4 Perms: Object | ||
| # RELOC32-NEXT: ] | ||
|
|
||
| # RELOC64: .rela.dyn { | ||
| # RELOC64-NEXT: 0x123B0 R_RISCV_CHERI_CAPABILITY b 0x0 | ||
| # RELOC64-NEXT: } | ||
| # RELOC64: CHERI __cap_relocs [ | ||
| # RELOC64-NEXT: 0x0123c0 Base: 0x133d0 (a+0) Length: 4 Perms: Object | ||
| # RELOC64-NEXT: ] | ||
|
|
||
| # NM32: 00013248 d a | ||
| # NM64: 00000000000133d0 d a | ||
arichardson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## .got[0] = _DYNAMIC | ||
| ## .got[1] = 0 (relocated by R_RISCV_CHERI_CAPABILITY at run time) | ||
| ## .got[2] = 0 (relocated by __cap_relocs at run time) | ||
| # HEX32: section '.got': | ||
| # HEX32: 0x00012230 c0210100 00000000 00000000 00000000 | ||
| # HEX32: 0x00012240 00000000 00000000 | ||
|
|
||
| # HEX64: section '.got': | ||
| # HEX64: 0x000123a0 c0220100 00000000 00000000 00000000 | ||
| # HEX64: 0x000123b0 00000000 00000000 00000000 00000000 | ||
| # HEX64: 0x000123c0 00000000 00000000 00000000 00000000 | ||
|
|
||
| ## &.got[2]-. = 0x12240-0x111b0 = 4096*1+144 | ||
| # DIS32: 111b0: auipcc ca0, 1 | ||
| # DIS32-NEXT: lc ca0, 144(ca0) | ||
| ## &.got[1]-. = 0x12238-0x111b8 = 4096*1+128 | ||
| # DIS32: 111b8: auipcc ca0, 1 | ||
| # DIS32-NEXT: lc ca0, 128(ca0) | ||
|
|
||
| ## &.got[2]-. = 0x123c0-0x112b0 = 4096*1+272 | ||
| # DIS64: 112b0: auipcc ca0, 1 | ||
| # DIS64-NEXT: lc ca0, 272(ca0) | ||
| ## &.got[1]-. = 0x123b0-0x112b8 = 4096*1+248 | ||
| # DIS64: 112b8: auipcc ca0, 1 | ||
| # DIS64-NEXT: lc ca0, 248(ca0) | ||
|
|
||
| clgc ca0, a | ||
| clgc ca0, b | ||
|
|
||
| .data | ||
| a: | ||
| ## An undefined reference of _GLOBAL_OFFSET_TABLE_ causes .got[0] to be | ||
| ## allocated to store _DYNAMIC. | ||
| .long _GLOBAL_OFFSET_TABLE_ - . | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.