Remove .got section again

It seems that whatever bug or config mistake gave us .got entries back then has
since been resolved. Also add a sanity check to recognize should this happen
again.
pull/165/head
Andre Richter 2 years ago
parent bb2f1c79b7
commit e6c3790cac
No known key found for this signature in database
GPG Key ID: 2116C1AB102F615E

@ -181,7 +181,6 @@ objdump: $(KERNEL_ELF)
@$(DOCKER_TOOLS) $(OBJDUMP_BINARY) --disassemble --demangle \
--section .text \
--section .rodata \
--section .got \
$(KERNEL_ELF) | rustfilt
##------------------------------------------------------------------------------

@ -52,12 +52,11 @@ diff -uNr 01_wait_forever/Cargo.toml 02_runtime_init/Cargo.toml
diff -uNr 01_wait_forever/Makefile 02_runtime_init/Makefile
--- 01_wait_forever/Makefile
+++ 02_runtime_init/Makefile
@@ -180,6 +180,8 @@
@@ -180,6 +180,7 @@
$(call color_header, "Launching objdump")
@$(DOCKER_TOOLS) $(OBJDUMP_BINARY) --disassemble --demangle \
--section .text \
+ --section .rodata \
+ --section .got \
$(KERNEL_ELF) | rustfilt
##------------------------------------------------------------------------------
@ -211,7 +210,7 @@ diff -uNr 01_wait_forever/src/bsp/raspberrypi/kernel.ld 02_runtime_init/src/bsp/
/* The physical address at which the the kernel binary will be loaded by the Raspberry's firmware */
__rpi_phys_binary_load_addr = 0x80000;
@@ -13,21 +15,58 @@
@@ -13,21 +15,65 @@
* 4 == R
* 5 == RX
* 6 == RW
@ -257,7 +256,6 @@ diff -uNr 01_wait_forever/src/bsp/raspberrypi/kernel.ld 02_runtime_init/src/bsp/
} :segment_code
+
+ .rodata : ALIGN(8) { *(.rodata*) } :segment_code
+ .got : ALIGN(8) { *(.got) } :segment_code
+
+ /***********************************************************************************************
+ * Data + BSS
@ -272,6 +270,14 @@ diff -uNr 01_wait_forever/src/bsp/raspberrypi/kernel.ld 02_runtime_init/src/bsp/
+ . = ALIGN(16);
+ __bss_end_exclusive = .;
+ } :segment_data
+
+ /***********************************************************************************************
+ * Misc
+ ***********************************************************************************************/
+ .got : { *(.got*) }
+ ASSERT(SIZEOF(.got) == 0, "Relocation support not expected")
+
+ /DISCARD/ : { *(.comment*) }
}
diff -uNr 01_wait_forever/src/bsp/raspberrypi.rs 02_runtime_init/src/bsp/raspberrypi.rs

@ -54,7 +54,6 @@ SECTIONS
} :segment_code
.rodata : ALIGN(8) { *(.rodata*) } :segment_code
.got : ALIGN(8) { *(.got) } :segment_code
/***********************************************************************************************
* Data + BSS
@ -69,4 +68,12 @@ SECTIONS
. = ALIGN(16);
__bss_end_exclusive = .;
} :segment_data
/***********************************************************************************************
* Misc
***********************************************************************************************/
.got : { *(.got*) }
ASSERT(SIZEOF(.got) == 0, "Relocation support not expected")
/DISCARD/ : { *(.comment*) }
}

@ -184,7 +184,6 @@ objdump: $(KERNEL_ELF)
@$(DOCKER_TOOLS) $(OBJDUMP_BINARY) --disassemble --demangle \
--section .text \
--section .rodata \
--section .got \
$(KERNEL_ELF) | rustfilt
##------------------------------------------------------------------------------

@ -95,7 +95,7 @@ diff -uNr 02_runtime_init/Makefile 03_hacky_hello_world/Makefile
@@ -191,3 +194,27 @@
@@ -190,3 +193,27 @@
$(call color_header, "Launching nm")
@$(DOCKER_TOOLS) $(NM_BINARY) --demangle --print-size $(KERNEL_ELF) | sort | rustfilt

