| ... | ... | @@ -3708,13 +3708,11 @@ fn shdrToPhdrFlags(sh_flags: u64) u32 { |
| 3708 | 3708 | /// (This is an upper bound so that we can reserve enough space for the header and progam header |
| 3709 | 3709 | /// table without running out of space and being forced to move things around.) |
| 3710 | 3710 | fn getMaxNumberOfPhdrs() u64 { |
| 3711 | | // First, assume we compile Zig's source incrementally, this gives us: |
| 3712 | | var num: u64 = number_of_zig_segments; |
| 3713 | | // Next, the estimated maximum number of segments the linker can emit for input sections are: |
| 3714 | | num += max_number_of_object_segments; |
| 3715 | | // Next, any other non-loadable program headers, including TLS, DYNAMIC, GNU_STACK, GNU_EH_FRAME, INTERP: |
| 3711 | // The estimated maximum number of segments the linker can emit for input sections are: |
| 3712 | var num: u64 = max_number_of_object_segments; |
| 3713 | // Any other non-loadable program headers, including TLS, DYNAMIC, GNU_STACK, GNU_EH_FRAME, INTERP: |
| 3716 | 3714 | num += max_number_of_special_phdrs; |
| 3717 | | // Finally, PHDR program header and corresponding read-only load segment: |
| 3715 | // PHDR program header and corresponding read-only load segment: |
| 3718 | 3716 | num += 2; |
| 3719 | 3717 | return num; |
| 3720 | 3718 | } |
| ... | ... | @@ -5495,7 +5493,6 @@ fn requiresThunks(self: Elf) bool { |
| 5495 | 5493 | /// so that we reserve enough space for the program header table up-front. |
| 5496 | 5494 | /// Bump these numbers when adding or deleting a Zig specific pre-allocated segment, or adding |
| 5497 | 5495 | /// more special-purpose program headers. |
| 5498 | | pub const number_of_zig_segments = 2; |
| 5499 | 5496 | const max_number_of_object_segments = 9; |
| 5500 | 5497 | const max_number_of_special_phdrs = 5; |
| 5501 | 5498 | |