From 21848a29ff6f6d52751bd91463be03b790f6e3e5 Mon Sep 17 00:00:00 2001 From: Darshit Shah Date: Tue, 24 Oct 2017 15:14:58 +0200 Subject: [PATCH] Modify the linker script to match the generated binary Newer versions of GCC (tested with GCC 7), emit more sections in the binary. Fix the computation of the start of the BSS section to prevent zeroing out parts of the data section --- src/Make.config | 2 +- src/threads/kernel.lds.S | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Make.config b/src/Make.config index 40feba6..14219b6 100644 --- a/src/Make.config +++ b/src/Make.config @@ -33,7 +33,7 @@ endif # Compiler and assembler invocation. DEFINES = WARNINGS = -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wsystem-headers -CFLAGS = -g -msoft-float -O +CFLAGS = -g -msoft-float -O -march=i686 CPPFLAGS = -nostdinc -I$(SRCDIR) -I$(SRCDIR)/lib ASFLAGS = -Wa,--gstabs LDFLAGS = diff --git a/src/threads/kernel.lds.S b/src/threads/kernel.lds.S index 19082d5..4840202 100644 --- a/src/threads/kernel.lds.S +++ b/src/threads/kernel.lds.S @@ -16,9 +16,12 @@ SECTIONS .rodata : { *(.rodata) *(.rodata.*) . = ALIGN(0x1000); _end_kernel_text = .; } + .eh_frame : { *(.eh_frame) } .data : { *(.data) _signature = .; LONG(0xaa55aa55) } + .plt : { *(.plt*) } + /* BSS (zero-initialized data) is after everything else. */ _start_bss = .; .bss : { *(.bss) } -- 2.30.2