mirror of
https://github.com/encounter/objdiff.git
synced 2025-12-09 13:37:55 +00:00
arm: Fix .word not on 4-byte boundary (#282)
This commit is contained in:
@@ -224,7 +224,10 @@ impl Arch for ArchArm {
|
||||
}
|
||||
|
||||
// Check how many bytes we can/should read
|
||||
let num_code_bytes = if data.len() >= 4 {
|
||||
let num_code_bytes = if mode == unarm::ParseMode::Data {
|
||||
// 32-bit .word value should be aligned on a 4-byte boundary, otherwise use .hword
|
||||
if address & 3 == 0 { 4 } else { 2 }
|
||||
} else if data.len() >= 4 {
|
||||
// Read 4 bytes even for Thumb, as the parser will determine if it's a 2 or 4 byte instruction
|
||||
4
|
||||
} else if mode != unarm::ParseMode::Arm {
|
||||
|
||||
Reference in New Issue
Block a user