From 1f44fee521c84f5917d323d15301ab27c358178e Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 10 May 2021 10:35:44 -0700 Subject: [PATCH] [lld-macho] Improve an external weak def test The rebase table entry is untested. Reviewed By: #lld-macho, int3 Differential Revision: https://reviews.llvm.org/D102150 --- lld/test/MachO/weak-binding.s | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lld/test/MachO/weak-binding.s b/lld/test/MachO/weak-binding.s index 0b66a18..73c8733 100644 --- a/lld/test/MachO/weak-binding.s +++ b/lld/test/MachO/weak-binding.s @@ -4,7 +4,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/libfoo.s -o %t/libfoo.o # RUN: %lld -dylib %t/libfoo.o -o %t/libfoo.dylib # RUN: %lld %t/test.o -L%t -lfoo -o %t/test -lSystem -# RUN: llvm-objdump -d --no-show-raw-insn --bind --lazy-bind --weak-bind --full-contents %t/test | \ +# RUN: llvm-objdump -d --no-show-raw-insn --rebase --bind --lazy-bind --weak-bind --full-contents %t/test | \ # RUN: FileCheck %s # CHECK: Contents of section __DATA_CONST,__got: @@ -29,6 +29,9 @@ # CHECK-NEXT: callq 0x{{[0-9a-f]*}} # CHECK-NEXT: callq 0x{{[0-9a-f]*}} +# CHECK-LABEL: Rebase table: +# CHECK: __DATA __la_symbol_ptr 0x[[#%x,WEAK_EXT_FN:]] pointer + # CHECK-LABEL: Bind table: # CHECK-DAG: __DATA_CONST __got 0x[[#WEAK_DY_GOT_ADDR]] pointer 0 libfoo _weak_dysym_for_gotpcrel # CHECK-DAG: __DATA __la_symbol_ptr 0x[[#%x,WEAK_DY_FN:]] pointer 0 libfoo _weak_dysym_fn @@ -50,7 +53,7 @@ # CHECK-DAG: __DATA __thread_ptrs 0x[[#WEAK_DY_TLV_ADDR]] pointer 0 _weak_dysym_tlv # CHECK-DAG: __DATA __data 0x{{[0-9a-f]*}} pointer 2 _weak_external # CHECK-DAG: __DATA __la_symbol_ptr 0x[[#WEAK_DY_FN]] pointer 0 _weak_dysym_fn -# CHECK-DAG: __DATA __la_symbol_ptr 0x{{[0-9a-f]*}} pointer 0 _weak_external_fn +# CHECK-DAG: __DATA __la_symbol_ptr 0x[[#WEAK_EXT_FN]] pointer 0 _weak_external_fn ## Check that we don't have any other bindings # CHECK-NOT: pointer -- 2.7.4