File: output-too-large.s

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,696 kB
  • sloc: cpp: 7,438,781; ansic: 1,393,871; asm: 1,012,926; python: 241,771; f90: 86,635; objc: 75,411; lisp: 42,144; pascal: 17,286; sh: 8,596; ml: 5,082; perl: 4,730; makefile: 3,591; awk: 3,523; javascript: 2,251; xml: 892; fortran: 672
file content (46 lines) | stat: -rw-r--r-- 1,826 bytes parent folder | download | duplicates (22)
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
# REQUIRES: x86

# RUN: llvm-mc -filetype=obj -triple=i686 %s -o %t1.o
# RUN: echo "SECTIONS { .text : { . = 0xffffffff; *(.text*); } }" > %t1.script
# RUN: not ld.lld --no-check-sections -T %t1.script %t1.o -o /dev/null 2>&1 | FileCheck %s

## Error if an address is greater than or equal to 2**32 for ELF32.
## When -M is specified, print the link map even if such an error occurs,
## because the link map can help diagnose problems.
# RUN: not ld.lld -T %t1.script %t1.o -M -o /dev/null 2>&1 | \
# RUN:   FileCheck --check-prefix=MAP1 %s

# MAP1:           VMA      LMA     Size Align Out     In      Symbol
# MAP1-NEXT:        0        0 100000001     4 .text
# MAP1-NEXT:        0        0 ffffffff     1         . = 0xffffffff
# MAP1-NEXT: 100000000 100000000        1     4         {{.*}}.o:(.text)
# MAP1:      error: section .text at 0x0 of size 0x100000001 exceeds available address space

## Error if an address is greater than or equal to 2**63.
## Print a link map if -M is specified.
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t2.o
# RUN: echo "SECTIONS { .text : { . = 0x8fffffffffffffff; *(.text*); } }" > %t2.script
# RUN: not ld.lld -T %t2.script -M %t2.o -o /dev/null 2>&1 | \
# RUN:   FileCheck --check-prefixes=MAP2,CHECK64 %s

# MAP2:                   VMA              LMA     Size Align Out     In      Symbol
# MAP2:      9000000000000000 9000000000000000        1     4         {{.*}}.o:(.text)
# MAP2-NEXT: 9000000000000000 9000000000000000        0     1                 _start

# CHECK: error: output file too large
# CHECK-NEXT: section sizes:
# CHECK-NEXT: .text 4294967297
# CHECK-NEXT: .data 1

# CHECK64: error: output file too large
# CHECK64-NEXT: section sizes:
# CHECK64-NEXT: .text 10376293541461622785
# CHECK64-NEXT: .data 1

.data
.byte 42

.text
.global _start
_start:
  nop