aboutsummaryrefslogtreecommitdiff
path: root/stand/powerpc/ofw
diff options
context:
space:
mode:
authorBrandon Bergren <bdragon@FreeBSD.org>2020-02-25 00:45:09 +0000
committerBrandon Bergren <bdragon@FreeBSD.org>2020-02-25 00:45:09 +0000
commit20ae0afeacd034e5f5030ab2ed8abef24dfb94bb (patch)
treed96f2ef6ce1eae724f46e931694a9ccb278ecbf0 /stand/powerpc/ofw
parente87c4940156c9a218cab4fd35f4d487dc57e7aa3 (diff)
downloadsrc-20ae0afeacd034e5f5030ab2ed8abef24dfb94bb.tar.gz
src-20ae0afeacd034e5f5030ab2ed8abef24dfb94bb.zip
[PowerPC] Fix LLD10 linking of ofw loader on ppc
Before this change, LLD10 was creating several extra PT_LOAD sections, which OFW does not understand. Like we do for the kernel already, specify the program headers manually. Additionally, to work around a crash in our base ld.bfd, we need to actually assign something to the output section. LLD does not need this. One side effect of this change is the removal of the GNU_STACK header. This is more correct, since we are using a statically-allocated stack and RWX mappings across the board this early in boot. Reviewed by: jhibbits, Fangrui Song <i@maskray.me> Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D23778
Notes
Notes: svn path=/head/; revision=358304
Diffstat (limited to 'stand/powerpc/ofw')
-rw-r--r--stand/powerpc/ofw/ldscript.powerpc6
1 files changed, 5 insertions, 1 deletions
diff --git a/stand/powerpc/ofw/ldscript.powerpc b/stand/powerpc/ofw/ldscript.powerpc
index e0dc5e2614a8..5fa27eaf6a13 100644
--- a/stand/powerpc/ofw/ldscript.powerpc
+++ b/stand/powerpc/ofw/ldscript.powerpc
@@ -6,11 +6,15 @@ OUTPUT_ARCH(powerpc:common)
ENTRY(_start)
SEARCH_DIR(/usr/lib);
PROVIDE (__stack = 0);
+PHDRS
+{
+ text PT_LOAD;
+}
SECTIONS
{
/* Read-only sections, merged into text segment: */
. = 0x02c00000 + SIZEOF_HEADERS;
- .interp : { *(.interp) }
+ .interp : { *(.interp) } :text
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }