(&self, section: SectionIndex, offset: i64)
| 118 | } |
| 119 | |
| 120 | fn encode(&self, section: SectionIndex, offset: i64) -> Result<u64, Error> { |
| 121 | let (address, size) = self.forward_map[section.0]; |
| 122 | if offset < -(Self::SECTION_GAP as i64 / 2) |
| 123 | || offset > (size + Self::SECTION_GAP / 2) as i64 |
| 124 | { |
| 125 | Err(Error::UnexpectedElf("symbol offset too big"))? |
| 126 | } |
| 127 | |
| 128 | Ok(address.wrapping_add(offset as _)) |
| 129 | } |
| 130 | |
| 131 | fn decode(&self, address: u64) -> Result<(SectionIndex, i64), Error> { |
| 132 | let address_plus_gap = address |
no outgoing calls
no test coverage detected