From 6aefc5167a64e05580dcf1afc70efa496ed145ac Mon Sep 17 00:00:00 2001 From: Kimplul Date: Tue, 27 Jun 2023 13:00:19 +0300 Subject: add immediate loading --- lib/imm.ld | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lib/imm.ld (limited to 'lib/imm.ld') diff --git a/lib/imm.ld b/lib/imm.ld new file mode 100644 index 0000000..5e69ebf --- /dev/null +++ b/lib/imm.ld @@ -0,0 +1,23 @@ +ENTRY(_op) + +PHDRS { + headers PT_PHDR PHDRS; + text PT_LOAD FILEHDR PHDRS; + data PT_LOAD; +} + +SECTIONS { + . = SIZEOF_HEADERS; + .text : { + *(.text*); + + /* reserve eight bytes of data */ + __imm = .; + . += 8; + __next_op = .; + } :text + + /* mostly just to silence warnings, operations aren't allowed to have + * any data in them */ + .data : { *(.data*) } :data +} -- cgit v1.3