File: ELF_data_alignment.s

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (68 lines) | stat: -rw-r--r-- 2,817 bytes parent folder | download | duplicates (3)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# REQUIRES: asserts
# RUN: llvm-mc -triple=armv7-linux-gnueabi -arm-add-build-attributes -filetype=obj -o %t_armv7.o %s
# RUN: llvm-objdump -s --section=.rodata %t_armv7.o | FileCheck --check-prefix=CHECK-OBJ %s
# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 -slab-allocate 10Kb \
# RUN:              -slab-page-size 4096 %t_armv7.o -debug-only=jitlink 2>&1 \
# RUN:              | FileCheck --check-prefix=CHECK-LG %s
# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 -slab-allocate 10Kb \
# RUN:              -slab-page-size 4096 %t_armv7.o -check %s

# RUN: llvm-mc -triple=thumbv7-linux-gnueabi -arm-add-build-attributes -filetype=obj -o %t_thumbv7.o %s
# RUN: llvm-objdump -s --section=.rodata %t_thumbv7.o | FileCheck --check-prefix=CHECK-OBJ %s
# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 -slab-allocate 10Kb \
# RUN:              -slab-page-size 4096 %t_thumbv7.o -debug-only=jitlink 2>&1 \
# RUN:              | FileCheck --check-prefix=CHECK-LG %s
# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 -slab-allocate 10Kb \
# RUN:              -slab-page-size 4096 %t_thumbv7.o -check %s

# The strings of "H1\00", "H2\00" and "H3\00" are encoded as
#               0x483100, 0x483200 and 0x483300 in the .rodata section.
# CHECK-OBJ: Contents of section .rodata:
# CHECK-OBJ: 0000 48310048 32004833 00                 H1.H2.H3.

# CHECK-LG: Starting link phase 1 for graph
# CHECK-LG: section .rodata:

# CHECK-LG:       block 0x0 size = 0x00000009, align = 1, alignment-offset = 0
# CHECK-LG-NEXT:    symbols:
# CHECK-LG-NEXT:      0x0 (block + 0x00000000): size: 0x00000003, linkage: strong, scope: default, live  -   Lstr.H1
# CHECK-LG-NEXT:      0x3 (block + 0x00000003): size: 0x00000003, linkage: strong, scope: default, live  -   Lstr.H2
# CHECK-LG-NOT:       0x2 (block + 0x00000002): size: 0x00000003, linkage: strong, scope: default, live  -   Lstr.H2
# CHECK-LG-NEXT:      0x6 (block + 0x00000006): size: 0x00000003, linkage: strong, scope: default, live  -   Lstr.H3

# jitlink-check: Lstr.H1 = 0x76ff0000
# jitlink-check: (*{4}(Lstr.H1))[23:0] = 0x003148
	.globl	Lstr.H1
	.type	Lstr.H1,%object
	.section	.rodata,"a",%progbits
Lstr.H1:
	.asciz	"H1"
	.size	Lstr.H1, 3

# H2 is unaligned as its beginning address is base address + 0x3
# Make sure the string we get is 0x003248 and not 0x324800
# jitlink-check: Lstr.H2 = 0x76ff0003
# jitlink-check: (*{4}(Lstr.H2))[23:0] = 0x003248
	.globl	Lstr.H2
	.type	Lstr.H2,%object
Lstr.H2:
	.asciz	"H2"
	.size	Lstr.H2, 3

# jitlink-check: Lstr.H3 = 0x76ff0006
# jitlink-check: (*{4}(Lstr.H3))[23:0] = 0x003348
	.globl	Lstr.H3
	.type	Lstr.H3,%object
Lstr.H3:
	.asciz	"H3"
	.size	Lstr.H3, 3

	.text
	.syntax unified
# Empty main function for jitlink to be happy
	.globl	main
	.type	main,%function
	.p2align	2
main:
	bx	lr
	.size	main,.-main