[lld] 1f44fee - [lld-macho] Improve an external weak def test

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon May 10 10:35:49 PDT 2021


Author: Fangrui Song
Date: 2021-05-10T10:35:44-07:00
New Revision: 1f44fee521c84f5917d323d15301ab27c358178e

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

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

Added: 
    

Modified: 
    lld/test/MachO/weak-binding.s

Removed: 
    


################################################################################
diff  --git a/lld/test/MachO/weak-binding.s b/lld/test/MachO/weak-binding.s
index 0b66a18c212f..73c873360997 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
 


        


More information about the llvm-commits mailing list