Skip to content

Commit d307bb7

Browse files
committed
elf: Add Copy + Clone to some structs
Some structs in the ELF parser code miss the Copy + Clone annotations, so add them. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
1 parent 64e316b commit d307bb7

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

elf/src/program_header.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use bitflags::bitflags;
1515
bitflags! {
1616
/// Attributes of an ELF64 program header, to specify whether
1717
/// the segment is readable, writable, and/or executable
18-
#[derive(Debug)]
18+
#[derive(Copy, Clone, Debug)]
1919
pub struct Elf64PhdrFlags : Elf64Word {
2020
const EXECUTE = 0x01;
2121
const WRITE = 0x02;
@@ -24,7 +24,7 @@ bitflags! {
2424
}
2525

2626
/// Program header entry in an ELF64 file
27-
#[derive(Debug)]
27+
#[derive(Copy, Clone, Debug)]
2828
pub struct Elf64Phdr {
2929
/// Type of the program header entry
3030
pub p_type: Elf64Word,

elf/src/section_header.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use bitflags::bitflags;
1616
bitflags! {
1717
/// Flags associated with ELF64 section header (e.g.,
1818
/// writable, contains null-terminated string, etc.
19-
#[derive(Debug)]
19+
#[derive(Copy, Clone, Debug)]
2020
pub struct Elf64ShdrFlags : Elf64Xword {
2121
const WRITE = 0x001;
2222
const ALLOC = 0x002;
@@ -33,7 +33,7 @@ bitflags! {
3333
}
3434

3535
/// An ELF64 section header
36-
#[derive(Debug)]
36+
#[derive(Copy, Clone, Debug)]
3737
pub struct Elf64Shdr {
3838
pub sh_name: Elf64Word,
3939
pub sh_type: Elf64Word,

0 commit comments

Comments
 (0)