[PATCH] D104968: [llvm-objcopy][MachO] Support LINKER_OPTIMIZATION_HINT

Alexander Shaposhnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 27 00:36:25 PDT 2021


alexander-shaposhnikov added a comment.

Regarding tests:

`loh.s:`

  .text
  .align 2
  _test:
  L1:   adrp  x0, _foo at PAGE
  L2:   add   x0, x0, _foo at PAGEOFF
  .loh AdrpAdd L1, L2
  
  .data
  _foo: .long 0

`llvm-mc -filetype=obj -triple=arm64-apple-darwin loh.s -o loh.o`

`llvm-objdump --macho --link-opt-hints loh.o`
will print them.

Unfortunately, at the moment ObjectYAML doesn't support linker optimization hints (see MachOYAML.h, struct LinkEditData),
so ideally it'd be good to extend ObjectYAML (it should be similar to other things living inside LinkEdit),
alternatively, one can create a test using assembly & llvm-mc.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104968



More information about the llvm-commits mailing list