diff options
author | Ian Moffett <ian@osmora.org> | 2024-07-04 23:42:44 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-07-04 23:42:44 -0400 |
commit | 4f9c6864188be29fd80d4e10c6e6da7d80fc5d10 (patch) | |
tree | cbaac9bff5d5da8d4ae9dcfc1a03e1cc9dd32d52 /usr.sbin/link.ld | |
parent | ae83d32a56c38e5c7cd4497d64432387d4350a55 (diff) |
usr: Add initial userland
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'usr.sbin/link.ld')
-rw-r--r-- | usr.sbin/link.ld | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/usr.sbin/link.ld b/usr.sbin/link.ld new file mode 100644 index 0000000..da2346d --- /dev/null +++ b/usr.sbin/link.ld @@ -0,0 +1,35 @@ +ENTRY(_start) + +PHDRS +{ + text PT_LOAD FLAGS((1 << 0) | (1 << 2)) ; /* Execute + Read */ + rodata PT_LOAD FLAGS((1 << 2)) ; /* Read only */ + data PT_LOAD FLAGS((1 << 1) | (1 << 2)) ; /* Write + Read */ +} + +SECTIONS +{ + . = 0x10000; + + .text : { + *(.text) + *(.text.*) + } :text + + .rodata : ALIGN(8) { + *(.rodata) + *(.rodata.*) + } :rodata + + .data : ALIGN(8) { + *(.data) + *(.data.*) + } :data + + .bss : ALIGN(8) { + __bss_start = .; + *(.bss) + *(.bss.*) + __bss_end = .; + } :data +} |