From c5953a7976bb599be78bb956376c07318c354139 Mon Sep 17 00:00:00 2001 From: Tianhao Wang Date: Wed, 17 Apr 2024 11:28:50 +0200 Subject: rename `compiler` directory to `defs` the name `compiler` is ambiguous --- Makefile | 4 +-- compiler/x86_64-linker.ld | 76 -------------------------------------------- compiler/x86_64-rustubs.json | 13 -------- defs/x86_64-linker.ld | 76 ++++++++++++++++++++++++++++++++++++++++++++ defs/x86_64-rustubs.json | 13 ++++++++ 5 files changed, 91 insertions(+), 91 deletions(-) delete mode 100644 compiler/x86_64-linker.ld delete mode 100644 compiler/x86_64-rustubs.json create mode 100644 defs/x86_64-linker.ld create mode 100644 defs/x86_64-rustubs.json diff --git a/Makefile b/Makefile index 292a1a5..5c2af44 100644 --- a/Makefile +++ b/Makefile @@ -18,8 +18,8 @@ BUILD = build ARCH = x86_64 ASM = nasm ASMOBJFORMAT = elf64 -LINKER_SCRIPT = ./compiler/$(ARCH)-linker.ld -CARGO_XBUILD_TARGET = ./compiler/$(ARCH)-rustubs.json +LINKER_SCRIPT = ./defs/$(ARCH)-linker.ld +CARGO_XBUILD_TARGET = ./defs/$(ARCH)-rustubs.json CARGO_XBUILD_FLAGS = # ---------- No need to edit below this line -------------- # ---------- If you have to, something is wrong ----------- diff --git a/compiler/x86_64-linker.ld b/compiler/x86_64-linker.ld deleted file mode 100644 index b484366..0000000 --- a/compiler/x86_64-linker.ld +++ /dev/null @@ -1,76 +0,0 @@ -SECTIONS -{ - . = 0x100000; /* system's start address */ - - .text : - { - *(".text") - *(".text.*") - *(".text$") - *(".init") - *(".fini") - *(".gnu.linkonce.*") - } - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array)) - KEEP (*(".ctors")) - KEEP (*(".ctor")) - PROVIDE_HIDDEN (__init_array_end = .); - } - - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array)) - KEEP (*(".dtors")) - KEEP (*(".dtor")) - PROVIDE_HIDDEN (__fini_array_end = .); - } - - .data : - { - *(".data") - *(".data$") - *(".rodata") - *(".rodata.*") - *(".got") - *(".got.plt") - *(".eh_frame") - *(".eh_fram") - *(".jcr") - *(".note.*") - } - - .bss : - { - ___BSS_START__ = .; - *(".bss") - *(".bss.*") - ___BSS_END__ = .; - } - - /* global page table for 64-bit long mode */ - .global_pagetable ALIGN(4096) (NOLOAD) : - { - *(".global_pagetable") - } - -/* - /DISCARD/ : - { - *(".note") - *(".comment") - *(".debug_line") - *(".debug_info") - *(".debug_abbrev") - *(".debug_aranges") - } -*/ - . = ALIGN(4096); - PROVIDE (___KERNEL_END__ = .); -} diff --git a/compiler/x86_64-rustubs.json b/compiler/x86_64-rustubs.json deleted file mode 100644 index 93512ed..0000000 --- a/compiler/x86_64-rustubs.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "llvm-target": "x86_64-unknown-none", - "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128", - "linker-flavor": "gcc", - "target-endian": "little", - "target-pointer-width": "64", - "target-c-int-width": "32", - "arch": "x86_64", - "os": "none", - "disable-redzone": true, - "features": "-mmx,-sse,-avx,+soft-float", - "frame-pointer": "always" -} diff --git a/defs/x86_64-linker.ld b/defs/x86_64-linker.ld new file mode 100644 index 0000000..b484366 --- /dev/null +++ b/defs/x86_64-linker.ld @@ -0,0 +1,76 @@ +SECTIONS +{ + . = 0x100000; /* system's start address */ + + .text : + { + *(".text") + *(".text.*") + *(".text$") + *(".init") + *(".fini") + *(".gnu.linkonce.*") + } + + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + KEEP (*(".ctors")) + KEEP (*(".ctor")) + PROVIDE_HIDDEN (__init_array_end = .); + } + + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array)) + KEEP (*(".dtors")) + KEEP (*(".dtor")) + PROVIDE_HIDDEN (__fini_array_end = .); + } + + .data : + { + *(".data") + *(".data$") + *(".rodata") + *(".rodata.*") + *(".got") + *(".got.plt") + *(".eh_frame") + *(".eh_fram") + *(".jcr") + *(".note.*") + } + + .bss : + { + ___BSS_START__ = .; + *(".bss") + *(".bss.*") + ___BSS_END__ = .; + } + + /* global page table for 64-bit long mode */ + .global_pagetable ALIGN(4096) (NOLOAD) : + { + *(".global_pagetable") + } + +/* + /DISCARD/ : + { + *(".note") + *(".comment") + *(".debug_line") + *(".debug_info") + *(".debug_abbrev") + *(".debug_aranges") + } +*/ + . = ALIGN(4096); + PROVIDE (___KERNEL_END__ = .); +} diff --git a/defs/x86_64-rustubs.json b/defs/x86_64-rustubs.json new file mode 100644 index 0000000..93512ed --- /dev/null +++ b/defs/x86_64-rustubs.json @@ -0,0 +1,13 @@ +{ + "llvm-target": "x86_64-unknown-none", + "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128", + "linker-flavor": "gcc", + "target-endian": "little", + "target-pointer-width": "64", + "target-c-int-width": "32", + "arch": "x86_64", + "os": "none", + "disable-redzone": true, + "features": "-mmx,-sse,-avx,+soft-float", + "frame-pointer": "always" +} -- cgit v1.2.3-70-g09d2