1 ## Check that yaml2obj limits the output size by default to 10 MB.
2 ## Check it is possible to change this limit using the
3 ## --max-size command line option.
5 ## One of the often cases to reach the limit is to create a section with a
6 ## large portion of data. Check this case is handled properly.
8 ## 0x9FFEC0 = 0xA00000 (10 MB) - sizeof(Elf_Ehdr) - sizeof(Elf_Shdr) * 4.
9 # RUN: yaml2obj %s -DSIZE=0x9FFEC0 --docnum=1 -o /dev/null 2>&1
10 # RUN: not yaml2obj %s -DSIZE=0x9FFEC1 --docnum=1 -o /dev/null 2>&1 | \
11 # RUN: FileCheck %s --check-prefix=ERROR
13 # ERROR: error: the desired output size is greater than permitted. Use the --max-size option to change the limit
15 ## We use 0xA00008 instead of 0xA00001 here because the section header table
16 ## offset is aligned to 8 bytes, so we need to request 7 more bytes for it.
17 # RUN: yaml2obj %s -DSIZE=0x9FFEC1 --docnum=1 --max-size=0xA00008 -o /dev/null
35 ## Another possible case is when an alignment gap inserted
36 ## is too large because of overaligning. Check it is also handled properly.
37 # RUN: not yaml2obj %s --docnum=2 -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERROR
49 AddressAlign: 0xA00100
52 ## Check that we can drop the limit with the use of --max-size=0.
53 # RUN: yaml2obj --max-size=0 %s --docnum=2 -o /dev/null