[PATCH] D78946: [llvm-objcopy][MachO] Handle relocations where r_extern is 0

Alexander Shaposhnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 27 10:12:03 PDT 2020


alexshap created this revision.
alexshap added reviewers: seiya, jhenderson, MaskRay, smeenai.
Herald added a reviewer: rupprecht.
Herald added a subscriber: abrachet.
Herald added a project: LLVM.

Fix handling of relocations with r_extern == 0.
If r_extern == 0 then r_symbolnum is an index of a section rather than a symbol index.

This diff is essentially an updated version of https://reviews.llvm.org/D71647 by @seiya, 
the code has been slightly refactored, the test has been converted to YAML.
This change depends on https://reviews.llvm.org/D78898.

Test plan: make check-all


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78946

Files:
  llvm/test/tools/llvm-objcopy/MachO/relocations.test
  llvm/tools/llvm-objcopy/MachO/MachOReader.cpp
  llvm/tools/llvm-objcopy/MachO/MachOWriter.cpp
  llvm/tools/llvm-objcopy/MachO/Object.cpp
  llvm/tools/llvm-objcopy/MachO/Object.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78946.260363.patch
Type: text/x-patch
Size: 8205 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200427/4fb8de04/attachment.bin>


More information about the llvm-commits mailing list