|
16 | 16 | # CHECK-NEXT: .small1 PROGBITS 0000000000001000 002000 000004
|
17 | 17 | # CHECK-NEXT: .small2 PROGBITS 0000000000001008 002008 000004
|
18 | 18 | # CHECK-NEXT: .big2 PROGBITS 0000000000001008 003008 000008
|
| 19 | +# CHECK-NEXT: .empty3 PROGBITS 0000000000001010 003010 000000 |
19 | 20 | # CHECK-NEXT: .small3 PROGBITS 0000000000001010 003010 000004
|
20 |
| -# CHECK-NEXT: .big3 PROGBITS 0000000000001014 003014 000008 |
21 |
| -# CHECK-NEXT: .text PROGBITS 0000000000001024 003024 000001 |
| 21 | +# CHECK-NEXT: .big3 PROGBITS 0000000000001010 004010 000008 |
| 22 | +# CHECK-NEXT: .text PROGBITS 0000000000001018 004018 000001 |
22 | 23 |
|
23 | 24 | # CHECK: Program Headers:
|
24 | 25 | # CHECK: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
|
25 | 26 | # CHECK-NEXT: LOAD 0x001000 0x0000000000001000 0x0000000000001000 0x000008 0x000008 R 0x1000
|
26 | 27 | # CHECK-NEXT: LOAD 0x002000 0x0000000000001000 0x0000000000001008 0x000004 0x000004 R 0x1000
|
27 | 28 | # CHECK-NEXT: LOAD 0x002008 0x0000000000001008 0x0000000000002008 0x000004 0x000004 R 0x1000
|
28 | 29 | # CHECK-NEXT: LOAD 0x003008 0x0000000000001008 0x000000000000200c 0x000008 0x000008 R 0x1000
|
29 |
| -## FIXME Fix p_paddr when the first section in an overlay is empty and discarded. |
30 |
| -# CHECK-NEXT: LOAD 0x003010 0x0000000000001010 0x0000000000000000 0x000004 0x000004 R 0x1000 |
31 |
| -# CHECK-NEXT: LOAD 0x003014 0x0000000000001014 0x0000000000000004 0x000008 0x000008 R 0x1000 |
32 |
| -# CHECK-NEXT: LOAD 0x003024 0x0000000000001024 0x0000000000000014 0x000001 0x000001 R E 0x1000 |
| 30 | +# CHECK-NEXT: LOAD 0x003010 0x0000000000001010 0x0000000000002014 0x000004 0x000004 R 0x1000 |
| 31 | +# CHECK-NEXT: LOAD 0x004010 0x0000000000001010 0x0000000000002018 0x000008 0x000008 R 0x1000 |
| 32 | +# CHECK-NEXT: LOAD 0x004018 0x0000000000001018 0x0000000000002020 0x000001 0x000001 R E 0x1000 |
33 | 33 |
|
34 | 34 | # RUN: not ld.lld a.o -T err1.t 2>&1 | FileCheck %s --check-prefix=ERR1 --match-full-lines --strict-whitespace
|
35 | 35 | # ERR1:{{.*}}error: err1.t:3: { expected, but got 0x3000
|
@@ -57,14 +57,17 @@ _start:
|
57 | 57 |
|
58 | 58 | #--- a.t
|
59 | 59 | SECTIONS {
|
60 |
| - OVERLAY 0x1000 : AT( 0x1000 ) { |
| 60 | +## LMA defaults to VMA |
| 61 | + OVERLAY 0x1000 : { |
61 | 62 | .big1 { *(.big1) }
|
62 | 63 | .small1 { *(.small1) }
|
63 | 64 | }
|
64 |
| - OVERLAY 0x1008 : AT (0x2008) { |
| 65 | +## .big2 starts at ADDR(.small2) |
| 66 | + OVERLAY : AT (0x2008) { |
65 | 67 | .small2 { *(.small2) }
|
66 | 68 | .big2 { *(.big2) }
|
67 | 69 | }
|
| 70 | +## .empty3 is not discarded. .small3 and .big3 share its address. |
68 | 71 | OVERLAY . : AT (0x2014) {
|
69 | 72 | .empty3 { *(.empty3) }
|
70 | 73 | .small3 { *(.small3) }
|
|
0 commit comments