[PATCH] D86909: [lld-macho] Initial support for common symbols

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 4 15:13:39 PDT 2020


MaskRay added inline comments.


================
Comment at: lld/MachO/SymbolTable.cpp:85
+    if (auto *common = dyn_cast<CommonSymbol>(s)) {
+      if (size >= common->size) {
+        common->file = file;
----------------
int3 wrote:
> int3 wrote:
> > int3 wrote:
> > > MaskRay wrote:
> > > > This is strange. Is it `>`?
> > > This is intentional. The `same-size.s` test verifies this behavior, and can be used to check that ld64 does the same thing.
> > actually, I may have messed up the test...
> okay fixed. ld64 actually takes the smaller alignment if the sizes are equal. still different from lld-ELF's behavior though...
This rule is hard to believe...

A larger alignment imposes a larger requirement. Shouldn't the larger alignment be used?

In ELF, size and align are separately considered.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86909/new/

https://reviews.llvm.org/D86909



More information about the llvm-commits mailing list