File: arm-gotoff.s

package info (click to toggle)
swiftlang 6.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,791,604 kB
  • sloc: cpp: 9,901,740; ansic: 2,201,431; asm: 1,091,827; python: 308,252; objc: 82,166; f90: 80,126; lisp: 38,358; pascal: 25,559; sh: 20,429; ml: 5,058; perl: 4,745; makefile: 4,484; awk: 3,535; javascript: 3,018; xml: 918; fortran: 664; cs: 573; ruby: 396
file content (37 lines) | stat: -rw-r--r-- 1,461 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// REQUIRES: arm
// RUN: llvm-mc -filetype=obj -triple=armv7a-linux-gnueabi %s -o %t.o
// RUN: ld.lld -z separate-loadable-segments %t.o -o %t
// RUN: llvm-readelf -S -r --symbols %t | FileCheck %s
// RUN: llvm-objdump --triple=armv7a-linux-gnueabi -d --no-show-raw-insn %t | FileCheck --check-prefix=DISASM %s

// Test the R_ARM_GOTOFF32 relocation

// CHECK:      [Nr] Name              Type            Address  Off    Size   ES Flg Lk Inf Al
// CHECK-NEXT: [ 0]                   NULL            00000000 000000 000000 00      0   0  0
// CHECK-NEXT: [ 1] .text             PROGBITS        00020000 010000 000010 00  AX  0   0  4
// CHECK-NEXT: [ 2] .got              PROGBITS        00030000 020000 000000 00  WA  0   0  4
// CHECK-NEXT: [ 3] .relro_padding    NOBITS          00030000 020000 000000 00  WA  0   0  1
// CHECK-NEXT: [ 4] .bss              NOBITS          00030000 020000 000014 00  WA  0   0  1

// CHECK:      00030000    10 OBJECT  GLOBAL DEFAULT    4 bar
// CHECK-NEXT: 0003000a    10 OBJECT  GLOBAL DEFAULT    4 obj

// DISASM:      <_start>:
// DISASM-NEXT:   bx lr
// Offset 0 from .got = bar
// DISASM:        .word 0x00000000
// Offset 10 from .got = obj
// DISASM-NEXT:   .word 0x0000000a
// Offset 15 from .got = obj +5
// DISASM-NEXT:   .word 0x0000000f
 .syntax unified
 .globl _start
_start:
 bx lr
 .word bar(GOTOFF)
 .word obj(GOTOFF)
 .word obj(GOTOFF)+5
 .type bar, %object
 .comm bar, 10
 .type obj, %object
 .comm obj, 10