@ -54,7 +54,6 @@ SECTIONS
} :segment_code
.rodata : ALIGN(8) { *(.rodata*) } :segment_code
.got : ALIGN(8) { *(.got) } :segment_code
/***********************************************************************************************
* Data + BSS
@ -69,4 +68,12 @@ SECTIONS
. = ALIGN(16);
__bss_end_exclusive = .;
} :segment_data
/***********************************************************************************************
* Misc
***********************************************************************************************/
.got : { *(.got*) }
ASSERT(SIZEOF(.got) == 0, "Relocation support not expected")
/DISCARD/ : { *(.comment*) }
}

@ -184,7 +184,6 @@ objdump: $(KERNEL_ELF)
@$(DOCKER_TOOLS) $(OBJDUMP_BINARY) --disassemble --demangle \
--section .text \
--section .rodata \
--section .got \
$(KERNEL_ELF) | rustfilt
##------------------------------------------------------------------------------

@ -54,7 +54,6 @@ SECTIONS
} :segment_code
.rodata : ALIGN(8) { *(.rodata*) } :segment_code
.got : ALIGN(8) { *(.got) } :segment_code
/***********************************************************************************************
* Data + BSS
@ -69,4 +68,12 @@ SECTIONS
. = ALIGN(16);
__bss_end_exclusive = .;
} :segment_data
/***********************************************************************************************
* Misc
***********************************************************************************************/
.got : { *(.got*) }
ASSERT(SIZEOF(.got) == 0, "Relocation support not expected")
/DISCARD/ : { *(.comment*) }
}

@ -203,7 +203,6 @@ objdump: $(KERNEL_ELF)
@$(DOCKER_TOOLS) $(OBJDUMP_BINARY) --disassemble --demangle \
--section .text \
--section .rodata \
--section .got \
$(KERNEL_ELF) | rustfilt
##------------------------------------------------------------------------------

@ -54,7 +54,6 @@ SECTIONS
} :segment_code
.rodata : ALIGN(8) { *(.rodata*) } :segment_code
.got : ALIGN(8) { *(.got) } :segment_code
/***********************************************************************************************
* Data + BSS
@ -69,4 +68,12 @@ SECTIONS
. = ALIGN(16);
__bss_end_exclusive = .;
} :segment_data
/***********************************************************************************************
* Misc
***********************************************************************************************/
.got : { *(.got*) }
ASSERT(SIZEOF(.got) == 0, "Relocation support not expected")
/DISCARD/ : { *(.comment*) }
}

@ -209,7 +209,6 @@ objdump: $(KERNEL_ELF)
@$(DOCKER_TOOLS) $(OBJDUMP_BINARY) --disassemble --demangle \
--section .text \
--section .rodata \
--section .got \
$(KERNEL_ELF) | rustfilt
##------------------------------------------------------------------------------

@ -249,7 +249,7 @@ diff -uNr 05_drivers_gpio_uart/Makefile 06_uart_chainloader/Makefile
##------------------------------------------------------------------------------
## Run clippy
@@ -232,7 +238,8 @@
@@ -231,7 +237,8 @@
##------------------------------------------------------------------------------
test_boot: $(KERNEL_BIN)
$(call color_header, "Boot test - $(BSP)")
@ -399,7 +399,7 @@ diff -uNr 05_drivers_gpio_uart/src/bsp/raspberrypi/kernel.ld 06_uart_chainloader
.text :
{
KEEP(*(.text._start))
@@ -61,6 +61,10 @@
@@ -60,6 +60,10 @@
***********************************************************************************************/
.data : { *(.data*) } :segment_data

@ -54,7 +54,6 @@ SECTIONS
} :segment_code
.rodata : ALIGN(8) { *(.rodata*) } :segment_code
.got : ALIGN(8) { *(.got) } :segment_code
/***********************************************************************************************
* Data + BSS
@ -73,4 +72,12 @@ SECTIONS
. = ALIGN(16);
__bss_end_exclusive = .;
} :segment_data
/***********************************************************************************************
* Misc
***********************************************************************************************/
.got : { *(.got*) }
ASSERT(SIZEOF(.got) == 0, "Relocation support not expected")
/DISCARD/ : { *(.comment*) }
}

