]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/got32-i386.s
Vendor import of lld trunk r338150:
[FreeBSD/FreeBSD.git] / test / ELF / got32-i386.s
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %s -o %t.o
3 # RUN: ld.lld %t.o -o %t
4 # RUN: llvm-objdump -section-headers -d %t | FileCheck %s
5
6 ## We have R_386_GOT32 relocation here.
7 .globl foo
8 .type foo, @function
9 foo:
10  nop
11
12 _start:
13  movl foo@GOT, %ebx
14
15 ## 73728 == 0x12000 == ADDR(.got)
16 # CHECK:       _start:
17 # CHECK-NEXT:   11001: 8b 1d {{.*}}  movl 73728, %ebx
18 # CHECK: Sections:
19 # CHECK:  Name Size     Address
20 # CHECK:  .got 00000004 0000000000012000
21
22 # RUN: not ld.lld %t.o -o %t -pie 2>&1 | FileCheck %s --check-prefix=ERR
23 # ERR: error: can't create dynamic relocation R_386_GOT32 against symbol: foo in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output