[lld] d5c0b9c - [lld-macho][nfc] Expand the compact unwind symbol reloc test

Jez Ng via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 10 21:35:13 PDT 2021


Author: Jez Ng
Date: 2021-07-11T00:35:05-04:00
New Revision: d5c0b9c84886aea65d7148f403b08799bec9186e

URL: https://github.com/llvm/llvm-project/commit/d5c0b9c84886aea65d7148f403b08799bec9186e
DIFF: https://github.com/llvm/llvm-project/commit/d5c0b9c84886aea65d7148f403b08799bec9186e.diff

LOG: [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.

Added: 
    lld/test/MachO/compact-unwind-sym-relocs.s

Modified: 
    

Removed: 
    lld/test/MachO/relocs-syms-not-in-got.s


################################################################################
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 20a08152b36e9..e87c3330841a4 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:


        


More information about the llvm-commits mailing list