From 6d76e6058451262acd89b15ef675bc164323b16d Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Tue, 16 Oct 2018 18:20:59 +0000 Subject: Add linker script to assis lld with building something usable that doesn't have a PT_GNU_STACK segment and doesn't pad the bootblocks to a full page. ok naddy@, help from guenther@ --- sys/arch/amd64/stand/biosboot/Makefile | 3 ++- sys/arch/amd64/stand/biosboot/ld.script | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 sys/arch/amd64/stand/biosboot/ld.script (limited to 'sys/arch/amd64') diff --git a/sys/arch/amd64/stand/biosboot/Makefile b/sys/arch/amd64/stand/biosboot/Makefile index e1e8bdd03ce..be3cfddc1d3 100644 --- a/sys/arch/amd64/stand/biosboot/Makefile +++ b/sys/arch/amd64/stand/biosboot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.13 2017/10/17 19:31:56 naddy Exp $ +# $OpenBSD: Makefile,v 1.14 2018/10/16 18:20:58 kettenis Exp $ MAN= biosboot.8 @@ -10,6 +10,7 @@ PROG= biosboot SRCS= biosboot.S LD=ld LDFLAGS=-nostdlib -Ttext 0 -N -x -Bstatic -nopie -znorelro +LDFLAGS+=-T ${.CURDIR}/ld.script LDFLAGS+=-melf_i386 -L/usr/libdata INSTALL_STRIP= diff --git a/sys/arch/amd64/stand/biosboot/ld.script b/sys/arch/amd64/stand/biosboot/ld.script new file mode 100644 index 00000000000..aa4fc0b260f --- /dev/null +++ b/sys/arch/amd64/stand/biosboot/ld.script @@ -0,0 +1,12 @@ +PHDRS +{ + text PT_LOAD; +} + +SECTIONS +{ + .text : + { + *(.text) + } :text +} -- cgit v1.2.3