Don't make SectionBody's internal Vec public.

Add a new method to create a new section body. Remove unused methods. Improve implementation of is_empty().
This commit is contained in:
Nick Lewycky
2020-05-15 16:59:34 -07:00
parent 1ee5f27a3a
commit fce8e32cf6
2 changed files with 6 additions and 11 deletions

View File

@ -480,7 +480,7 @@ impl FuncTranslator {
custom_section_index,
CustomSection {
protection: CustomSectionProtection::Read,
bytes: SectionBody(section_bytes(*elf_section_index)),
bytes: SectionBody::new_with_vec(section_bytes(*elf_section_index)),
relocations: relocations
.remove_entry(elf_section_index)
.map_or(vec![], |(k, v)| v),