@ -203,7 +203,6 @@ objdump: $(KERNEL_ELF)
@$(DOCKER_TOOLS) $(OBJDUMP_BINARY) --disassemble --demangle \
--section .text \
--section .rodata \
--section .got \
$(KERNEL_ELF) | rustfilt
##------------------------------------------------------------------------------

@ -150,7 +150,7 @@ diff -uNr 06_uart_chainloader/Makefile 07_timestamps/Makefile
##------------------------------------------------------------------------------
## Run clippy
@@ -238,8 +232,7 @@
@@ -237,8 +231,7 @@
##------------------------------------------------------------------------------
test_boot: $(KERNEL_BIN)
$(call color_header, "Boot test - $(BSP)")
@ -482,7 +482,7 @@ diff -uNr 06_uart_chainloader/src/bsp/raspberrypi/kernel.ld 07_timestamps/src/bs
.text :
{
KEEP(*(.text._start))
@@ -61,10 +61,6 @@
@@ -60,10 +60,6 @@
***********************************************************************************************/
.data : { *(.data*) } :segment_data

@ -54,7 +54,6 @@ SECTIONS
} :segment_code
.rodata : ALIGN(8) { *(.rodata*) } :segment_code
.got : ALIGN(8) { *(.got) } :segment_code
/***********************************************************************************************
* Data + BSS
@ -69,4 +68,12 @@ SECTIONS
. = ALIGN(16);
__bss_end_exclusive = .;
} :segment_data
/***********************************************************************************************
* Misc
***********************************************************************************************/
.got : { *(.got*) }
ASSERT(SIZEOF(.got) == 0, "Relocation support not expected")
/DISCARD/ : { *(.comment*) }
}

@ -214,7 +214,6 @@ objdump: $(KERNEL_ELF)
@$(DOCKER_TOOLS) $(OBJDUMP_BINARY) --disassemble --demangle \
--section .text \
--section .rodata \
--section .got \
$(KERNEL_ELF) | rustfilt
##------------------------------------------------------------------------------

@ -364,7 +364,7 @@ diff -uNr 07_timestamps/Makefile 08_hw_debug_JTAG/Makefile
endif
@@ -215,6 +226,35 @@
@@ -214,6 +225,35 @@

@ -54,7 +54,6 @@ SECTIONS
} :segment_code
.rodata : ALIGN(8) { *(.rodata*) } :segment_code
.got : ALIGN(8) { *(.got) } :segment_code
/***********************************************************************************************
* Data + BSS
@ -69,4 +68,12 @@ SECTIONS
. = ALIGN(16);
__bss_end_exclusive = .;
} :segment_data
/***********************************************************************************************
* Misc
***********************************************************************************************/
.got : { *(.got*) }
ASSERT(SIZEOF(.got) == 0, "Relocation support not expected")
/DISCARD/ : { *(.comment*) }
}

@ -214,7 +214,6 @@ objdump: $(KERNEL_ELF)
@$(DOCKER_TOOLS) $(OBJDUMP_BINARY) --disassemble --demangle \
--section .text \
--section .rodata \
--section .got \
$(KERNEL_ELF) | rustfilt
##------------------------------------------------------------------------------

@ -54,7 +54,6 @@ SECTIONS
} :segment_code
.rodata : ALIGN(8) { *(.rodata*) } :segment_code
.got : ALIGN(8) { *(.got) } :segment_code
/***********************************************************************************************
* Data + BSS
@ -69,4 +68,12 @@ SECTIONS
. = ALIGN(16);
__bss_end_exclusive = .;
} :segment_data
/***********************************************************************************************
* Misc
***********************************************************************************************/
.got : { *(.got*) }
ASSERT(SIZEOF(.got) == 0, "Relocation support not expected")
/DISCARD/ : { *(.comment*) }
}

