]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/mips-got-page.s
Vendor import of lld trunk r290819:
[FreeBSD/FreeBSD.git] / test / ELF / mips-got-page.s
1 # Check the case when small section (less that 0x10000 bytes) occupies
2 # two adjacent 0xffff-bytes pages. We need to create two GOT entries
3 # for R_MIPS_GOT_PAGE relocations.
4
5 # RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux -o %t.o %s
6 # RUN: ld.lld --section-start .rodata=0x27FFC -shared -o %t.so %t.o
7 # RUN: llvm-readobj -t -mips-plt-got %t.so | FileCheck %s
8
9 # REQUIRES: mips
10
11 # CHECK:       Name: bar
12 # CHECK-NEXT:  Value: 0x28000
13 #                     ^ page-address = (0x28000 + 0x8000) & ~0xffff = 0x30000
14
15 # CHECK:       Name: foo
16 # CHECK-NEXT:  Value: 0x27FFC
17 #                     ^ page-address = (0x27ffc + 0x8000) & ~0xffff = 0x20000
18
19 # CHECK:      Local entries [
20 # CHECK-NEXT:   Entry {
21 # CHECK-NEXT:     Address:
22 # CHECK-NEXT:     Access: -32736
23 # CHECK-NEXT:     Initial: 0x20000
24 # CHECK-NEXT:   }
25 # CHECK-NEXT:   Entry {
26 # CHECK-NEXT:     Address:
27 # CHECK-NEXT:     Access: -32728
28 # CHECK-NEXT:     Initial: 0x30000
29 # CHECK-NEXT:   }
30 # CHECK-NEXT: ]
31
32   .text
33   ld      $v0,%got_page(foo)($gp)
34   ld      $v0,%got_page(bar)($gp)
35
36   .rodata
37 foo:
38   .word 0
39 bar:
40   .word 0