[PATCH] D106213: [lld-macho] Enable copy-on-write for input buffers

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 26 16:30:33 PDT 2021


int3 added a comment.

I am not able to get ld64 to dedup even the simplest of functions, let alone more complicated cases like these. Or perhaps I'm missing something in how ld64 is supposed to be invoked... this is what I've tried:

  (base) ~/tmp: cat test.s
  .text
  .weak_definition _foo
  .weak_definition _bar
  .weak_definition _baz
  
  _foo:
    ret
  
  _bar:
    ret
  
  _baz:
    ret
  
  .subsections_via_symbols
  
  (base) ~/tmp: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 test.s > test.o
  (base) ~/tmp: ld test.o -o test -dylib
  (base) ~/tmp: llvm-objdump -d test
  
  test:	file format mach-o 64-bit x86-64
  
  Disassembly of section __TEXT,__text:
  
  0000000000003fb5 <_foo>:
      3fb5: c3                           	retq
  
  0000000000003fb6 <_bar>:
      3fb6: c3                           	retq
  
  0000000000003fb7 <_baz>:
      3fb7: c3                           	retq


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106213



More information about the llvm-commits mailing list