[PATCH] D114737: [lld][Macho] Include dead-stripped symbols in mapfile

Roger Kim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 1 18:04:43 PST 2022


Roger created this revision.
Roger added a reviewer: int3.
Herald added a project: lld-macho.
Herald added a reviewer: lld-macho.
Roger updated this revision to Diff 394932.
Roger added a comment.
Roger updated this revision to Diff 394956.
Roger updated this revision to Diff 395005.
Roger updated this revision to Diff 396050.
Roger edited the summary of this revision.
Herald added a subscriber: pengfei.
Roger updated this revision to Diff 396899.
Roger edited the summary of this revision.
Roger edited the summary of this revision.
Roger updated this revision to Diff 396905.
Roger retitled this revision from "[lld][Macho] Provide option to print dead-stripped symbols." to "[lld][Macho] Include dead-stripped symbols in mapfile".
Roger edited the summary of this revision.
Roger published this revision for review.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Small fixes.


Roger added a comment.

small fix.


Roger added a comment.

Compilation fix.


Roger added a comment.

test passes


Roger added a comment.

Update.


Roger added a comment.

Update


Roger added a comment.

I expect this will need some advice but I think it's ready for its initial review.


ld64 outputs dead stripped symbols when using the -dead-strip flag. This change mimics that behavior for lld.

ld64's -dead_strip flag outputs:

  $ ld -map map test.o foo.o -o out -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lSystem
  $ cat map
  # Path: out
  # Arch: x86_64
  # Object files:
  [  0] linker synthesized
  [  1] test.o
  [  2] foo.o
  # Sections:
  # Address       Size            Segment Section
  0x100003FB7     0x00000001      __TEXT  __text
  0x100003FB8     0x00000000      __TEXT  obj
  0x100003FB8     0x00000048      __TEXT  __unwind_info
  # Symbols:
  # Address       Size            File  Name
  0x100003FB7     0x00000001      [  1] _main
  0x100003FB8     0x00000000      [  2] _foo
  0x100003FB8     0x00000048      [  0] compact unwind info
  
  # Dead Stripped Symbols:
  #               Size            File  Name
  <<dead>>        0x00000001      [  1] _number


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D114737

Files:
  lld/MachO/MapFile.cpp
  lld/test/MachO/dead-strip.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114737.396905.patch
Type: text/x-patch
Size: 3915 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220102/a043e82b/attachment.bin>


More information about the llvm-commits mailing list