Skip to content

Commit

Permalink
Add AVR e_flags constants and more relocation types
Browse files Browse the repository at this point in the history
  • Loading branch information
agausmann committed Jan 8, 2023
1 parent 451efef commit 36efe8b
Showing 1 changed file with 114 additions and 0 deletions.
114 changes: 114 additions & 0 deletions src/elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4238,12 +4238,126 @@ pub const R_AARCH64_TLSDESC: u32 = 1031;
/// STT_GNU_IFUNC relocation.
pub const R_AARCH64_IRELATIVE: u32 = 1032;

// AVR values for `FileHeader*::e_flags`.

/// Bitmask for `EF_AVR_MACH_*`.
pub const EF_AVR_MACH: u32 = 0x7F;

/// If set, it is assumed that the elf file uses local symbols as reference
/// for the relocations so that linker relaxation is possible.
pub const EF_AVR_LINKRELAX_PREPARED: u32 = 0x80;

#[allow(missing_docs)]
pub const EF_AVR_MACH_AVR1: u32 = 1;
#[allow(missing_docs)]
pub const EF_AVR_MACH_AVR2: u32 = 2;
#[allow(missing_docs)]
pub const EF_AVR_MACH_AVR25: u32 = 25;
#[allow(missing_docs)]
pub const EF_AVR_MACH_AVR3: u32 = 3;
#[allow(missing_docs)]
pub const EF_AVR_MACH_AVR31: u32 = 31;
#[allow(missing_docs)]
pub const EF_AVR_MACH_AVR35: u32 = 35;
#[allow(missing_docs)]
pub const EF_AVR_MACH_AVR4: u32 = 4;
#[allow(missing_docs)]
pub const EF_AVR_MACH_AVR5: u32 = 5;
#[allow(missing_docs)]
pub const EF_AVR_MACH_AVR51: u32 = 51;
#[allow(missing_docs)]
pub const EF_AVR_MACH_AVR6: u32 = 6;
#[allow(missing_docs)]
pub const EF_AVR_MACH_XMEGA1: u32 = 101;
#[allow(missing_docs)]
pub const EF_AVR_MACH_XMEGA2: u32 = 102;
#[allow(missing_docs)]
pub const EF_AVR_MACH_XMEGA3: u32 = 103;
#[allow(missing_docs)]
pub const EF_AVR_MACH_XMEGA4: u32 = 104;
#[allow(missing_docs)]
pub const EF_AVR_MACH_XMEGA5: u32 = 105;
#[allow(missing_docs)]
pub const EF_AVR_MACH_XMEGA6: u32 = 106;
#[allow(missing_docs)]
pub const EF_AVR_MACH_XMEGA7: u32 = 107;

// AVR values for `Rel*::r_type`.

#[allow(missing_docs)]
pub const R_AVR_NONE: u32 = 0;
/// Direct 32 bit
pub const R_AVR_32: u32 = 1;
#[allow(missing_docs)]
pub const R_AVR_7_PCREL: u32 = 2;
#[allow(missing_docs)]
pub const R_AVR_13_PCREL: u32 = 3;
/// Direct 16 bit
pub const R_AVR_16: u32 = 4;
#[allow(missing_docs)]
pub const R_AVR_16_PM: u32 = 5;
#[allow(missing_docs)]
pub const R_AVR_LO8_LDI: u32 = 6;
#[allow(missing_docs)]
pub const R_AVR_HI8_LDI: u32 = 7;
#[allow(missing_docs)]
pub const R_AVR_HH8_LDI: u32 = 8;
#[allow(missing_docs)]
pub const R_AVR_LO8_LDI_NEG: u32 = 9;
#[allow(missing_docs)]
pub const R_AVR_HI8_LDI_NEG: u32 = 10;
#[allow(missing_docs)]
pub const R_AVR_HH8_LDI_NEG: u32 = 11;
#[allow(missing_docs)]
pub const R_AVR_LO8_LDI_PM: u32 = 12;
#[allow(missing_docs)]
pub const R_AVR_HI8_LDI_PM: u32 = 13;
#[allow(missing_docs)]
pub const R_AVR_HH8_LDI_PM: u32 = 14;
#[allow(missing_docs)]
pub const R_AVR_LO8_LDI_PM_NEG: u32 = 15;
#[allow(missing_docs)]
pub const R_AVR_HI8_LDI_PM_NEG: u32 = 16;
#[allow(missing_docs)]
pub const R_AVR_HH8_LDI_PM_NEG: u32 = 17;
#[allow(missing_docs)]
pub const R_AVR_CALL: u32 = 18;
#[allow(missing_docs)]
pub const R_AVR_LDI: u32 = 19;
#[allow(missing_docs)]
pub const R_AVR_6: u32 = 20;
#[allow(missing_docs)]
pub const R_AVR_6_ADIW: u32 = 21;
#[allow(missing_docs)]
pub const R_AVR_MS8_LDI: u32 = 22;
#[allow(missing_docs)]
pub const R_AVR_MS8_LDI_NEG: u32 = 23;
#[allow(missing_docs)]
pub const R_AVR_LO8_LDI_GS: u32 = 24;
#[allow(missing_docs)]
pub const R_AVR_HI8_LDI_GS: u32 = 25;
#[allow(missing_docs)]
pub const R_AVR_8: u32 = 26;
#[allow(missing_docs)]
pub const R_AVR_8_LO8: u32 = 27;
#[allow(missing_docs)]
pub const R_AVR_8_HI8: u32 = 28;
#[allow(missing_docs)]
pub const R_AVR_8_HLO8: u32 = 29;
#[allow(missing_docs)]
pub const R_AVR_DIFF8: u32 = 30;
#[allow(missing_docs)]
pub const R_AVR_DIFF16: u32 = 31;
#[allow(missing_docs)]
pub const R_AVR_DIFF32: u32 = 32;
#[allow(missing_docs)]
pub const R_AVR_LDS_STS_16: u32 = 33;
#[allow(missing_docs)]
pub const R_AVR_PORT6: u32 = 34;
#[allow(missing_docs)]
pub const R_AVR_PORT5: u32 = 35;
#[allow(missing_docs)]
pub const R_AVR_32_PCREL: u32 = 36;

// MSP430 values for `Rel*::r_type`.

Expand Down

0 comments on commit 36efe8b

Please sign in to comment.