Skip to content

Commit ae39329

Browse files
authored
Detect GCC $LC literals as strings (#398)
1 parent 6735137 commit ae39329

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • objdiff-core/src/arch/ppc

objdiff-core/src/arch/ppc/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,11 @@ impl Arch for ArchPpc {
379379
return Some(ty);
380380
}
381381
}
382+
if reloc.is_some_and(|r| r.symbol.name.starts_with("$LC")) {
383+
// GCC compiler-generated symbol name for a literal.
384+
// This could be a float literal instead of a string literal, so only check this after the opcode.
385+
return Some(DataType::String);
386+
}
382387
if bytes.len() >= 2 && bytes.iter().position(|&c| c == b'\0') == Some(bytes.len() - 1) {
383388
// It may be an unpooled string if the symbol contains exactly one null byte at the end of the symbol.
384389
return Some(DataType::String);

0 commit comments

Comments
 (0)