opnsense-src/lib/csu
Andrew Turner 71f04a3609 csu: Find the main pointer through the GOT
Use the Global Offset Table to find the location of main in crt1. With
lld the old code would point to main@plt, however ld.bfd fails to link
when main is in a shared library.

Fix this by using the GOT address to find main as it works with both
lld and bfd.

Reviewed by:	jrtc27
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45259

(cherry picked from commit 53120fbb68952b7d620c2c0e1cf05c5017fc1b27)
2024-07-15 12:26:22 +00:00
..
aarch64 csu: Find the main pointer through the GOT 2024-07-15 12:26:22 +00:00
amd64 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
arm Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
common csu: Teach csu about PAC and BTI 2024-02-19 13:12:08 +00:00
i386 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
powerpc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
powerpc64 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
riscv dirdeps: Add missing dependency files 2024-04-15 20:32:03 -06:00
tests Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.inc csu: add crtbrand.o dependency on sys/param.h 2024-02-14 12:15:14 -05:00