From d5c0b9c84886aea65d7148f403b08799bec9186e Mon Sep 17 00:00:00 2001 From: Jez Ng Date: Sun, 11 Jul 2021 00:19:03 -0400 Subject: [PATCH] [lld-macho][nfc] Expand the compact unwind symbol reloc test Add a bit more detail to the comments, and check that the final binary does indeed have a `__unwind_info` section (D105557 previosly regressed this). Also rename the test to emphasize that we are testing relocations compact unwind, not relocations in general. --- .../{relocs-syms-not-in-got.s => compact-unwind-sym-relocs.s} | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) rename lld/test/MachO/{relocs-syms-not-in-got.s => compact-unwind-sym-relocs.s} (87%) diff --git a/lld/test/MachO/relocs-syms-not-in-got.s b/lld/test/MachO/compact-unwind-sym-relocs.s similarity index 87% rename from lld/test/MachO/relocs-syms-not-in-got.s rename to lld/test/MachO/compact-unwind-sym-relocs.s index 20a0815..e87c333 100644 --- a/lld/test/MachO/relocs-syms-not-in-got.s +++ b/lld/test/MachO/compact-unwind-sym-relocs.s @@ -1,5 +1,11 @@ # REQUIRES: x86 -## These yaml files were from an object file produced with 'ld -r', specifically: + +## Test that we correctly handle symbol relocations in the compact unwind +## section. + +## llvm-mc does not emit such relocations for compact unwind, but `ld -r` does. +## As such, these yaml files were from an object file produced with 'ld -r', +## specifically: ## ## // foo.s ## .text @@ -13,10 +19,11 @@ ## llvm-mc -filetype=obj -triple=x86_64-apple-macos10.15 -o foo1.o foo.s ## ld -r -o foo.o foo1.o - # RUN: rm -rf %t; mkdir -p %t # RUN: yaml2obj %s -o %t/foo.o # RUN: %lld -o %t/a.out %t/foo.o +# RUN: llvm-objdump --macho --section-headers %t/a.out | FileCheck %s +# CHECK: __unwind_info {{.*}} DATA --- !mach-o FileHeader: -- 2.7.4