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 {
37083708/// (This is an upper bound so that we can reserve enough space for the header and progam header
37093709/// table without running out of space and being forced to move things around.)
37103710fn 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:
37163714 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:
37183716 num += 2;
37193717 return num;
37203718}
......@@ -5495,7 +5493,6 @@ fn requiresThunks(self: Elf) bool {
54955493/// so that we reserve enough space for the program header table up-front.
54965494/// Bump these numbers when adding or deleting a Zig specific pre-allocated segment, or adding
54975495/// more special-purpose program headers.
5498pub const number_of_zig_segments = 2;
54995496const max_number_of_object_segments = 9;
55005497const max_number_of_special_phdrs = 5;
55015498