HomeFreeBSD

csu: Find the main pointer through the GOT

Description

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

Details

Provenance
andrewAuthored on Wed, May 22, 8:18 AM
Reviewer
jrtc27
Differential Revision
D45259: csu: Find the main pointer through the GOT
Parents
rG8e82c5e28db6: stand/kboot: Fix the linker script OUTPUT_FORMAT
Branches
Unknown
Tags
Unknown