OPNsense - FreeBSD source
Find a file
John Baldwin 0299afdff1 kldxref: Make use of libelf to be a portable cross tool
This allows kldxref to operate on kernel objects from any
architecture, not just the native architecture.  In particular, this
will permit generating linker.hints files as part of a cross-arch
release build.

- elf.c is a new file that includes various wrappers around libelf
  including routines to read ELF data structures such as program and
  section headers and ELF relocations into the "generic" forms
  described in <gelf.h>.  This file also provides routines for
  converting a linker set into an array of addresses (GElf_Addr)
  as well as reading architecture-specific mod_* structures and
  converting them into "generic" Gmod_* forms where pointers are
  replaced with addresses.

- The various architecture-specific reloc handlers now use GElf_*
  types for most values (including GElf_Rel and GElf_Rela for
  relocation structures) and use routines from <sys/endian.h> to read
  and write target values.  A new linker set matches reloc handlers
  to specific ELF (class, encoding, machine) tuples.

- The bits of kldxref.c that write out linker.hints now use the
  encoding (ELFDATA2[LM]SB) of the first file encountered in a
  directory to set the endianness of the output file.  Input files
  with a different architecture in the same directory are skipped with
  a warning.  In addition, the initial version record for the file
  must be deferred until the first record is finished since the
  architecture of the output file is not known until then.

- Various places that used 'sizeof(void *)' throughout now use
  'elf_pointer_size()' to determine the size of a pointer in the
  target architecture.

Tested by:	amd64 binary on both amd64 and i386 /boot/kernel
Reviewed by:	imp
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D42966
2023-12-12 15:43:00 -08:00
.cirrus-ci Cirrus-CI: add some timing info on pkg install failure 2021-08-04 15:02:00 -04:00
.github MAINTAINERS: Add myself to stand 2023-05-07 22:30:10 -06:00
bin cp: Don't warn for chflags() failing with EOPNOTSUPP if flags == 0 2023-12-07 13:36:44 -07:00
cddl libc: expose execvpe for Linux compat 2023-12-11 19:24:53 +00:00
contrib mandoc: fix bootstrapping on Linux with Clang 16 2023-12-11 21:14:56 -08:00
crypto OpenSSL: update to 3.0.12 2023-10-24 14:55:56 -04:00
etc Merge llvm-project main llvmorg-17-init-19304-gd0b54bb50e51 2023-12-08 18:34:50 +01:00
gnu misc: Remove ancient SCCS tags. 2023-11-26 22:23:27 -07:00
include libc: expose execvpe for Linux compat 2023-12-11 19:24:53 +00:00
kerberos5 sccs: Manual changes 2023-11-26 22:23:58 -07:00
lib libc/i386/SYS.h: Remove unused LCALL macro 2023-12-12 22:53:09 +00:00
libexec Stop #defining FREEBSD_ELF 2023-12-12 15:30:00 -08:00
release pkgbase: propagate SRCRELDATE to the packages correctly 2023-12-04 22:27:57 +01:00
rescue misc: Remove ancient SCCS tags. 2023-11-26 22:23:27 -07:00
sbin camcontrol: One file per line in Makefile 2023-12-07 13:21:57 -07:00
secure ossl: Move arm_arch.h to a common subdirectory 2023-12-04 12:29:11 -05:00
share cam.4: Modernize examples 2023-12-11 22:12:13 -07:00
stand Stop #defining FREEBSD_ELF 2023-12-12 15:30:00 -08:00
sys netlink: fix snl_writer and linear_buffer re-allocation logic 2023-12-12 21:49:14 +01:00
targets Merge llvm-project main llvmorg-17-init-19304-gd0b54bb50e51 2023-12-08 18:34:50 +01:00
tests pf tests: test that we validate sequence numbers on TCP RST 2023-12-05 21:03:49 +01:00
tools stress2: Only extract the allocation with the exact name "pts" 2023-12-10 09:34:38 +01:00
usr.bin look(1): Correct the example's description 2023-12-12 02:19:21 +08:00
usr.sbin kldxref: Make use of libelf to be a portable cross tool 2023-12-12 15:43:00 -08:00
.arcconfig arcanist: use FreeBSD/git project repository instead of FreeBSD/svn 2022-08-23 14:16:41 +00:00
.arclint arc lint: ignore /tests/ in chmod 2017-12-19 03:38:06 +00:00
.cirrus.yml Cirrus-CI: Use HTTPS to fetch pkg 2023-12-09 10:12:04 -05:00
.clang-format Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
.git-blame-ignore-revs git-blame-ignore-revs: OptionalObsoleteFiles.inc sorting commits 2023-11-15 17:47:02 +00:00
.gitattributes Revert "awk: Merge upstream 2nd Edition Awk Book" 2023-11-15 15:28:05 -07:00
.gitignore .gitignore: Ignore LSP generated .cache 2023-03-07 10:04:18 -05:00
.mailmap Fix Sumit's email address 2023-10-19 15:49:05 -06:00
CONTRIBUTING.md CONTRIBUTING.md: add author identity info 2023-09-20 19:28:28 -04:00
COPYRIGHT misc: Remove ancient SCCS tags. 2023-11-26 22:23:27 -07:00
LOCKS Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:20 -06:00
MAINTAINERS Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:20 -06:00
Makefile pkgbase: create source package 2023-12-04 09:05:03 +01:00
Makefile.inc1 pkgbase: pass --recurse-submodules to git ls-files 2023-12-09 11:10:01 -05:00
Makefile.libcompat build{libcompat}: Pass UNIVERSE_TOOLCHAIN_PATH to the _lc_build-tools submake 2023-08-21 21:00:45 -07:00
Makefile.sys.inc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
ObsoleteFiles.inc ObsoleteFiles.inc: remove old libufs.so.7 after bump 2023-12-08 22:23:00 +01:00
README.md ota: Import One True Awk from 20231102 (254b979f32df) 2023-11-02 10:20:09 -06:00
RELNOTES RELNOTES: Add an entry about bhyve's slirp backend 2023-11-22 15:19:10 -05:00
UPDATING UPDATING: Add unset hint.acpi.0.disabled as workaround for no ACPI 2023-11-22 21:12:28 -07:00

