[PATCH] D119108: [ELF] Clarify -dc and remove GNU ld incompatible --[no-]define-common

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 6 23:25:18 PST 2022


MaskRay created this revision.
MaskRay added reviewers: ikudrin, peter.smith.
Herald added subscribers: dang, arichardson, emaste.
MaskRay requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.

gold confuses --no-define-common with FORCE_COMMON_ALLOCATION and additionally
defines --define-common. ld.lld follows the gold behavior. To the best of my
knowledge, no project uses --[no-]define-common. So just remove
--[no-]define-common.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119108

Files:
  lld/ELF/Config.h
  lld/ELF/Driver.cpp
  lld/ELF/Options.td
  lld/ELF/SyntheticSections.cpp
  lld/docs/ld.lld.1
  lld/test/ELF/common.s
  lld/test/ELF/relocatable-common.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119108.406329.patch
Type: text/x-patch
Size: 6771 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220207/d6e30971/attachment-0001.bin>


More information about the llvm-commits mailing list