diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-10-16 18:20:59 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-10-16 18:20:59 +0000 |
commit | 6d76e6058451262acd89b15ef675bc164323b16d (patch) | |
tree | fc61f3d12545a2d8c46ea38f6a024e7b7a96f620 /sys/arch/amd64 | |
parent | 3e2165c62ce76deb7e2a38c23179e5c842228aee (diff) |
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@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r-- | sys/arch/amd64/stand/biosboot/Makefile | 3 | ||||
-rw-r--r-- | sys/arch/amd64/stand/biosboot/ld.script | 12 |
2 files changed, 14 insertions, 1 deletions
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 +} |