# HG changeset patch # User Scoopta # Date 1660611031 25200 # Mon Aug 15 17:50:31 2022 -0700 # Node ID 89e455c1ad3e4288f1140f4a60c56b252e0d81f6 # Parent 728c1bc73e416b0e3073026ea944281adf3ad9f0 Fixed linker warnings/errors diff --git a/kernel/src/boot.S b/kernel/src/boot.S --- a/kernel/src/boot.S +++ b/kernel/src/boot.S @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Scoopta + * Copyright (C) 2019-2022 Scoopta * This file is part of NekOS * NekOS is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,6 +17,8 @@ .globl runtime_stack_bottom, sys_interrupt_stack_bottom, ist1_bottom, ist2_bottom, kernel_gs_base, lowmem_start, highmem_start, maid_start, hlt +.section .note.GNU-stack + .set MAGIC, 0xE85250D6 .set ARCH, 0 .set LEN, 72 diff --git a/kernel/src/msr.S b/kernel/src/msr.S --- a/kernel/src/msr.S +++ b/kernel/src/msr.S @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Scoopta + * Copyright (C) 2020-2022 Scoopta * This file is part of NekOS * NekOS is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,6 +17,8 @@ .globl wrmsr, rdmsr +.section .note.GNU-stack + .text wrmsr: movq %rdi, %rcx diff --git a/kernel/src/oops.S b/kernel/src/oops.S --- a/kernel/src/oops.S +++ b/kernel/src/oops.S @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2020 Scoopta + * Copyright (C) 2019-2022 Scoopta * This file is part of NekOS * NekOS is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,6 +17,8 @@ .globl oopsie_woopsie_uwu_we_made_a_fucky_wucky_a_wittle_fucko_boingo_the_code_monkeys_at_our_hedquarters_are_working_vewy_hawd_to_fix_this +.section .note.GNU-stack + .data message1: .asciz "OOPSIE WOOPSIE!! UwU we made a fucky wucky!!\n" message2: .asciz "A wittle fucko boingo!\nThe code monkeys at our headquarters are working VEWY HAWD to fix this!\n" diff --git a/kernel/src/panic.S b/kernel/src/panic.S --- a/kernel/src/panic.S +++ b/kernel/src/panic.S @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2020 Scoopta + * Copyright (C) 2019-2022 Scoopta * This file is part of NekOS * NekOS is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,6 +17,8 @@ .globl panic +.section .note.GNU-stack + .data message1: .asciz "Kitty had a panic attack UwU!\n%s\nRAX=0x%X RBX=0x%X RCX=0x%X RDX=0x%X\n" message2: .asciz "RDI=0x%X RSI=0x%X RBP=0x%X RSP=0x%X\n" diff --git a/kernel/src/syscall_entry.S b/kernel/src/syscall_entry.S --- a/kernel/src/syscall_entry.S +++ b/kernel/src/syscall_entry.S @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Scoopta + * Copyright (C) 2020-2022 Scoopta * This file is part of NekOS * NekOS is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,6 +35,8 @@ xorq %r15, %r15 .endm +.section .note.GNU-stack + .text syscall_entry: cli diff --git a/maid/src/syscall.S b/maid/src/syscall.S --- a/maid/src/syscall.S +++ b/maid/src/syscall.S @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Scoopta + * Copyright (C) 2021-2022 Scoopta * This file is part of NekOS * NekOS is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,6 +17,8 @@ .globl syscall, syscall_entry +.section .note.GNU-stack + .text syscall: movq %rdi, %rax diff --git a/meson.build b/meson.build --- a/meson.build +++ b/meson.build @@ -6,7 +6,7 @@ kern_link = ['-T', '../kernel/link.ld'] add_project_arguments('-fno-stack-protector', '-ffreestanding', language : 'c') -add_project_link_arguments('-pie', '-nostdlib', '-Wl,--dynamic-linker=/bad/kitty', language : 'c') +add_project_link_arguments('-pie', '-nostdlib', '-Wl,--dynamic-linker=/bad/kitty', '-Wl,--no-warn-rwx-segments', language : 'c') if get_option('build_kernel') executable(meson.project_name(), @@ -56,7 +56,7 @@ mv = find_program('mv') tar = find_program('tar') - run_command(mkdir, root + '/sbin') + run_command(mkdir, root + '/sbin', check : true) sbin = custom_target('sbin', depends : maid,