aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-07-18 21:07:08 -0400
committerIan Moffett <ian@osmora.org>2024-07-18 21:07:24 -0400
commit4b57a4986725ac5584bb6a7d346dbc83efe2d454 (patch)
tree50269c375ab893a945c5c6b275b9381527a8e868 /usr.sbin
parenteefc036a0a9ff0d34c98778632693451c84baf56 (diff)
usr.sbin: Fix linker script
Fix issue with memory addresses of globals being zeroed Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/link.ld27
1 files changed, 9 insertions, 18 deletions
diff --git a/usr.sbin/link.ld b/usr.sbin/link.ld
index da2346d..9fad881 100644
--- a/usr.sbin/link.ld
+++ b/usr.sbin/link.ld
@@ -1,35 +1,26 @@
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.*)
- } :text
-
- .rodata : ALIGN(8) {
- *(.rodata)
- *(.rodata.*)
- } :rodata
+ }
- .data : ALIGN(8) {
+ .data : ALIGN(8)
+ {
*(.data)
*(.data.*)
- } :data
+ }
- .bss : ALIGN(8) {
+ .bss : ALIGN(8)
+ {
__bss_start = .;
*(.bss)
*(.bss.*)
__bss_end = .;
- } :data
+ }
}