brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 9a1c6c7 Raw
45 lines · plain
1# REQUIRES: x862# RUN: split-file %s %t3# RUN: llvm-mc -filetype=obj -triple=x86_64 %t/a.s -o %t/a.o4# RUN: llvm-mc -filetype=obj -triple=x86_64 %t/b.s -o %t/b.o5# RUN: llvm-mc -filetype=obj -triple=x86_64 %t/c.s -o %t/c.o6# RUN: ld.lld -shared -soname=b -Ttext=0 %t/b.o -o %t/b.so7 8# RUN: ld.lld %t/a.o %t/b.so -o %t19# RUN: llvm-readelf -r -s %t1 | FileCheck %s10 11## In %t/b.so, foo has st_value==0 and its section alignment is 0x400. The12## alignment of the copy relocated foo is thus 0x400.13# CHECK: R_X86_64_COPY {{.*}} foo + 014# CHECK: 0000000000203400  4 OBJECT GLOBAL DEFAULT [[#]] foo15 16## Error if attempting to copy relocate a SHN_ABS symbol (even if st_size is non-zero).17# RUN: ld.lld -shared -soname=c %t/c.o -o %t/c.so18# RUN: llvm-readelf -s %t/c.so | FileCheck %s --check-prefix=ABSADDR19# RUN: not ld.lld %t/a.o %t/c.so -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR20 21# ABSADDR: 0000000000000000  4 OBJECT GLOBAL DEFAULT ABS foo22# ERR: error: cannot create a copy relocation for symbol foo23 24#--- a.s25.text26.globl _start27_start:28  movl $5, foo29 30#--- b.s31.data32.balign 0x40033.type foo,@object34.globl foo35foo:36  .long 037  .size foo, 438 39#--- c.s40.data41.globl foo42.type foo,@object43foo = 0x044.size foo, 445