1 # REQUIRES: x86, aarch64
2 # RUN: rm -rf %t; split-file %s %t
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/x86_64.o
4 # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/test.s -o %t/arm64.o
5 # RUN: %lld -lSystem %t/x86_64.o -o %t/x86_64 -order_file %t/order-file
6 # RUN: llvm-objdump --syms --full-contents --rebase %t/x86_64 | FileCheck %s
7 # RUN: %lld -arch arm64 -lSystem %t/arm64.o -o %t/arm64 -order_file %t/order-file
8 # RUN: llvm-objdump --syms --full-contents --rebase %t/arm64 | FileCheck %s
10 # CHECK-LABEL: SYMBOL TABLE:
11 # CHECK: {{0*}}[[#%x, SUB1ADDR:]] l {{.*}} __DATA,bar _sub1
12 # CHECK: {{0*}}[[#%x, SUB2ADDR:]] l {{.*}} __DATA,bar _sub2
13 # CHECK: {{0*}}[[#%x, SUB3ADDR:]] l {{.*}} __DATA,bar _sub3
14 # CHECK: {{0*}}[[#%x, SUB4ADDR:]] l {{.*}} __DATA,bar _sub4
15 # CHECK: {{0*}}[[#%x, SUB5ADDR:]] l {{.*}} __DATA,bar _sub5
16 # CHECK-LABEL: Contents of section __DATA,bar:
17 # CHECK: [[#SUB1ADDR]] 10000000
18 # CHECK-NEXT: [[#SUB2ADDR]] f2ffffff
19 # CHECK-NEXT: [[#SUB3ADDR]] 14000000 00000000
20 # CHECK-NEXT: [[#SUB4ADDR]] f6ffffff ffffffff
21 # CHECK-NEXT: [[#SUB5ADDR]] f1ffffff ffffffff
22 # CHECK: Rebase table:
23 # CHECK-NEXT: segment section address type
28 .globl _main, _subtrahend_1, _subtrahend_2, _minuend1, _minuend2
37 .long _minuend_1 - _subtrahend_1
40 .long _minuend_2 - _subtrahend_2 + 2
43 .quad _minuend_1 - _subtrahend_1 + 4
46 .quad _minuend_2 - _subtrahend_2 + 6
49 .quad L_.minuend - _subtrahend_1 + 1
66 .subsections_via_symbols
69 ## Reorder the symbols to make sure that the addends are being associated with
70 ## the minuend (and not the subtrahend) relocation.