From ee891958a36f701b5c907df2cb11ea795f42b6ef Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Wed, 12 Aug 2026 13:09:27 -0400 Subject: [PATCH] Detect GCC `$LC` literals as strings --- objdiff-core/src/arch/ppc/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/objdiff-core/src/arch/ppc/mod.rs b/objdiff-core/src/arch/ppc/mod.rs index e60731e4..e3b604ef 100644 --- a/objdiff-core/src/arch/ppc/mod.rs +++ b/objdiff-core/src/arch/ppc/mod.rs @@ -379,6 +379,11 @@ impl Arch for ArchPpc { return Some(ty); } } + if reloc.is_some_and(|r| r.symbol.name.starts_with("$LC")) { + // GCC compiler-generated symbol name for a literal. + // This could be a float literal instead of a string literal, so only check this after the opcode. + return Some(DataType::String); + } if bytes.len() >= 2 && bytes.iter().position(|&c| c == b'\0') == Some(bytes.len() - 1) { // It may be an unpooled string if the symbol contains exactly one null byte at the end of the symbol. return Some(DataType::String);