@ -214,7 +214,6 @@ objdump: $(KERNEL_ELF)
@$(DOCKER_TOOLS) $(OBJDUMP_BINARY) --disassemble --demangle \
--section .text \
--section .rodata \
--section .got \
$(KERNEL_ELF) | rustfilt
##------------------------------------------------------------------------------

@ -855,9 +855,9 @@ diff -uNr 09_privilege_level/src/bsp/raspberrypi/kernel.ld 10_virtual_mem_part1_
.text :
{
KEEP(*(.text._start))
@@ -56,6 +62,9 @@
@@ -55,6 +61,9 @@
.rodata : ALIGN(8) { *(.rodata*) } :segment_code
.got : ALIGN(8) { *(.got) } :segment_code
+ . = ALIGN(PAGE_SIZE);
+ __code_end_exclusive = .;

@ -60,7 +60,6 @@ SECTIONS
} :segment_code
.rodata : ALIGN(8) { *(.rodata*) } :segment_code
.got : ALIGN(8) { *(.got) } :segment_code
. = ALIGN(PAGE_SIZE);
__code_end_exclusive = .;
@ -78,4 +77,12 @@ SECTIONS
. = ALIGN(16);
__bss_end_exclusive = .;
} :segment_data
/***********************************************************************************************
* Misc
***********************************************************************************************/
.got : { *(.got*) }
ASSERT(SIZEOF(.got) == 0, "Relocation support not expected")
/DISCARD/ : { *(.comment*) }
}

@ -214,7 +214,6 @@ objdump: $(KERNEL_ELF)
@$(DOCKER_TOOLS) $(OBJDUMP_BINARY) --disassemble --demangle \
--section .text \
--section .rodata \
--section .got \
$(KERNEL_ELF) | rustfilt
##------------------------------------------------------------------------------

@ -60,7 +60,6 @@ SECTIONS
} :segment_code
.rodata : ALIGN(8) { *(.rodata*) } :segment_code
.got : ALIGN(8) { *(.got) } :segment_code
. = ALIGN(PAGE_SIZE);
__code_end_exclusive = .;
@ -78,4 +77,12 @@ SECTIONS
. = ALIGN(16);
__bss_end_exclusive = .;
} :segment_data
/***********************************************************************************************
* Misc
***********************************************************************************************/
.got : { *(.got*) }
ASSERT(SIZEOF(.got) == 0, "Relocation support not expected")
/DISCARD/ : { *(.comment*) }
}

@ -226,7 +226,6 @@ objdump: $(KERNEL_ELF)
@$(DOCKER_TOOLS) $(OBJDUMP_BINARY) --disassemble --demangle \
--section .text \
--section .rodata \
--section .got \
$(KERNEL_ELF) | rustfilt
##------------------------------------------------------------------------------

@ -60,7 +60,6 @@ SECTIONS
} :segment_code
.rodata : ALIGN(8) { *(.rodata*) } :segment_code
.got : ALIGN(8) { *(.got) } :segment_code
. = ALIGN(PAGE_SIZE);
__code_end_exclusive = .;
@ -78,4 +77,12 @@ SECTIONS
. = ALIGN(16);
__bss_end_exclusive = .;
} :segment_data
/***********************************************************************************************
* Misc
***********************************************************************************************/
.got : { *(.got*) }
ASSERT(SIZEOF(.got) == 0, "Relocation support not expected")
/DISCARD/ : { *(.comment*) }
}

@ -226,7 +226,6 @@ objdump: $(KERNEL_ELF)
@$(DOCKER_TOOLS) $(OBJDUMP_BINARY) --disassemble --demangle \
--section .text \
--section .rodata \
--section .got \
$(KERNEL_ELF) | rustfilt
##------------------------------------------------------------------------------

