llvm-project/lld/test
Fangrui Song ce45c95694 [ELF] Remove obscure -dp and GNU ld incompatible --[no-]define-common, ignore -d/-dc
https://maskray.me/blog/2022-02-06-all-about-common-symbols#no-define-common

In GNU ld, -dc only affects -r links and causes COMMON symbols to be allocated.
--no-define-common is defined to make COMMON symbols undefined for -shared.
AIUI --no-define-common is a workaround around glibc 2.1 time and not really useful.

gold confuses --define-common with -d/FORCE_COMMON_ALLOCATION and implements
--define-common with -d semantics. Its --no-define-common is incompatible with
GNU ld.

In ld.lld, b2a23cf3c0 fixed the default -r
behavior for COMMON symbols but ported the incompatible gold
--[no-]define-common. To the best of my knowledge, no project uses -dp
--[no-]define-common. So just remove these options.

-d/-dc are used by the following projects:

* grub grub-core/genmod.sh.in uses -Wl,-r,-d (https://lists.gnu.org/archive/html/grub-devel/2022-02/msg00088.html)
* FreeBSD crunchgen uses -Wl,-dc (https://reviews.freebsd.org/D34215)

A no-op implementation works for them. Only when a program inspects relocatable
output by itself and does not recognize COMMON symbols, there may be a problem.
This is an extremely unlikely case.

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D119108
2022-02-09 10:35:53 -08:00
..
COFF Re-land [CodeView] Add full repro to LF_BUILDINFO record 2022-01-19 19:44:37 -05:00
ELF [ELF] Remove obscure -dp and GNU ld incompatible --[no-]define-common, ignore -d/-dc 2022-02-09 10:35:53 -08:00
MachO [lld-macho] Include address offsets in error messages 2022-02-07 21:06:18 -05:00
MinGW [LLD][MinGW] Add --heap argument support 2022-01-30 00:01:45 +02:00
Unit Support multi-configuration generators correctly in several config files 2021-02-11 09:32:20 -08:00
wasm [lld][WebAssembly] Handle TLS symbols in older object file 2022-01-27 17:27:09 -08:00
CMakeLists.txt [lld/test] List one test dep per line 2021-12-17 09:51:01 -05:00
lit.cfg.py [lld/tests] Stop setting the "asserts" and "debug" features 2022-01-05 13:39:17 -05:00
lit.site.cfg.py.in Fix lld macho standalone build by including llvm/Config/llvm-config.h instead of llvm/Config/config.h 2021-05-19 11:15:07 -04:00