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

Details

Provenance
fbsd-phab_maskray.meAuthored on Feb 9 2022, 12:59 AM
emasteCommitted on Feb 9 2022, 6:54 PM
Reviewer
emaste
Differential Revision
D34215: crunchgen: remove -Wl,-dc
Parents
rGd73d40c17f89: usr.sbin: add tcpsso to Makefile
Branches
Unknown
Tags
Unknown