@ -60,7 +60,6 @@ SECTIONS
} :segment_code
.rodata : ALIGN(8) { *(.rodata*) } :segment_code
.got : ALIGN(8) { *(.got) } :segment_code
. = ALIGN(PAGE_SIZE);
__code_end_exclusive = .;
@ -78,4 +77,12 @@ SECTIONS
. = ALIGN(16);
__bss_end_exclusive = .;
} :segment_data
/***********************************************************************************************
* Misc
***********************************************************************************************/
.got : { *(.got*) }
ASSERT(SIZEOF(.got) == 0, "Relocation support not expected")
/DISCARD/ : { *(.comment*) }
}

@ -226,7 +226,6 @@ objdump: $(KERNEL_ELF)
@$(DOCKER_TOOLS) $(OBJDUMP_BINARY) --disassemble --demangle \
--section .text \
--section .rodata \
--section .got \
$(KERNEL_ELF) | rustfilt
##------------------------------------------------------------------------------

@ -1480,7 +1480,7 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/kernel/src/bsp/raspberrypi/kernel.
/* | stack */
. += __rpi_phys_binary_load_addr; /* | growth */
/* | direction */
@@ -68,6 +68,7 @@
@@ -67,6 +67,7 @@
/***********************************************************************************************
* Data + BSS
***********************************************************************************************/
@ -1488,11 +1488,10 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/kernel/src/bsp/raspberrypi/kernel.
.data : { *(.data*) } :segment_data
/* Section is zeroed in pairs of u64. Align start and end to 16 bytes */
@@ -78,4 +79,16 @@
. = ALIGN(16);
@@ -78,6 +79,18 @@
__bss_end_exclusive = .;
} :segment_data
+
+ . = ALIGN(PAGE_SIZE);
+ __data_end_exclusive = .;
+
@ -1504,7 +1503,10 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/kernel/src/bsp/raspberrypi/kernel.
+ __mmio_remap_end_exclusive = .;
+
+ ASSERT((. & PAGE_MASK) == 0, "MMIO remap reservation is not page aligned")
}
+
/***********************************************************************************************
* Misc
***********************************************************************************************/
diff -uNr 13_exceptions_part2_peripheral_IRQs/kernel/src/bsp/raspberrypi/memory/mmu.rs 14_virtual_mem_part2_mmio_remap/kernel/src/bsp/raspberrypi/memory/mmu.rs
--- 13_exceptions_part2_peripheral_IRQs/kernel/src/bsp/raspberrypi/memory/mmu.rs

@ -60,7 +60,6 @@ SECTIONS
} :segment_code
.rodata : ALIGN(8) { *(.rodata*) } :segment_code
.got : ALIGN(8) { *(.got) } :segment_code
. = ALIGN(PAGE_SIZE);
__code_end_exclusive = .;
@ -91,4 +90,12 @@ SECTIONS
__mmio_remap_end_exclusive = .;
ASSERT((. & PAGE_MASK) == 0, "MMIO remap reservation is not page aligned")
/***********************************************************************************************
* Misc
***********************************************************************************************/
.got : { *(.got*) }
ASSERT(SIZEOF(.got) == 0, "Relocation support not expected")
/DISCARD/ : { *(.comment*) }
}

@ -245,7 +245,6 @@ objdump: $(KERNEL_ELF)
@$(DOCKER_TOOLS) $(OBJDUMP_BINARY) --disassemble --demangle \
--section .text \
--section .rodata \
--section .got \
$(KERNEL_ELF) | rustfilt
##------------------------------------------------------------------------------

