75 lines · plain
1# REQUIRES: x86, aarch642# RUN: rm -rf %t; split-file %s %t3# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/x86_64.o4# RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/test.s -o %t/arm64.o5# RUN: %lld -lSystem %t/x86_64.o -o %t/x86_64 -order_file %t/order-file6# RUN: llvm-objdump --syms --full-contents --rebase %t/x86_64 | FileCheck %s7# RUN: %lld -arch arm64 -lSystem %t/arm64.o -o %t/arm64 -order_file %t/order-file8# RUN: llvm-objdump --syms --full-contents --rebase %t/arm64 | FileCheck %s9 10# CHECK-LABEL: SYMBOL TABLE:11# CHECK: {{0*}}[[#%x, SUB1ADDR:]] l {{.*}} __DATA,bar _sub112# CHECK: {{0*}}[[#%x, SUB2ADDR:]] l {{.*}} __DATA,bar _sub213# CHECK: {{0*}}[[#%x, SUB3ADDR:]] l {{.*}} __DATA,bar _sub314# CHECK: {{0*}}[[#%x, SUB4ADDR:]] l {{.*}} __DATA,bar _sub415# CHECK: {{0*}}[[#%x, SUB5ADDR:]] l {{.*}} __DATA,bar _sub516# CHECK-LABEL: Contents of section __DATA,bar:17# CHECK: [[#SUB1ADDR]] 1000000018# CHECK-NEXT: [[#SUB2ADDR]] f2ffffff19# CHECK-NEXT: [[#SUB3ADDR]] 14000000 0000000020# CHECK-NEXT: [[#SUB4ADDR]] f6ffffff ffffffff21# CHECK-NEXT: [[#SUB5ADDR]] f1ffffff ffffffff22# CHECK: Rebase table:23# CHECK-NEXT: segment section address type24# CHECK-EMPTY:25 26#--- test.s27 28.globl _main, _subtrahend_1, _subtrahend_2, _minuend1, _minuend229 30.section __DATA,foo31 .space 1632L_.minuend:33 .space 1634 35.section __DATA,bar36_sub1:37 .long _minuend_1 - _subtrahend_138 .space 1239_sub2:40 .long _minuend_2 - _subtrahend_2 + 241 .space 1242_sub3:43 .quad _minuend_1 - _subtrahend_1 + 444 .space 845_sub4:46 .quad _minuend_2 - _subtrahend_2 + 647 .space 848_sub5:49 .quad L_.minuend - _subtrahend_1 + 150 .space 851 52_minuend_1:53 .space 1654_minuend_2:55 .space 1656_subtrahend_1:57 .space 1658_subtrahend_2:59 .space 1660 61.text62.p2align 263_main:64 ret65 66.subsections_via_symbols67 68#--- order-file69## Reorder the symbols to make sure that the addends are being associated with70## the minuend (and not the subtrahend) relocation.71_subtrahend_172_minuend_173_minuend_274_subtrahend_275