Remove unnecessary TUI declarations
[deliverable/binutils-gdb.git] / binutils / testsuite / binutils-all / pr25662-pdp11.s
CommitLineData
8eca5c7d
SC
1/* PR 25662: objcopy sets invalid sh_offset for the first section in a
2 no_contents segment containing program headers.
3
4 Several conditions are required for the bug to manifest:
5 - The first loadable segment (which contains the program headers) must only
6 contain SHT_NOBITS sections. .bss is the SHT_NOBITS section in this test.
7 - The next loadable segment must have a !SHT_NOBITS loadable section. .data
8 is the !SHT_NOBITS section in this test.
9 - .bss must be positioned after .data in the executable file itself.
10 - The size of .data must be such that the calculated VMA of the .bss
11 section that follows it is not congruent with the file offset of .bss,
12 modulo the p_align of its segment, i.e.:
13 (VMA(.data) + sizeof(.data)) % (.bss_segment.p_align) != 0
14 This will force the sh_offset of .bss to be aligned so it appears within
15 .data.
16 - The size of .data must be larger than the program headers in the first
17 loadable segment, so that the file offset of .bss is immediately
18 after .data, and not padded to a valid alignment by the program headers.
19
20 The bug originally only manifested for ELF targets, but there's no reason not
21 to run this testcase for other file formats. This variant source for pdp11
22 uses .text rather than .section text, etc., because the latter are not
23 supported, */
24
25 .bss
26a:
27 .zero 0x2
28
29 .data
30c:
31 .zero 0x201
32
33 .text
34 .global _start
35_start:
36 .long 0
This page took 0.023886 seconds and 4 git commands to generate.