@ -1077,6 +1077,15 @@ diff -uNr 14_virtual_mem_part2_mmio_remap/kernel/src/bsp/raspberrypi/kernel.ld 1
PAGE_SIZE = 64K;
PAGE_MASK = PAGE_SIZE - 1;
@@ -89,7 +91,7 @@
. += 8 * 1024 * 1024;
__mmio_remap_end_exclusive = .;
- ASSERT((. & PAGE_MASK) == 0, "MMIO remap reservation is not page aligned")
+ ASSERT((. & PAGE_MASK) == 0, "End of boot core stack is not page aligned")
/***********************************************************************************************
* Misc
diff -uNr 14_virtual_mem_part2_mmio_remap/kernel/src/bsp/raspberrypi/kernel_virt_addr_space_size.ld 15_virtual_mem_part3_precomputed_tables/kernel/src/bsp/raspberrypi/kernel_virt_addr_space_size.ld
--- 14_virtual_mem_part2_mmio_remap/kernel/src/bsp/raspberrypi/kernel_virt_addr_space_size.ld
@ -1888,7 +1897,7 @@ diff -uNr 14_virtual_mem_part2_mmio_remap/Makefile 15_virtual_mem_part3_precompu
$(call color_progress_prefix, "Name")
@echo $(KERNEL_BIN)
$(call color_progress_prefix, "Size")
@@ -301,6 +320,7 @@
@@ -300,6 +319,7 @@
TEST_ELF=$$(echo $$1 | sed -e 's/.*target/target/g')
TEST_BINARY=$$(echo $$1.img | sed -e 's/.*target/target/g')

@ -62,7 +62,6 @@ SECTIONS
} :segment_code
.rodata : ALIGN(8) { *(.rodata*) } :segment_code
.got : ALIGN(8) { *(.got) } :segment_code
. = ALIGN(PAGE_SIZE);
__code_end_exclusive = .;
@ -92,5 +91,13 @@ SECTIONS
. += 8 * 1024 * 1024;
__mmio_remap_end_exclusive = .;
ASSERT((. & PAGE_MASK) == 0, "MMIO remap reservation is not page aligned")
ASSERT((. & PAGE_MASK) == 0, "End of boot core stack is not page aligned")
/***********************************************************************************************
* Misc
***********************************************************************************************/
.got : { *(.got*) }
ASSERT(SIZEOF(.got) == 0, "Relocation support not expected")
/DISCARD/ : { *(.comment*) }
}

@ -245,7 +245,6 @@ objdump: $(KERNEL_ELF)
@$(DOCKER_TOOLS) $(OBJDUMP_BINARY) --disassemble --demangle \
--section .text \
--section .rodata \
--section .got \
$(KERNEL_ELF) | rustfilt
##------------------------------------------------------------------------------

@ -598,8 +598,7 @@ diff -uNr 15_virtual_mem_part3_precomputed_tables/kernel/src/bsp/raspberrypi/ker
SECTIONS
{
- . = __rpi_phys_dram_start_addr;
+ . = __kernel_virt_start_addr;
-
- /***********************************************************************************************
- * Boot Core Stack
- ***********************************************************************************************/
@ -611,7 +610,8 @@ diff -uNr 15_virtual_mem_part3_precomputed_tables/kernel/src/bsp/raspberrypi/ker
- /* | direction */
- __boot_core_stack_end_exclusive = .; /* | */
- } :segment_boot_core_stack
-
+ . = __kernel_virt_start_addr;
- ASSERT((. & PAGE_MASK) == 0, "End of boot core stack is not page aligned")
+ ASSERT((. & PAGE_MASK) == 0, "Start of address space is not page aligned")
@ -624,10 +624,11 @@ diff -uNr 15_virtual_mem_part3_precomputed_tables/kernel/src/bsp/raspberrypi/ker
{
KEEP(*(.text._start))
*(.text._start_arguments) /* Constants (or statics in Rust speak) read by _start(). */
@@ -93,4 +88,23 @@
@@ -91,6 +86,25 @@
. += 8 * 1024 * 1024;
__mmio_remap_end_exclusive = .;
ASSERT((. & PAGE_MASK) == 0, "MMIO remap reservation is not page aligned")
+ ASSERT((. & PAGE_MASK) == 0, "MMIO remap reservation is not page aligned")
+
+ /***********************************************************************************************
+ * Guard Page
@ -646,8 +647,9 @@ diff -uNr 15_virtual_mem_part3_precomputed_tables/kernel/src/bsp/raspberrypi/ker
+ __boot_core_stack_end_exclusive = .; /* | */
+ } :segment_boot_core_stack
+
+ ASSERT((. & PAGE_MASK) == 0, "End of boot core stack is not page aligned")
}
ASSERT((. & PAGE_MASK) == 0, "End of boot core stack is not page aligned")
/***********************************************************************************************
diff -uNr 15_virtual_mem_part3_precomputed_tables/kernel/src/bsp/raspberrypi/memory/mmu.rs 16_virtual_mem_part4_higher_half_kernel/kernel/src/bsp/raspberrypi/memory/mmu.rs
--- 15_virtual_mem_part3_precomputed_tables/kernel/src/bsp/raspberrypi/memory/mmu.rs

@ -57,7 +57,6 @@ SECTIONS
} :segment_code
.rodata : ALIGN(8) { *(.rodata*) } :segment_code
.got : ALIGN(8) { *(.got) } :segment_code
. = ALIGN(PAGE_SIZE);
__code_end_exclusive = .;
@ -107,4 +106,12 @@ SECTIONS
} :segment_boot_core_stack
ASSERT((. & PAGE_MASK) == 0, "End of boot core stack is not page aligned")
/***********************************************************************************************
* Misc
***********************************************************************************************/
.got : { *(.got*) }
ASSERT(SIZEOF(.got) == 0, "Relocation support not expected")
/DISCARD/ : { *(.comment*) }
}

