Skip to content

Cleanup layout.ld #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 18 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ log-panic = ["log-serial"]

[dependencies]
bitflags = "1.2"
x86_64 = "0.9"
x86_64 = "0.10"
atomic_refcell = "0.1"
r-efi = "2.1.0"
uart_16550 = "0.2.5"
uart_16550 = "0.2.6"
68 changes: 28 additions & 40 deletions layout.ld
Original file line number Diff line number Diff line change
Expand Up @@ -11,48 +11,36 @@ ram_min = 1M;

SECTIONS
{
/* Mapping the program headers and note into RAM makes the file smaller. */
. = ram_min;
. += SIZEOF_HEADERS;
.note : { *(.note) } :note :ram
/* Mapping the program headers and note into RAM makes the file smaller. */
. = ram_min;
. += SIZEOF_HEADERS;
.note : { *(.note) } :note :ram

/* These sections are mapped into RAM from the file. Omitting :ram from
later sections avoids emitting empty sections in the final binary. */
data_start = .;
.rodata : { *(.rodata .rodata.*) } :ram
.text : { *(.text .text.*) }
.text32 : { *(.text32) }
.data : { *(.data .data.*) }
data_size = . - data_start;
/* These sections are mapped into RAM from the file. Omitting :ram from
later sections avoids emitting empty sections in the final binary. */
data_start = .;
.rodata : { *(.rodata .rodata.*) } :ram
.text : { *(.text .text.*) }
.text32 : { *(.text32) }
.data : { *(.data .data.*) }
data_size = . - data_start;

/* The BSS section isn't mapped from file data. It is just zeroed in RAM. */
.bss : {
bss_start = .;
*(.bss .bss.*)
bss_size = . - bss_start;
}
/* The BSS section isn't mapped from file data. It is just zeroed in RAM. */
.bss : {
bss_start = .;
*(.bss .bss.*)
bss_size = . - bss_start;
}

/* Our stack grows down and is page-aligned. TODO: Add stack guard pages. */
.stack (NOLOAD) : ALIGN(4K) { . += 64K; }
stack_start = .;
/* ram32.s only maps the first 2 MiB, and that must include the stack. */
ASSERT((. <= 2M), "Stack overflows initial identity-mapped memory region")
/* Our stack grows down and is page-aligned. TODO: Add stack guard pages. */
.stack (NOLOAD) : ALIGN(4K) { . += 64K; }
stack_start = .;
/* ram32.s only maps the first 2 MiB, and that must include the stack. */
ASSERT((. <= 2M), "Stack overflows initial identity-mapped memory region")

/* Match edk2's GccBase.lds DISCARD section */
/DISCARD/ : {
*(.note.GNU-stack)
*(.gnu_debuglink)
*(.interp)
*(.dynsym)
*(.dynstr)
*(.dynamic)
*(.hash .gnu.hash)
*(.comment)
*(COMMON)
}
/* Strip symbols from the output binary (comment out to get symbols) */
/DISCARD/ : {
*(.symtab)
*(.strtab)
}
/* Strip symbols from the output binary (comment out to get symbols) */
/DISCARD/ : {
*(.symtab)
*(.strtab)
}
}
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2020-03-01
nightly-2020-05-15