| 888 | } |
| 889 | |
| 890 | pub fn display_ins_data_literals( |
| 891 | obj: &Object, |
| 892 | resolved: ResolvedInstructionRef, |
| 893 | ) -> Vec<LiteralInfo> { |
| 894 | let Some(reloc) = resolved.relocation else { |
| 895 | return Vec::new(); |
| 896 | }; |
| 897 | if reloc.relocation.addend < 0 || reloc.relocation.addend as u64 >= reloc.symbol.size { |
| 898 | return Vec::new(); |
| 899 | } |
| 900 | let Some(data) = obj.symbol_data(reloc.relocation.target_symbol) else { |
| 901 | return Vec::new(); |
| 902 | }; |
| 903 | let bytes = &data[reloc.relocation.addend as usize..]; |
| 904 | obj.arch |
| 905 | .guess_data_type(resolved, bytes) |
| 906 | .map(|ty| ty.display_literals(obj.endianness, bytes)) |
| 907 | .unwrap_or_default() |
| 908 | } |