1SECTIONS
2{
3    .text : { *(.text) }
4
5    __foo0_start = .;
6    .foo0 : { *(.foo0.*) }
7    __foo0_end = .;
8
9    __foo1_start = .;
10    .foo1 : { KEEP(*(.foo1.*)) }
11    __foo1_end = .;
12
13    .foo2 : {
14        __foo2_start = .;
15        KEEP(*(.foo2.*))
16        __foo2_end = .;
17    }
18
19    .got : { *(.got .toc) }
20}
21
22
23ASSERT (__foo1_start < __foo1_end, "foo1 not KEPT");
24ASSERT ((__foo1_end - __foo1_start) == (__foo2_end - __foo2_start),"foo2 not KEPT");
25
26