forked from anza-xyz/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Relocate FK_Data_8 fixups as R_BPF_64_ABS64. R_BPF_64_64 is used for ldimm64 which only makes sense in .text. Currently 64 bit values in non-text sections get chopped to 32 bits and shifted 32 bits to the left (that is, the first 8 bytes of a ldimm64 relocation). This commit fixes it so that 64 bit values get written fully at the intended offset. For backwards compatibility, the new behaviour is used only if the reloc-abs64 feature is on (required by -mcpu=sbfv2), since rbpf before solana-labs/rbpf#301 assumes the legacy buggy layout.
- Loading branch information
1 parent
3ea9d5d
commit c3fe309
Showing
7 changed files
with
55 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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,20 @@ | ||
; RUN: llc -march=sbf -filetype=obj < %s | llvm-objdump -r - | tee -i /tmp/foo | FileCheck --check-prefix=CHECK-RELOC-SBF %s | ||
; RUN: llc -march=sbf -mcpu=sbfv2 -filetype=obj < %s | llvm-objdump -r - | tee -i /tmp/foo | FileCheck --check-prefix=CHECK-RELOC-SBFv2 %s | ||
|
||
@.str = private unnamed_addr constant [25 x i8] c"reloc_64_relative_data.c\00", align 1 | ||
@FILE = dso_local constant i64 ptrtoint ([25 x i8]* @.str to i64), align 8 | ||
|
||
; Function Attrs: noinline nounwind optnone | ||
define dso_local i64 @entrypoint(i8* %input) #0 { | ||
entry: | ||
%input.addr = alloca i8*, align 8 | ||
store i8* %input, i8** %input.addr, align 8 | ||
%0 = load volatile i64, i64* @FILE, align 8 | ||
ret i64 %0 | ||
} | ||
|
||
; CHECK-RELOC-SBF: RELOCATION RECORDS FOR [.data.rel.ro]: | ||
; CHECK-RELOC-SBF: 0000000000000000 R_BPF_64_64 .L.str | ||
|
||
; CHECK-RELOC-SBFv2: RELOCATION RECORDS FOR [.data.rel.ro]: | ||
; CHECK-RELOC-SBFv2: 0000000000000000 R_BPF_64_ABS64 .L.str |