llvm-project/llvm/test/tools/llvm-objcopy/MachO/real-world-input-copy.test
Seiya Nuta b728e53b95 [llvm-objcopy][MachO] Recompute and update offset/size fields in the writer
Summary:
Recompute and update offset/size fields so that we can implement llvm-objcopy options like --only-section.

This patch is the first step and focuses on supporting load commands that covered by existing tests: executable files and
dynamic libraries are not supported.

Reviewers: alexshap, rupprecht, jhenderson

Reviewed By: alexshap, rupprecht

Subscribers: compnerd, jakehehrlich, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62652

llvm-svn: 362863
2019-06-08 01:22:54 +00:00

16 lines
740 B
Plaintext

# RUN: llvm-mc -assemble -triple i386-apple-darwin9 -filetype=obj %p/Inputs/macho.32.s -o %t.32.o
# RUN: llvm-objcopy %t.32.o %t.32.copy.o
# RUN: cmp %t.32.o %t.32.copy.o
# RUN: llvm-mc -assemble -triple x86_64-apple-darwin9 -filetype=obj %p/Inputs/macho.64.s -o %t.64.o
# RUN: llvm-objcopy %t.64.o %t.64.copy.o
# RUN: cmp %t.64.o %t.64.copy.o
# Make sure that it properly constructs LC_DYSYMTAB and handles virtual sections
# (the bss section for example).
# RUN: llvm-mc -assemble -triple x86_64-apple-darwin9 -filetype=obj %p/Inputs/various-symbols.s -o %t.various-symbols.o
# RUN: llvm-objcopy %t.various-symbols.o %t.various-symbols.copy.o
# RUN: cmp %t.various-symbols.o %t.various-symbols.copy.o
# REQUIRES: x86-registered-target