File tree Expand file tree Collapse file tree 12 files changed +18
-16
lines changed
Expand file tree Collapse file tree 12 files changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -338,6 +338,8 @@ template <class ELFT> void Writer<ELFT>::run() {
338338 // we know the size of the sections.
339339 for (Partition &part : ctx.partitions )
340340 removeEmptyPTLoad (ctx, part.phdrs );
341+ ctx.out .programHeaders ->size =
342+ sizeof (Elf_Phdr) * ctx.mainPart ->phdrs .size ();
341343
342344 if (!ctx.arg .oFormatBinary )
343345 assignFileOffsets ();
Original file line number Diff line number Diff line change 1818# CHECK-NEXT: [ 3] .comment PROGBITS 0000000000000000 020000 000008 01 MS 0 0 1
1919
2020# CHECK: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
21- # CHECK-NEXT: PHDR 0x000040 0x0000000010000040 0x0000000010000040 0x000118 0x000118 R 0x8
22- # CHECK-NEXT: LOAD 0x000000 0x0000000010000000 0x0000000010000000 0x000158 0x000158 R 0x10000
21+ # CHECK-NEXT: PHDR 0x000040 0x0000000010000040 0x0000000010000040 0x0000e0 0x0000e0 R 0x8
22+ # CHECK-NEXT: LOAD 0x000000 0x0000000010000000 0x0000000010000000 0x000120 0x000120 R 0x10000
2323# CHECK-NEXT: LOAD 0x010000 0x0000000010010000 0x0000000010010000 0x010000 0x010000 R E 0x10000
2424
2525## Check that executable page is filled with traps at its end.
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ SECTIONS {
2020# PT_LOAD header.
2121
2222# CHECK: Name Type Address Off
23- # CHECK: .text PROGBITS 0000000008000000 000158
23+ # CHECK: .text PROGBITS 0000000008000000 0000b0
2424# CHECK: .sec1 PROGBITS 0000000020000000 001000
2525# CHECK: .sec2 PROGBITS 0000000020000008 001008
2626# CHECK: .sec3 PROGBITS 0000000020000010 001010
Original file line number Diff line number Diff line change 99
1010# CHECK: Name Type Address Off Size
1111# CHECK-NEXT: NULL 0000000000000000 000000 000000
12- # CHECK-NEXT: .empty PROGBITS 0000000000080000 000158 000000
12+ # CHECK-NEXT: .empty PROGBITS 0000000000080000 0000e8 000000
1313# CHECK-NEXT: .text PROGBITS 0000000000080000 001000 000001
1414# CHECK-NEXT: .data PROGBITS 0000000000080001 001001 000001
1515
Original file line number Diff line number Diff line change 7272# RUN: llvm-readelf -S spill-merge | FileCheck %s --check-prefix=SPILL-MERGE
7373
7474# SPILL-MERGE: Name Type Address Off Size
75- # SPILL-MERGE: .first PROGBITS 0000000000000000 000190 000000
75+ # SPILL-MERGE: .first PROGBITS 0000000000000000 0000b0 000000
7676# SPILL-MERGE-NEXT: .second PROGBITS 0000000000000001 001001 000002
7777# SPILL-MERGE-NEXT: .third PROGBITS 0000000000000003 001003 000000
7878
Original file line number Diff line number Diff line change 1414
1515# CHECK: Name Type Address Off Size
1616# CHECK-NEXT: NULL 0000000000000000 000000 000000
17- # CHECK-NEXT: .text PROGBITS 0000000000000000 000190 000000
17+ # CHECK-NEXT: .text PROGBITS 0000000000000000 0000e8 000000
1818# CHECK-NEXT: .sec1 NOBITS 0000000000000000 001000 000001
1919# CHECK-NEXT: .bss NOBITS 0000000000000400 001400 000001
2020
Original file line number Diff line number Diff line change @@ -301,7 +301,7 @@ SECTIONS {
301301# RUN: llvm-readelf -S enable-non-contiguous-regions | FileCheck %s --check-prefix=ENABLE-NON-CONTIGUOUS-REGIONS
302302
303303# ENABLE-NON-CONTIGUOUS-REGIONS: Name Type Address Off Size
304- # ENABLE-NON-CONTIGUOUS-REGIONS: .first_chance PROGBITS 0000000000000000 000190 000000
304+ # ENABLE-NON-CONTIGUOUS-REGIONS: .first_chance PROGBITS 0000000000000000 0000e8 000000
305305# ENABLE-NON-CONTIGUOUS-REGIONS-NEXT: .last_chance PROGBITS 0000000000000001 001001 000002
306306# ENABLE-NON-CONTIGUOUS-REGIONS-NEXT: .one_byte_section PROGBITS 0000000000000003 001003 000001
307307
@@ -337,7 +337,7 @@ SECTIONS {
337337# RUN: llvm-readelf -S -x .second spill-merge | FileCheck %s --check-prefix=SPILL-MERGE
338338
339339# SPILL-MERGE: Name Type Address Off Size
340- # SPILL-MERGE: .first PROGBITS 0000000000000000 000190 000000
340+ # SPILL-MERGE: .first PROGBITS 0000000000000000 0000b0 000000
341341# SPILL-MERGE-NEXT: .second PROGBITS 0000000000000008 001008 000009
342342# SPILL-MERGE-NEXT: .third PROGBITS 0000000000000018 001018 000000
343343# SPILL-MERGE: Hex dump of section '.second':
Original file line number Diff line number Diff line change 1414
1515# CHECK: Name Type Address Off Size
1616# CHECK-NEXT: NULL 0000000000000000 000000 000000
17- # CHECK-NEXT: .text PROGBITS 0000000000000000 000190 000000
17+ # CHECK-NEXT: .text PROGBITS 0000000000000000 0000e8 000000
1818# CHECK-NEXT: .sec1 PROGBITS 0000000000000000 001000 000001
1919# CHECK-NEXT: .tbss NOBITS 0000000000000400 001400 000001
2020
Original file line number Diff line number Diff line change 4040// CHECK-NEXT: Owner: GNU
4141// CHECK-NEXT: Data size:
4242// CHECK-NEXT: Type: NT_GNU_BUILD_ID (unique build ID bitstring)
43- // CHECK-NEXT: Build ID: d5101cb9d03b7e836ba9b64f5768a0b31980920f {{$}}
43+ // CHECK-NEXT: Build ID: 3f73ca205e4241e96506d2175ee0134476175f85 {{$}}
4444// CHECK-NEXT: }
4545// CHECK-NEXT: ]
4646// CHECK-NEXT: }
Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ _start:
3737# CHECK-NEXT: Offset: 0x40
3838# CHECK-NEXT: VirtualAddress: 0x200040
3939# CHECK-NEXT: PhysicalAddress: 0x200040
40- # CHECK-NEXT: FileSize: 280
41- # CHECK-NEXT: MemSize: 280
40+ # CHECK-NEXT: FileSize: 224
41+ # CHECK-NEXT: MemSize: 224
4242# CHECK-NEXT: Flags [ (0x4)
4343# CHECK-NEXT: PF_R (0x4)
4444# CHECK-NEXT: ]
You can’t perform that action at this time.
0 commit comments