From: Darshit Shah Date: Tue, 24 Oct 2017 13:14:58 +0000 (+0200) Subject: Modify the linker script to match the generated binary X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pintos-anon;a=commitdiff_plain;h=21848a29ff6f6d52751bd91463be03b790f6e3e5;hp=258ac974c5f71fee4e6e2e10c7b26fda6a823d59 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 --- 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) }