diff options
author | Marvin Borner | 2020-08-01 15:59:39 +0200 |
---|---|---|
committer | Marvin Borner | 2020-08-01 15:59:39 +0200 |
commit | 115f4ff541839f7a97f9413e1ac3ff7695c24c9e (patch) | |
tree | d98602bba5a8b4321ae124d221f77e99008e9cd1 /apps | |
parent | 46fb7dcf479ac85361d8eaae5af3ea27a6b93a2d (diff) |
Switched to PIE flat binaries
Diffstat (limited to 'apps')
-rw-r--r-- | apps/link.ld | 34 | ||||
-rw-r--r-- | apps/test.c | 4 |
2 files changed, 24 insertions, 14 deletions
diff --git a/apps/link.ld b/apps/link.ld index ee41578..14fe1e3 100644 --- a/apps/link.ld +++ b/apps/link.ld @@ -1,24 +1,34 @@ -ENTRY(main) +OUTPUT_FORMAT("elf32-i386") +OUTPUT_ARCH(i386) +ENTRY(start) + SECTIONS { - .text 0x40000000: - { - code = .; _code = .; __code = .; + . = 0x00000000; + + .text : { *(.text) } - .data ALIGN(0x400000): - { - data = .; _data = .; __data = .; - *(.data) + .rodata : { *(.rodata) } - .bss ALIGN(0x400000): - { - bss = .; _bss = .; __bss = .; + . = ALIGN(4096); + + .data : { + *(.data) + } + + . = ALIGN(4096); + + .bss : { *(.bss) } - end = .; _end = .; __end = .; + . = ALIGN(4096); + + _GLOBAL_OFFSET_TABLE_ = .; + + . = ALIGN(4096); } diff --git a/apps/test.c b/apps/test.c index f9e40cb..592f35b 100644 --- a/apps/test.c +++ b/apps/test.c @@ -81,8 +81,8 @@ void serial_print(const char *data) serial_put(data[i]); } -void main() +void start() { serial_install(); - serial_print("WELCOME TO USERSPACE"); + serial_print("Follow the white rabbit."); } |