Are ELF oddities worth handling? #5615
Replies: 5 comments 7 replies
-
I think Ghidra should definitely handle any runnable binary produced by legitimate compiler. If that is the case here, opening a new ticket with the sample attached would be good. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the guidance - I really appreciate the responsiveness. The next discussion point leads into some murky areas: What steps should contributors follow in proposing additions to things like Collecting a large set of reference binaries to import in a CI test is probably doable, but how would you prove that this collection contains no anti-RE license violations? |
Beta Was this translation helpful? Give feedback.
-
Thank you for the discussion. Would @ghidra1 be willing to triage an issue to expose your CI test framework for developer submitted binaries? We wouldn't need the actual binaries you use, just broad metadata describing their type and toolchain. Another approach might collect C and C++ sources, then get the user community to provide their own toolchain to build the binaries and run them through headless analysis with C export for relocation sanity checking. |
Beta Was this translation helpful? Give feedback.
-
@thixotropist what compiler toolchain is producing these symbols? Are such symbols only produced for object modules and never within a fully linked binary? |
Beta Was this translation helpful? Give feedback.
-
It's probably binutils 2-40, possibly as used in the riscv-gnu-toolchain. See https://sourceware.org/binutils/docs-2.20/as/Symbol-Names.html for more details. The I've seen these symbols in riscv-64 object files and linux kernel modules. Riscv toolchains apparently generate a lot of local symbols to support link-time or load-time relaxation and optimization, especially in support of An ASCII string like I've started |
Beta Was this translation helpful? Give feedback.
-
ELF object files can hold oddities that Ghidra flags as errors. These errors don't seem to harm importing and analyzing object files, but they do add confusion and clutter. For example:
Single byte sections
This is thrown because the object file contains
.plt
,.got
, and.got.plt
sections of only one byte in length. Ghidra tries to load 8 bytes at the beginning of at least two of these segments, throwing the error. Ghidra should probably ignore such anomalously short sections instead.Symbol name validation
Symbols like
".L1\x0212"
and".L0\x021"
are not necessarily invalid in ELF, and appear to be used by an assembler or compiler to make local symbols unique. Ghidra marks these as invalid inSymbolUtilities.containsInvalidCharacters
.This behavior is seen in the current release and in 10.4.DEV. with RISCV compilers and kernel load modules. The oddities likely don't appear in RISCV user binaries or x86_64 load modules.
Beta Was this translation helpful? Give feedback.
All reactions