Commit Graph

10 Commits

Author SHA1 Message Date
Ian Lepore
31333ebb99 Eliminate the generated ldscript for arm and arm64, and strip $a/$d marker
symbols from the linked kernel.

The main thrust of this change is to generate a kernel that has the arm
"marker" symbols stripped. Marker symbols start with $a, $d, $t or $x, and
are emitted by the compiler to tell other toolchain components about the
locations of data embedded in the instruction stream (literal-pool
stuff). They are used for generating mixed-endian binaries (which we don't
support). The linked kernel has approximately 21,000 such symbols in it,
wasting space (500K in kernel.full, 190K in the final linked kernel), and
sometimes obscuring function names in stack tracebacks.

This change also simplifies the way the kernel is linked. Instead of using
sed to generate two different ldscript files to generate both an elf kernel
and a binary (elf headers stripped) kernel, we now use a single ldscript
that refers to a "text_start" symbol, and we provide the value for that
symbol using --defsym on the linker command line.
2019-12-29 18:17:12 +00:00
Ed Maste
74cd06b42e Expose the kernel's build-ID through sysctl
After our migration (of certain architectures) to lld the kernel is built
with a unique build-ID.  Make it available via a sysctl and uname(1) to
allow the user to identify their running kernel.

Submitted by:	Ali Mashtizadeh <ali_mashtizadeh.com>
MFC after:	2 weeks
Relnotes:	Yes
Event:		Waterloo Hackathon 2019
Differential Revision:	https://reviews.freebsd.org/D20326
2019-06-04 13:07:10 +00:00
Ed Maste
45eff3df96 remove CONSTRUCTORS from kernel linker scripts
The linker script CONSTRUCTORS keyword is only meaningful "when linking
object file formats which do not support arbitrary sections, such as
ECOFF and XCOFF"[1] and is ignored for other object file formats.

LLVM's lld does not yet accept (and ignore) CONSTRUCTORS, so just remove
CONSTRUCTORS from the linker scripts as it has no effect.

[1] https://sourceware.org/binutils/docs/ld/Output-Section-Keywords.html

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7343
2016-07-28 13:54:46 +00:00
Andrew Turner
979d76c948 Remove STARTUP_PAGETABLE_ADDR from the ARM configs and replace it with
memory at the end of the kernel.

This helps reduce the SoC and board specific configuration required.

Reviewed by:	bsdimp
Tested by:	jmg (armeb), br
2014-01-28 09:12:04 +00:00
Andrew Turner
67727fbfce Correctly align the unwind tables. Without this clang may incorrectly align
them causing an alignment fault when producing a backtrace.
2013-03-10 00:47:19 +00:00
Andrew Turner
b56c0c673a When DDB is enabled and we are building for the ARM EABI include the unwind
tables in the kernel.
2013-01-19 22:08:16 +00:00
Oleksandr Tymoshenko
e38aad0ed9 Get rid of ARM_BIG_ENDIAN for good:
- remove leftovers in Makefile.arm
  - Let ld use default output format instead of providing one in ldscript
2012-08-21 23:44:47 +00:00
Olivier Houchard
f5a9ac9ca4 Create a non-elf pure binary version of the kernel as well. 2005-11-24 02:25:49 +00:00
Olivier Houchard
c60e48e2b6 Use the address provided in the conf file, instead of hardcode 0xc0000000. 2004-09-23 22:52:55 +00:00
Olivier Houchard
78b36e3ca5 Add config magic for arm. 2004-05-14 11:49:40 +00:00