brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.5 KiB · 1089502 Raw
112 lines · plain
1// REQUIRES: arm2// RUN: rm -rf %t && split-file %s %t3// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv4-none-linux-gnueabi %t/a.s -o %t/a.o4// RUN: ld.lld %t/a.o --script %t/far.lds -o %t/a-far5// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn --triple=armv4-none-linux-gnueabi %t/a-far | FileCheck %s --check-prefixes=FAR6// RUN: ld.lld %t/a.o --script %t/near.lds -o %t/a-near7// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn --triple=armv4-none-linux-gnueabi %t/a-near | FileCheck %s --check-prefixes=NEAR8// RUN: ld.lld %t/a.o -pie --script %t/far.lds -o %t/a-far-pie9// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn --triple=armv4-none-linux-gnueabi %t/a-far-pie | FileCheck %s --check-prefixes=FAR-PIE10// RUN: ld.lld %t/a.o -pie --script %t/near.lds -o %t/a-near-pie11// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn --triple=armv4-none-linux-gnueabi %t/a-near-pie | FileCheck %s --check-prefixes=NEAR12 13// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv4eb-none-linux-gnueabi %t/a.s -o %t/a.o14// RUN: ld.lld %t/a.o --script %t/far.lds -o %t/a-far15// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn --triple=armv4eb-none-linux-gnueabi %t/a-far | FileCheck %s --check-prefixes=FAR-EB16// RUN: ld.lld %t/a.o --script %t/near.lds -o %t/a-near17// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn --triple=armv4eb-none-linux-gnueabi %t/a-near | FileCheck %s --check-prefixes=NEAR18// RUN: ld.lld %t/a.o -pie --script %t/far.lds -o %t/a-far-pie19// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn --triple=armv4eb-none-linux-gnueabi %t/a-far-pie | FileCheck %s --check-prefixes=FAR-EB-PIE20// RUN: ld.lld %t/a.o -pie --script %t/near.lds -o %t/a-near-pie21// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn --triple=armv4eb-none-linux-gnueabi %t/a-near-pie | FileCheck %s --check-prefixes=NEAR22 23/// On Armv4 there is no blx instruction so long branch/exchange looks slightly24/// different.25 26//--- a.s27 .text28 .syntax unified29 .cpu    arm7tdmi30 31 .section .low, "ax", %progbits32 .arm33 .globl _start34 .type   _start,%function35 .p2align       236_start:37  bl target38  mov pc, lr39 40// FAR-LABEL: <_start>:41// FAR-NEXT:   1000000:      	bl	0x1000008 <__ARMv5LongLdrPcThunk_target> @ imm = #042// FAR-NEXT:                	mov pc, lr43// FAR-EMPTY:44// FAR-NEXT:  <__ARMv5LongLdrPcThunk_target>:45// FAR-NEXT:   1000008:      	ldr	pc, [pc, #-4]           @ 0x100000c <__ARMv5LongLdrPcThunk_target+0x4>46// FAR-NEXT:   100000c: 00 00 00 06  	.word	0x0600000047 48// FAR-EB-LABEL: <_start>:49// FAR-EB-NEXT:   1000000:      	bl	0x1000008 <__ARMv5LongLdrPcThunk_target> @ imm = #050// FAR-EB-NEXT:                	mov pc, lr51// FAR-EB-EMPTY:52// FAR-EB-NEXT:  <__ARMv5LongLdrPcThunk_target>:53// FAR-EB-NEXT:   1000008:      	ldr	pc, [pc, #-4]           @ 0x100000c <__ARMv5LongLdrPcThunk_target+0x4>54// FAR-EB-NEXT:   100000c: 06 00 00 00  	.word	0x0600000055 56// FAR-PIE-LABEL: <_start>:57// FAR-PIE-NEXT:   1000000:      	bl	0x1000008 <__ARMv4PILongThunk_target> @ imm = #058// FAR-PIE-NEXT:                	mov pc, lr59// FAR-PIE-EMPTY:60// FAR-PIE-NEXT:  <__ARMv4PILongThunk_target>:61// FAR-PIE-NEXT:   1000008:      	ldr	r12, [pc]               @ 0x1000010 <__ARMv4PILongThunk_target+0x8>62// FAR-PIE-NEXT:                	add	pc, pc, r1263// FAR-PIE-NEXT:   1000010: ec ff ff 04  	.word	0x04ffffec64 65// FAR-EB-PIE-LABEL: <_start>:66// FAR-EB-PIE-NEXT:   1000000:      	bl	0x1000008 <__ARMv4PILongThunk_target> @ imm = #067// FAR-EB-PIE-NEXT:                	mov pc, lr68// FAR-EB-PIE-EMPTY:69// FAR-EB-PIE-NEXT:  <__ARMv4PILongThunk_target>:70// FAR-EB-PIE-NEXT:   1000008:      	ldr	r12, [pc]               @ 0x1000010 <__ARMv4PILongThunk_target+0x8>71// FAR-EB-PIE-NEXT:                	add	pc, pc, r1272// FAR-EB-PIE-NEXT:   1000010: 04 ff ff ec  	.word	0x04ffffec73 74// NEAR-LABEL: <_start>:75// NEAR-NEXT:  1000000:      	bl 0x1000008 <target> @ imm = #076// NEAR-NEXT:               	mov pc, lr77 78.section .high, "ax", %progbits79 .arm80 .globl target81 .type target,%function82target:83  mov pc, lr84 85// FAR-LABEL: <target>:86// FAR-NEXT:   6000000:      	mov pc, lr87 88// FAR-EB-LABEL: <target>:89// FAR-EB-NEXT:   6000000:      	mov pc, lr90 91// FAR-PIE-LABEL: <target>:92// FAR-PIE-NEXT:   6000000:     mov pc, lr93 94// FAR-EB-PIE-LABEL: <target>:95// FAR-EB-PIE-NEXT:   6000000:     mov pc, lr96 97// NEAR-LABEL: <target>:98// NEAR-LABEL:  1000008:      	mov pc, lr99 100//--- far.lds101SECTIONS {102  . = SIZEOF_HEADERS;103  .low 0x01000000 : { *(.low) }104  .high 0x06000000 : { *(.high) }105}106 107//--- near.lds108SECTIONS {109  . = SIZEOF_HEADERS;110  .all 0x01000000 : { *(.low) *(.high) }111}112