Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F167896691
D22922.id65971.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D22922.id65971.diff
View Options
Index: sys/conf/Makefile.arm
===================================================================
--- sys/conf/Makefile.arm
+++ sys/conf/Makefile.arm
@@ -32,9 +32,6 @@
INCLUDES+= -I$S/contrib/libfdt -I$S/gnu/dts/include
-SYSTEM_LD:= ${SYSTEM_LD:$S/conf/ldscript.$M=ldscript.$M}
-SYSTEM_DEP:= ${SYSTEM_DEP:$S/conf/ldscript.$M=ldscript.$M}
-
.if !defined(DEBUG) && !defined(PROFLEVEL)
STRIP_FLAGS = -S
.endif
@@ -58,20 +55,29 @@
KERNVIRTADDR= 0xc0000000
.endif
+# Generate both the ELF and the BIN (no elf headers) kernels; we must
+# relink to generate the BIN kernel, because without headers the location
+# of everything changes.
+# Strip the "arm mapping symbols" which have names like $a.0 and $d.2;
+# see the document "ELF for the ARM architecture" for details.
+SYSTEM_LD= \
+ ${SYSTEM_LD_BASECMD} \
+ --defsym='kernbase=${KERNVIRTADDR}+SIZEOF_HEADERS' \
+ -o ${FULLKERNEL} ${SYSTEM_OBJS} vers.o; \
+ $(OBJCOPY) \
+ --strip-symbol='$[adt]*' \
+ ${FULLKERNEL}; \
+ ${SYSTEM_LD_BASECMD} \
+ --defsym='kernbase=${KERNVIRTADDR}' \
+ -o ${KERNEL_KO}.bin ${SYSTEM_OBJS} vers.o; \
+ $(OBJCOPY) \
+ --strip-symbol='$[adt]*' \
+ --output-target=binary \
+ ${KERNEL_KO}.bin
+
# hack because genassym.c includes sys/bus.h which includes these.
genassym.o: bus_if.h device_if.h
-SYSTEM_LD_ = ${LD} -m ${LD_EMULATION} -Bdynamic -T ldscript.$M.noheader \
- ${_LDFLAGS} --no-warn-mismatch --warn-common --export-dynamic \
- --dynamic-linker /red/herring \
- -o ${FULLKERNEL}.noheader -X ${SYSTEM_OBJS} vers.o
-SYSTEM_LD_TAIL +=;sed s/" + SIZEOF_HEADERS"// ldscript.$M \
- >ldscript.$M.noheader; \
- ${SYSTEM_LD_}; \
- ${OBJCOPY} -S -O binary ${FULLKERNEL}.noheader \
- ${KERNEL_KO}.bin; \
- rm ${FULLKERNEL}.noheader
-
%BEFORE_DEPEND
%OBJS
@@ -84,10 +90,7 @@
%CLEAN
-CLEAN+= ldscript.$M ${KERNEL_KO}.bin ldscript.$M.noheader
-
-ldscript.$M: $S/conf/ldscript.$M
- sed s/KERNVIRTADDR/${KERNVIRTADDR}/g > ldscript.$M < $S/conf/ldscript.$M
+CLEAN+= ${KERNEL_KO}.bin
%RULES
Index: sys/conf/ldscript.arm
===================================================================
--- sys/conf/ldscript.arm
+++ sys/conf/ldscript.arm
@@ -6,7 +6,7 @@
SECTIONS
{
/* Read-only sections, merged into text segment: */
- . = KERNVIRTADDR + SIZEOF_HEADERS;
+ . = kernbase;
.text :
{
*(.text)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 26, 7:54 AM (5 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37277247
Default Alt Text
D22922.id65971.diff (2 KB)
Attached To
Mode
D22922: Eliminate generated ldscript for arm and arm64, and strip $a/$d marker symbols from linked kernel.
Attached
Detach File
Event Timeline
Log In to Comment