mjhouse / deaf

A library for inspecting/modifying ELF binaries
GNU General Public License v3.0
7 stars 0 forks source link

Implement a `RelItem` struct for relocation tables without addends #35

Closed mjhouse closed 1 year ago

mjhouse commented 1 year ago

Is your feature request related to a problem? Please describe. RelaItem has an addend field that may not be there on all platforms.

Describe the solution you'd like We should have a RelItem struct that handles this case, and check the table type to determine whether it's a relocation table with addends or not.

Describe alternatives you've considered N/A

Additional context Section headers have a type value that can be checked to determine if they refer to a Rel or Rela table.

pub enum SHType {
    ...
    SHT_RELA = 0x00000004,
    ...
    SHT_REL = 0x00000009,
    ...
}