authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-08-29 21:19:16+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-09-04 13:34:25+02:00
logef6ee90ff8762624852ee9a71241bd5a926371ab
tree1b1b43bf48cccbb30edab602ca162cedf450e835
parent2d0f4fc9c0401a3c0fcf68dfc67c7948351c7f73

elf: remove now unused number_of_zig_segments


1 files changed, 4 insertions(+), 7 deletions(-)

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