summaryrefslogtreecommitdiff
path: root/usr.sbin/link.ld
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/link.ld')
-rw-r--r--usr.sbin/link.ld35
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
+}