Closed bruno-garcia closed 4 years ago
It's just that the test might be to restrictive for that field. PR welcome.
While investigating this, lead me to open #8 .
ELFSharp
chooses whether to use the DirectDecoder or the endianness flipping one based on the Class while LibObjectFIle does that based on the 5th bit (encoding).
I successfully parsed ELF files from Linux x86, ARM and Android using that library so I'm afraid the problem is here.
Also, the output of loading the same library when running on an Android emulator and on my desktop differs. If I force (with the debugger) to use Class to define endienness, the output matches in both.
After the bug fix released on 0.3.2
the behavior on Android and .NET Core 3 match.
In both cases it fails with:
Closing this issue now.
Could you open an issue with attached the ELF file generating such errors?, I'm curious how this can happen.
Is it expected that the library can load ELF files from an Android emulator?
The files in question came from an Android emulator (x86) but I'm processing them via a .NET Core 3.1 console app. ELFSharp can successfully load the same files.
Example output:
Please note these are different errors than when the same code runs on Android.
LibObjectFile
in Android seem not to work for other reasons likely unrelated to the library itself.One of such files is here. It's part of a repro I've made which includes a readme. It also includes more details relevant to
Xamarin.Android
that are not related to this issue.