Skip to content

Commit 5c22c88

Browse files
committed
Support .BINARY section
Resolves #12
1 parent 4cb6f4f commit 5c22c88

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/cmd/elf2dol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ fn section_kind(section: &object::Section) -> SectionKind {
170170
.and_then(|name| match name {
171171
".init" | ".text" | ".vmtext" | ".dbgtext" => Some(SectionKind::Text),
172172
".ctors" | ".dtors" | ".data" | ".rodata" | ".sdata" | ".sdata2" | "extab"
173-
| "extabindex" => Some(SectionKind::Data),
173+
| "extabindex" | ".BINARY" => Some(SectionKind::Data),
174174
".bss" | ".sbss" | ".sbss2" => Some(SectionKind::UninitializedData),
175175
_ => None,
176176
})

src/obj/sections.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ impl ObjSection {
212212
fn section_kind_for_section(section_name: &str) -> Result<ObjSectionKind> {
213213
Ok(match section_name {
214214
".init" | ".text" | ".dbgtext" | ".vmtext" => ObjSectionKind::Code,
215-
".ctors" | ".dtors" | ".rodata" | ".sdata2" | "extab" | "extabindex" => {
215+
".ctors" | ".dtors" | ".rodata" | ".sdata2" | "extab" | "extabindex" | ".BINARY" => {
216216
ObjSectionKind::ReadOnlyData
217217
}
218218
".bss" | ".sbss" | ".sbss2" => ObjSectionKind::Bss,

src/util/asm.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,8 @@ where
859859
write!(w, ".section {}", section.name)?;
860860
write!(w, ", \"a\", @nobits")?;
861861
}
862-
".ctors" | ".dtors" | ".ctors$10" | ".dtors$10" | ".dtors$15" | "extab" | "extabindex" => {
862+
".ctors" | ".dtors" | ".ctors$10" | ".dtors$10" | ".dtors$15" | "extab" | "extabindex"
863+
| ".BINARY" => {
863864
write!(w, ".section {}", section.name)?;
864865
write!(w, ", \"a\"")?;
865866
}

0 commit comments

Comments
 (0)