@ -270,7 +270,6 @@ objdump: $(KERNEL_ELF)
@$(DOCKER_TOOLS) $(OBJDUMP_BINARY) --disassemble --demangle \
--section .text \
--section .rodata \
--section .got \
$(KERNEL_ELF) | rustfilt
##------------------------------------------------------------------------------

@ -293,14 +293,12 @@ diff -uNr 16_virtual_mem_part4_higher_half_kernel/kernel/src/_arch/aarch64/excep
diff -uNr 16_virtual_mem_part4_higher_half_kernel/kernel/src/bsp/raspberrypi/kernel.ld 17_kernel_symbols/kernel/src/bsp/raspberrypi/kernel.ld
--- 16_virtual_mem_part4_higher_half_kernel/kernel/src/bsp/raspberrypi/kernel.ld
+++ 17_kernel_symbols/kernel/src/bsp/raspberrypi/kernel.ld
@@ -56,8 +56,12 @@
@@ -56,7 +56,11 @@
*(.text*) /* Everything else */
} :segment_code
- .rodata : ALIGN(8) { *(.rodata*) } :segment_code
- .got : ALIGN(8) { *(.got) } :segment_code
+ .rodata : ALIGN(8) { *(.rodata*) } :segment_code
+ .got : ALIGN(8) { *(.got) } :segment_code
+ .kernel_symbols : ALIGN(8) {
+ __kernel_symbols_start = .;
+ . += 32 * 1024;
@ -740,7 +738,7 @@ diff -uNr 16_virtual_mem_part4_higher_half_kernel/Makefile 17_kernel_symbols/Mak
$(call color_header, "Generating docs")
@$(DOC_CMD) --document-private-items --open
@@ -318,10 +343,19 @@
@@ -317,10 +342,19 @@
cd $(shell pwd)
TEST_ELF=$$(echo $$1 | sed -e 's/.*target/target/g')

@ -57,7 +57,6 @@ SECTIONS
} :segment_code
.rodata : ALIGN(8) { *(.rodata*) } :segment_code
.got : ALIGN(8) { *(.got) } :segment_code
.kernel_symbols : ALIGN(8) {
__kernel_symbols_start = .;
. += 32 * 1024;
@ -111,4 +110,12 @@ SECTIONS
} :segment_boot_core_stack
ASSERT((. & PAGE_MASK) == 0, "End of boot core stack is not page aligned")
/***********************************************************************************************
* Misc
***********************************************************************************************/
.got : { *(.got*) }
ASSERT(SIZEOF(.got) == 0, "Relocation support not expected")
/DISCARD/ : { *(.comment*) }
}

