[PATCH] D71647: [llvm-objcopy][MachO] Handle relocation entries where r_extern is 0
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 20 00:02:28 PST 2019
MaskRay added inline comments.
================
Comment at: llvm/test/tools/llvm-objcopy/MachO/copy-relocations.s:4
+## Show that llvm-objcopy copies relocation entries where r_extern=0.
+# RUN: llvm-mc -assemble -triple x86_64-apple-darwin19 -filetype=obj %s -o %t
+# RUN: llvm-objcopy %t %t2
----------------
`-assemble` is the default action. Very few tests specify it. You can just delete it.
================
Comment at: llvm/test/tools/llvm-objcopy/MachO/copy-relocations.s:10
+# RUN: llvm-objcopy --remove-section=__DATA,__foo %t %t3
+# RUN: llvm-objdump --macho --reloc %t3 | FileCheck %s
+
----------------
Is `--macho` needed?
================
Comment at: llvm/tools/llvm-objcopy/MachO/MachOReader.cpp:220
+ else {
+ assert(Info->r_symbolnum <= Sections.size() &&
+ "Invalid section index.");
----------------
What if r_symbolnum = 0?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71647/new/
https://reviews.llvm.org/D71647
More information about the llvm-commits
mailing list