[PATCH] D130725: [lld/mac] Add support for $ld$previous symbols with explicit symbol name

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 16:18:42 PDT 2022


thakis added a comment.

Note to future self: To test things I had `foo.tbd` containing:

  --- !tapi-tbd-v3
  archs:           [ x86_64 ]
  uuids:           [ 'x86_64: 19311019-01AB-342E-812B-73A74271A715' ]
  platform:        macosx
  install-name:    '/Old'
  current-version: 6
  compatibility-version: 1.1.1
  exports:
    - archs:           [ x86_64 ]
      symbols:         [
        '$ld$previous$/Another$$1$3.0$14.0$_zzz$',
        '$ld$previous$/New$1.2.3$1$3.0$14.0$_yyy$',
        _xxx,
        _yyy,
        _zzz,
     ]
  ...

and test.s containing

  .subsections_via_symbols
  
  .globl _main
  _main:
      call _xxx
      call _yyy
      call _zzz
      ret

and I'd uncomment the various call instructions, and run `out/gn/bin/clang test.s -isysroot $(xcrun -show-sdk-path) --target=x86_64-apple-macos foo.tbd` followed by `otool -L a.out`, and then add `-fuse-ld=lld` to the clang command, and replace `foo.tbd` with `-Wl,-needed_library,foo.tbd`, etc.


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

https://reviews.llvm.org/D130725



More information about the llvm-commits mailing list