HomeFreeBSD

crunchgen: remove -dc from linker invocation

Description

crunchgen: remove -dc from linker invocation

In GNU ld and ld.lld, -dc is used with -r to allocate space to COMMON
symbols. It is presumably to work around legacy code which cannot
handle COMMON symbols in relocatable output. ld.lld may remove -dc or
make it a no-op for the 15.0.0 release.

As of 7420b323a014 crunch/crunchide does not require -dc, as the symbol
hiding technique no longer relied on making symbols local.

In addition -fno-common is now the default in Clang and GCC, so -dc
serves no purpose as the compiler does not generate COMMON symbols
anyway.

See https://maskray.me/blog/2022-02-06-all-about-common-symbols for more
detail on common symbols.

Reviewed by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D34215

(cherry picked from commit ec81497cc7260b26c2af615c54aa80f515d6c539)

Details

Provenance
fbsd-phab_maskray.meAuthored on Feb 9 2022, 12:59 AM
emasteCommitted on Feb 17 2022, 1:03 AM
Reviewer
emaste
Differential Revision
D34215: crunchgen: remove -Wl,-dc
Parents
rG1fa9903bee3b: vt.4: clarify that a KMS driver switches to graphics mode
Branches
Unknown
Tags
Unknown