Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libwild/src/alignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub(crate) struct Alignment {
}

/// The maximum supported alignment exponent.
const MAX_ALIGNMENT_EXPONENT: u8 = 16;
const MAX_ALIGNMENT_EXPONENT: u8 = 21;

pub(crate) const NUM_ALIGNMENTS: usize = MAX_ALIGNMENT_EXPONENT as usize + 1;

Expand Down
8 changes: 4 additions & 4 deletions libwild/src/output_section_part_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ fn test_merge_parts() {
);

let num_regular_sections = output_sections.num_regular_sections();
let mut num_sections_with_17 = 0;
let mut num_sections_with_all_alignments = 0;

let mut sum_of_1s = output_sections.new_section_map::<u32>();
sum_of_1s.for_each_mut(|section_id, sum| {
Expand All @@ -241,8 +241,8 @@ fn test_merge_parts() {
let mut sum_of_sums = 0;
sum_of_1s.for_each(|section_id, sum| {
sum_of_sums += *sum;
if *sum == 17 {
num_sections_with_17 += 1;
if *sum == crate::alignment::NUM_ALIGNMENTS as u32 {
num_sections_with_all_alignments += 1;
}
let unsupported_single_part = !section_id.is_regular::<Elf64>()
&& <Elf64 as crate::platform::Platform>::single_part_id(section_id).is_none();
Expand All @@ -252,7 +252,7 @@ fn test_merge_parts() {
assert!(*sum > 0, "Expected non-zero sum for section {section_id:?}");
}
});
assert_eq!(num_regular_sections, num_sections_with_17);
assert_eq!(num_regular_sections, num_sections_with_all_alignments);
assert_eq!(sum_of_sums, expected_sum_of_sums);

let mut headers_only = output_sections.new_part_map::<u32>();
Expand Down
2 changes: 1 addition & 1 deletion wild/tests/sources/elf/alignment/alignment.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "../common/runtime.h"

#define ALIGNMENT 65536
#define ALIGNMENT 0x200000

struct __attribute__((aligned(ALIGNMENT))) S {
short f[3];
Expand Down
Loading