@ -272,7 +272,6 @@ objdump: $(KERNEL_ELF)
@$(DOCKER_TOOLS) $(OBJDUMP_BINARY) --disassemble --demangle \
--section .text \
--section .rodata \
--section .got \
$(KERNEL_ELF) | rustfilt
##------------------------------------------------------------------------------

@ -1253,7 +1253,7 @@ diff -uNr 17_kernel_symbols/Makefile 18_backtrace/Makefile
OBJCOPY_CMD = rust-objcopy \
--strip-all \
-O binary
@@ -303,8 +305,7 @@
@@ -302,8 +304,7 @@
##------------------------------------------------------------------------------
## Start GDB session
##------------------------------------------------------------------------------

@ -57,7 +57,6 @@ SECTIONS
} :segment_code
.rodata : ALIGN(8) { *(.rodata*) } :segment_code
.got : ALIGN(8) { *(.got) } :segment_code
.kernel_symbols : ALIGN(8) {
__kernel_symbols_start = .;
. += 32 * 1024;
@ -111,4 +110,12 @@ SECTIONS
} :segment_boot_core_stack
ASSERT((. & PAGE_MASK) == 0, "End of boot core stack is not page aligned")
/***********************************************************************************************
* Misc
***********************************************************************************************/
.got : { *(.got*) }
ASSERT(SIZEOF(.got) == 0, "Relocation support not expected")
/DISCARD/ : { *(.comment*) }
}

@ -277,7 +277,6 @@ objdump: $(KERNEL_ELF)
@$(DOCKER_TOOLS) $(OBJDUMP_BINARY) --disassemble --demangle \
--section .text \
--section .rodata \
--section .got \
$(KERNEL_ELF) | rustfilt
##------------------------------------------------------------------------------

@ -512,7 +512,7 @@ diff -uNr 18_backtrace/kernel/src/bsp/raspberrypi/kernel.ld 19_kernel_heap/kerne
segment_boot_core_stack PT_LOAD FLAGS(6);
}
@@ -85,6 +86,18 @@
@@ -84,6 +85,18 @@
__data_end_exclusive = .;
/***********************************************************************************************

@ -58,7 +58,6 @@ SECTIONS
} :segment_code
.rodata : ALIGN(8) { *(.rodata*) } :segment_code
.got : ALIGN(8) { *(.got) } :segment_code
.kernel_symbols : ALIGN(8) {
__kernel_symbols_start = .;
. += 32 * 1024;
@ -124,4 +123,12 @@ SECTIONS
} :segment_boot_core_stack
ASSERT((. & PAGE_MASK) == 0, "End of boot core stack is not page aligned")
/***********************************************************************************************
* Misc
***********************************************************************************************/
.got : { *(.got*) }
ASSERT(SIZEOF(.got) == 0, "Relocation support not expected")
/DISCARD/ : { *(.comment*) }
}

@ -203,7 +203,6 @@ objdump: $(KERNEL_ELF)
@$(DOCKER_TOOLS) $(OBJDUMP_BINARY) --disassemble --demangle \
--section .text \
--section .rodata \
--section .got \
$(KERNEL_ELF) | rustfilt
##------------------------------------------------------------------------------

@ -54,7 +54,6 @@ SECTIONS
} :segment_code
.rodata : ALIGN(8) { *(.rodata*) } :segment_code
.got : ALIGN(8) { *(.got) } :segment_code
/***********************************************************************************************
* Data + BSS
@ -69,4 +68,12 @@ SECTIONS
. = ALIGN(16);
__bss_end_exclusive = .;
} :segment_data
/***********************************************************************************************
* Misc
***********************************************************************************************/
.got : { *(.got*) }
ASSERT(SIZEOF(.got) == 0, "Relocation support not expected")
/DISCARD/ : { *(.comment*) }
}

Loading…
Cancel
Save