Commit graph

11 commits

Author SHA1 Message Date
John Baldwin 4a3cf5f329 Stop #defining FREEBSD_ELF
This was originally used (along with FREEBSD_AOUT) to prefer the use
of ELF in various tools instead of a.out as part of the a.out to ELF
transition in the 3.x days.  The last use of it was removed from
<link.h> in commit 66422f5b7a back in
2002, but various files still #define it.

Reviewed by:	kevans, imp, emaste
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D42964
2023-12-12 15:30:00 -08:00
Warner Losh 7c43148a97 stand: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by:		Netflix
2023-11-26 22:24:00 -07:00
Warner Losh 1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Warner Losh ce18e19394 stand: only compute symidx on x86
We only use symidx on x86, so only compute it on x86 to fix a set but
not used warning on aarch64.

Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D38246
2023-02-02 13:04:05 -07:00
Andrew Turner f6f0b849fb Reuse the amd64 loader relocation code on arm64
There is no need to keep multiple copies of the relocation code. The
amd64 code works on arm64 with a few small changes to relocation types.

Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D28213
2021-01-20 17:59:38 +00:00
Emmanuel Vadot 0f2434ea00 loader: Partial revert of 987eabdc2a
The arm relocation code doesn't not work and make loader not loading
dependancies.

Reported by:	Dr. Rolf Jansen <freebsd-rj@obsigna.com>
2021-01-17 17:41:25 +01:00
D Scott Phillips 987eabdc2a stand/reloc_elf: Handle relative relocations for arm{,64} and riscv
Extend the powerpc relative relocation handling from r240782 to a
handful of other architectures.  This is needed to properly read
dependency information from kernel modules.

Reviewed by:	jhb
Approved by:	scottl (implicit)
MFC after:	1 week
Sponsored by:	Ampere Computing, Inc.
Differential Revision:	https://reviews.freebsd.org/D26365
2020-09-21 22:24:46 +00:00
Brandon Bergren 892df83817 Remove sparc relocation support from reloc_elf.c.
It got missed in the sparc64 removal.
2020-05-01 16:47:54 +00:00
Konstantin Belousov 85f794e126 Skip IRELATIVE relocations when loader processes ELF files.
ifuncs can be only called in the (early boot) kernel environment, so
postpone resolving until early stage of the kernel boot.  This commit
is performed in advance to make loaders on most machines updated
before ifuncs appear in the kernels.

Reviewed by:	emaste, jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D13838
2018-01-11 13:57:30 +00:00
Warner Losh f38658e140 Prefer stdint.h to inttypes.h since the added prototypes form the
latter aren't used. Prefer sys/link_elf.h to link.h so we're only
dependent on the kernel tree. The default installation of link.h just
includes this file, and any benefit from that is outweighed by the
hassle it causes. This reduces the footprint of files needed from the
system includes (or sysroot in buildworld).

Sponsored by: Netflix
2017-12-05 21:38:04 +00:00
Warner Losh ca987d4641 Move sys/boot to stand. Fix all references to new location
Sponsored by:	Netflix
2017-11-14 23:02:19 +00:00
Renamed from sys/boot/common/reloc_elf.c (Browse further)