FreeBSD Source:

This is the top level of the FreeBSD source directory.

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms. A large community has continually developed it for more than thirty years. Its advanced networking, security, and storage features have made FreeBSD the platform of choice for many of the busiest web sites and most pervasive embedded networking and storage devices.

For copyright information, please see the file COPYRIGHT in this directory. Additional copyright information also exists for some sources in this tree - please see the specific source directories for more information.

The Makefile in this directory supports a number of targets for building components (or all) of the FreeBSD source tree. See build(7), config(8), FreeBSD handbook on building userland, and Handbook for kernels for more information, including setting make(1) variables.

For information on the CPU architectures and platforms supported by FreeBSD, see the FreeBSD website's Platforms page.

Source Roadmap:

Directory Description
bin System/user commands.
cddl Various commands and libraries under the Common Development and Distribution License.
contrib Packages contributed by 3rd parties.
crypto Cryptography stuff (see crypto/README).
etc Template files for /etc.
gnu Commands and libraries under the GNU General Public License (GPL) or Lesser General Public License (LGPL). Please see gnu/COPYING and gnu/COPYING.LIB for more information.
include System include files.
kerberos5 Kerberos5 (Heimdal) package.
lib System libraries.
libexec System daemons.
release Release building Makefile & associated tools.
rescue Build system for statically linked /rescue utilities.
sbin System commands.
secure Cryptographic libraries and commands.
share Shared resources.
stand Boot loader sources.
sys Kernel sources (see sys/README.md).
targets Support for experimental DIRDEPS_BUILD
tests Regression tests which can be run by Kyua. See tests/README for additional information.
tools Utilities for regression testing and miscellaneous tasks.
usr.bin User commands.
usr.sbin System administration commands.

For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see FreeBSD Handbook.