From 548af2ec1a6b73f70ef9d3ade3282e5bcb4b5952 Mon Sep 17 00:00:00 2001 From: Andy Nguyen Date: Sat, 30 Oct 2021 22:34:59 +0200 Subject: [PATCH] Restore -Os flag and add other sections to linker file. --- payload/Makefile | 2 +- payload/linker.x | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/payload/Makefile b/payload/Makefile index 50552a8..c5efb96 100644 --- a/payload/Makefile +++ b/payload/Makefile @@ -3,7 +3,7 @@ OBJS = start.o payload.o CC = gcc OBJCOPY = objcopy -CFLAGS = -isystem freebsd-headers/include -fno-stack-protector +CFLAGS = -isystem freebsd-headers/include -Os -fno-stack-protector LDFLAGS = -T linker.x -nostdlib -nostartfiles all: $(TARGET).bin diff --git a/payload/linker.x b/payload/linker.x index 4dc2a34..7f7482e 100644 --- a/payload/linker.x +++ b/payload/linker.x @@ -6,7 +6,9 @@ ENTRY(_start) SECTIONS { . = 0x916300000; - .text : { *(.text) } + .text : { *(.text .text.*) } . = 0x916304000; - .data : { *(.data) } + .rodata : { *(.rodata .rodata.*) } + .data : { *(.data .data.*) } + .bss : { *(.bss .bss.*) } }