forked from qmonnet/rbpf
-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
245 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,31 @@ | ||
PHDRS | ||
{ | ||
text PT_LOAD ; | ||
text PT_LOAD ; | ||
rodata PT_LOAD ; | ||
data PT_LOAD ; | ||
stack PT_GNU_STACK ; | ||
heap PT_LOAD ; | ||
dynamic PT_DYNAMIC ; | ||
other PT_NULL ; | ||
} | ||
|
||
SECTIONS | ||
{ | ||
. = SIZEOF_HEADERS; | ||
.text : { *(.text*) } :text | ||
.rodata : { *(.rodata*) } :rodata | ||
.data.rel.ro : { *(.data.rel.ro*) } :rodata | ||
.text 0x000000000 : { *(.text*) } :text | ||
.rodata 0x100000000 : { *(.rodata*) } :rodata | ||
.stack 0x200000000 : { *(.bss.stack*) } :stack | ||
.heap 0x300000000 : { *(.bss.heap*) } :heap | ||
.dynamic : { *(.dynamic) } :dynamic | ||
.dynsym : { *(.dynsym) } :data | ||
.dynstr : { *(.dynstr) } :data | ||
.rel.dyn : { *(.rel.dyn) } :data | ||
.data : { *(.data*) } :data | ||
.bss : { *(.bss*) } :data | ||
.dynsym : { *(.dynsym) } :dynamic | ||
.dynstr : { *(.dynstr) } :dynamic | ||
.symtab : { *(.symtab) } :other | ||
.shstrtab : { *(.shstrtab) } :other | ||
.strtab : { *(.strtab) } :other | ||
/DISCARD/ : { | ||
*(.comment*) | ||
*(.eh_frame*) | ||
*(.gnu.hash*) | ||
*(.hash*) | ||
*(*hash*) | ||
*(.bss*) | ||
*(.data*) | ||
*(.rel.dyn*) | ||
} | ||
} |
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,26 @@ | ||
PHDRS | ||
{ | ||
text PT_LOAD ; | ||
rodata PT_LOAD ; | ||
data PT_LOAD ; | ||
dynamic PT_DYNAMIC ; | ||
} | ||
|
||
SECTIONS | ||
{ | ||
. = SIZEOF_HEADERS; | ||
.text : { *(.text*) } :text | ||
.rodata : { *(.rodata*) } :rodata | ||
.data.rel.ro : { *(.data.rel.ro*) } :rodata | ||
.dynamic : { *(.dynamic) } :dynamic | ||
.dynsym : { *(.dynsym) } :data | ||
.dynstr : { *(.dynstr) } :data | ||
.rel.dyn : { *(.rel.dyn) } :data | ||
.data : { *(.data*) } :data | ||
.bss : { *(.bss*) } :data | ||
/DISCARD/ : { | ||
*(.eh_frame*) | ||
*(.gnu.hash*) | ||
*(.hash*) | ||
} | ||
} |
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,13 @@ | ||
#[link_section = ".bss.stack"] | ||
pub static _STACK: [u8; 0x1000] = [0; 0x1000]; | ||
#[link_section = ".bss.heap"] | ||
pub static _HEAP: [u8; 0x1000] = [0; 0x1000]; | ||
|
||
static _VAL_A: u64 = 41; | ||
static VAL_B: u64 = 42; | ||
static _VAL_C: u64 = 43; | ||
|
||
#[no_mangle] | ||
pub fn entrypoint() -> u64 { | ||
return unsafe { core::ptr::read_volatile(&VAL_B) }; | ||
} |
Binary file not shown.
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