8 # RUN: echo -n "Fluffle Puff" > d/t.txt
9 # RUN: ld.lld -m elf_x86_64 -r -b binary d/t.txt -t -o ro | FileCheck %s --check-prefix=RO-TRACE
10 # RUN: llvm-readelf -h -S -s -x .data ro | FileCheck --check-prefix=RO %s
14 # RO: Machine: Advanced Micro Devices X86-64
15 # RO: Name Type Address Off Size ES Flg Lk Inf Al
16 # RO-NEXT: NULL 0000000000000000 000000 000000 00 0 0 0
17 # RO-NEXT: .data PROGBITS 0000000000000000 {{.*}} 00000c 00 WA 0 0 8
18 # RO: Value Size Type Bind Vis Ndx Name
19 # RO: 0000000000000000 0 OBJECT GLOBAL DEFAULT 1 _binary_d_t_txt_start
20 # RO-NEXT: 000000000000000c 0 OBJECT GLOBAL DEFAULT 1 _binary_d_t_txt_end
21 # RO-NEXT: 000000000000000c 0 OBJECT GLOBAL DEFAULT ABS _binary_d_t_txt_size
22 # RO: Hex dump of section '.data':
23 # RO-NEXT: 0x00000000 466c7566 666c6520 50756666 Fluffle Puff
25 # RUN: echo 'OUTPUT_FORMAT(elf64-x86-64)' > t.lds
26 # RUN: ld.lld -b binary -T t.lds d/t.txt -o exe
27 # RUN: llvm-readelf -h -S -s exe | FileCheck --check-prefix=EXE %s
29 ## bfdname can be quoted.
30 # RUN: echo 'OUTPUT_FORMAT("elf64-x86-64")' > t1.lds
31 # RUN: ld.lld -b binary -T t1.lds d/t.txt -o exe1
32 # RUN: llvm-readelf -h -S -s exe | FileCheck --check-prefix=EXE %s
34 # EXE: Machine: Advanced Micro Devices X86-64
35 # EXE: [Nr] Name Type Address Off Size ES Flg Lk Inf Al
36 # EXE: [ 2] .data PROGBITS {{.*}} 00000c 00 WA 0 0 8
37 # EXE: Size Type Bind Vis Ndx Name
38 # EXE: 0 OBJECT GLOBAL DEFAULT 2 _binary_d_t_txt_start
39 # EXE-NEXT: 0 OBJECT GLOBAL DEFAULT 2 _binary_d_t_txt_end
40 # EXE-NEXT: 0 OBJECT GLOBAL DEFAULT ABS _binary_d_t_txt_size
42 # RUN: not ld.lld -b foo 2>&1 | FileCheck --check-prefix=ERR %s
43 # ERR: error: unknown --format value: foo (supported formats: elf, default, binary)
45 ## Non-isalnum bytes are converted to _. See D37331.
46 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o d/£.o
47 # RUN: ld.lld d/£.o --format=binary d/£.o -o unicode
48 # RUN: llvm-nm -p unicode | FileCheck --check-prefix=UNICODE %s
50 # UNICODE: D _binary_d_{{_+}}o_start
51 # UNICODE: D _binary_d_{{_+}}o_end
52 # UNICODE: A _binary_d_{{_+}}o_size