Closed filipnavara closed 1 year ago
Amazing, thanks a lot for this!
@filipnavara, in case this is not known, I ran tests (dotnet test src/LibObjectFile.Tests
) on linux-arm64 (Ubuntu 22.04), four tests are failing. Here is the output http://sprunge.us/9szZoA. e.g.
Failed TestDebugInfoSmall [32 ms]
Error Message:
System.NotImplementedException : The relocation for architecture EM_AARCH64 is not supported/implemented.
Stack Trace:
at LibObjectFile.Elf.ElfRelocationTableExtensions.Relocate(ElfRelocationTable relocTable, Stream stream, ElfRelocationContext& context) in /LibObjectFile/src/LibObjectFile/Elf/Sections/ElfRelocationTableExtensions.cs:line 45
at LibObjectFile.Elf.ElfRelocationTableExtensions.Relocate(ElfRelocationTable relocTable, ElfRelocationContext& context) in /LibObjectFile/src/LibObjectFile/Elf/Sections/ElfRelocationTableExtensions.cs:line 28
at LibObjectFile.Dwarf.DwarfElfContext..ctor(ElfObjectFile elf) in /LibObjectFile/src/LibObjectFile/Dwarf/DwarfElfContext.cs:line 102
at LibObjectFile.Tests.Dwarf.DwarfTests.TestDebugInfoSmall() in /LibObjectFile/src/LibObjectFile.Tests/Dwarf/DwarfTests.cs:line 326
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
Yeah, the tests kinda work only on x64 and specific Ubuntu version (or the same version under WSL). They are extremely fragile since they compare readelf
output (which changes with Binutils versions), and gcc
-compiled objects. In this case the gcc
output is arm64 and not the x64 one that is expected, and since gcc
is not naturally a cross-compiler it's not easy to fix with a single flag.
TL;DR: The tests are fixed only enough to pass on Ubuntu 22.04 on x64, or Windows x64 with Ubuntu 22.04 in WSL. Anything else is going to fail one way or another.
Tested on Windows with Ubuntu 22.04 installed in WSL.